Skip to content

Instantly share code, notes, and snippets.

@learngcpwithmahesh
Created May 23, 2022 07:02
Show Gist options
  • Save learngcpwithmahesh/9eed04f714c017565f2f1d841bc75bb3 to your computer and use it in GitHub Desktop.
Save learngcpwithmahesh/9eed04f714c017565f2f1d841bc75bb3 to your computer and use it in GitHub Desktop.
apiVersion: apps/v1
kind: Deployment
metadata:
name: v1-deployment
spec:
replicas: 4
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
selector:
matchLabels:
app: canary
template:
metadata:
labels:
app: canary
spec:
containers:
- name: lgwm-image
image: gcr.io/google-samples/hello-app:1.0
ports:
- containerPort: 8080
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: v2-deployment
spec:
replicas: 4
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
selector:
matchLabels:
app: canary
template:
metadata:
labels:
app: canary
spec:
containers:
- name: lgwm-image
image: gcr.io/google-samples/hello-app:2.0
ports:
- containerPort: 8080
---
apiVersion: v1
kind: Service
metadata:
name: canary-service
spec:
type: LoadBalancer
selector:
app: canary
ports:
- port: 80
targetPort: 8080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment