Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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