Skip to content

Instantly share code, notes, and snippets.

@dejanstojanovic
Created September 6, 2018 10:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dejanstojanovic/26c03101be515efec0a3bce0ca31a585 to your computer and use it in GitHub Desktop.
Save dejanstojanovic/26c03101be515efec0a3bce0ca31a585 to your computer and use it in GitHub Desktop.
k8 deployment config and commands
#### m7-03
kubectl delete rc hello-rc
kubectl get pods
kubectl describe svc hello-svc
vim deploy.yml
kubectl create deployment
kubectl describe deploy hello-deploy
kubectl get rs
kubectl describe rs
#### m7-04
kubectl apply -f deploy.yml --record
kubectl rollout status deployments hello-deploy
kubectl get deploy hello-deploy
kubectl rollout history deployments hello-deploy
kubectl get rs
kubectl describe deploy hello-deploy
kubectl rollout undo deployment hello-deploy --to-revision=1
kubectl get deploy
kubectl rollout status deployments hello-deploy
################# Final deployment YAML file used
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: hello-deploy
spec:
replicas: 10
minReadySeconds: 10
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 1
maxSurge: 1
template:
metadata:
labels:
app: hello-world
spec:
containers:
- name: hello-pod
image: nigelpoulton/pluralsight-docker-ci:latest
ports:
- containerPort: 8080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment