rollingupdate-statefulset-rv2.yaml 677 B

12345678910111213141516171819202122232425262728293031323334
  1. apiVersion: apps/v1beta2
  2. kind: StatefulSet
  3. metadata:
  4. name: nginx
  5. spec:
  6. selector:
  7. matchLabels:
  8. app: nginx-statefulset
  9. updateStrategy:
  10. type: RollingUpdate
  11. serviceName: "nginx"
  12. replicas: 0
  13. template:
  14. metadata:
  15. labels:
  16. app: nginx-statefulset
  17. spec:
  18. terminationGracePeriodSeconds: 5
  19. containers:
  20. - name: nginx
  21. image: k8s.gcr.io/nginx-slim:0.8
  22. ports:
  23. - containerPort: 80
  24. name: web
  25. command:
  26. - sh
  27. - -c
  28. - 'while true; do sleep 1; done'
  29. - name: pause
  30. image: k8s.gcr.io/pause:2.0
  31. ports:
  32. - containerPort: 81
  33. name: web-2