statefulSet kubectl rollout command

This commit is contained in:
crimsonfaith91
2017-08-07 14:49:46 -07:00
parent 2f00e6d72c
commit ebdbafd2c5
14 changed files with 310 additions and 113 deletions

View File

@@ -0,0 +1,33 @@
apiVersion: apps/v1beta2
kind: StatefulSet
metadata:
name: nginx
spec:
selector:
matchLabels:
app: nginx-statefulset
updateStrategy:
type: RollingUpdate
serviceName: "nginx"
replicas: 0
template:
metadata:
labels:
app: nginx-statefulset
spec:
terminationGracePeriodSeconds: 5
containers:
- name: nginx
image: gcr.io/google_containers/nginx-slim:0.8
ports:
- containerPort: 80
name: web
command:
- sh
- -c
- 'while true; do sleep 1; done'
- name: pause
image: gcr.io/google-containers/pause:2.0
ports:
- containerPort: 81
name: web-2

View File

@@ -1,26 +1,13 @@
# A headless service to create DNS records
apiVersion: v1
kind: Service
metadata:
annotations:
service.alpha.kubernetes.io/tolerate-unready-endpoints: "true"
name: nginx
labels:
app: nginx-statefulset
spec:
ports:
- port: 80
name: web
# *.nginx.default.svc.cluster.local
clusterIP: None
selector:
app: nginx-statefulset
---
apiVersion: apps/v1beta1
apiVersion: apps/v1beta2
kind: StatefulSet
metadata:
name: nginx
spec:
selector:
matchLabels:
app: nginx-statefulset
updateStrategy:
type: RollingUpdate
serviceName: "nginx"
replicas: 0
template:
@@ -28,7 +15,7 @@ spec:
labels:
app: nginx-statefulset
spec:
terminationGracePeriodSeconds: 0
terminationGracePeriodSeconds: 5
containers:
- name: nginx
image: gcr.io/google_containers/nginx-slim:0.7