Skip to content

Instantly share code, notes, and snippets.

@giang-pham
Last active September 2, 2019 03:55
Show Gist options
  • Save giang-pham/6218d31530b771f96351f7467158a9af to your computer and use it in GitHub Desktop.
Save giang-pham/6218d31530b771f96351f7467158a9af to your computer and use it in GitHub Desktop.
apiVersion: v1
kind: Service
metadata:
name: [SERVICE]
labels:
app: [APP]
spec:
selector:
app: [APP]
ports:
- protocol: TCP
port: 80
name: [HTTP_APP]
targetPort: 9000
type: ClusterIP
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: [APP_DEPLOYMENT_BLUE]
labels:
app: [APP]
version: [INITIAL_VERSION]
subset: blue
spec:
replicas: 2
selector:
matchLabels:
app: [APP]
version: [INITIAL_VERSION]
subset: blue
template:
metadata:
labels:
app: [APP]
version: [INITIAL_VERSION]
subset: blue
spec:
containers:
- name: [APP]
image: [IMAGE_PATH]
imagePullPolicy: IfNotPresent
ports:
- containerPort: 9000
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: [APP_DEPLOYMENT_GREEN]
labels:
app: [APP]
version: [INITIAL_VERSION]
subset: green
spec:
replicas: 2
selector:
matchLabels:
app: [APP]
version: [INITIAL_VERSION]
subset: green
template:
metadata:
labels:
app: [APP]
version: [INITIAL_VERSION]
subset: green
spec:
containers:
- name: [APP]
image: [IMAGE_PATH]
imagePullPolicy: IfNotPresent
ports:
- containerPort: 9000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment