Skip to content

Instantly share code, notes, and snippets.

@brucedkyle
Last active December 30, 2020 18:39
Show Gist options
  • Save brucedkyle/dd6a0bc2cea426419e4aab49c791233e to your computer and use it in GitHub Desktop.
Save brucedkyle/dd6a0bc2cea426419e4aab49c791233e to your computer and use it in GitHub Desktop.
kubernetes deployment
kubectl apply -f nginx-deployment.yml
kubectl create deployment my-dep --image=busybox --port=5701
kubectl describe deployments
kubectl get deployments
$POD_NAME = kubectl get pods --selector=app=kubernetes-dotnetsample -o jsonpath='{.items[*].metadata.name}'
Write-Output $POD_NAME
kubectl create deployment kubernetes-dotnetsample --image=mcr.microsoft.com/dotnet/samples:aspnetapp --port=8080
# view the image field
kubectl describe pods
kubectl get deployments
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
labels:
app: nginx
spec:
replicas: 3
selector:
matchLabels:
app: nginx
## This is a PodTemplate
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.14.2
ports:
- containerPort: 80
## End of PodTemplate
kubectl rollout status deployment/nginx-deployment
# Open a second terminal
curl http://localhost:8001/version
kubectl set image deployment/nginx busybox=busybox nginx=nginx:1.19.6
kubectl set image deployment/nginx busybox=busybox nginx=nginx:typo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment