Skip to content

Instantly share code, notes, and snippets.

@nordineb
Created December 14, 2022 14:46
Show Gist options
  • Save nordineb/97d1f0dbb57afe3e963abb653e8e667f to your computer and use it in GitHub Desktop.
Save nordineb/97d1f0dbb57afe3e963abb653e8e667f to your computer and use it in GitHub Desktop.
app.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: store-v1
namespace: store-ns
spec:
replicas: 2
selector:
matchLabels:
app: store
version: v1
template:
metadata:
labels:
app: store
version: v1
spec:
containers:
- name: whereami
image: us-docker.pkg.dev/google-samples/containers/gke/whereami:v1.2.11
ports:
- containerPort: 8080
env:
- name: METADATA
value: "store-v1"
---
apiVersion: v1
kind: Service
metadata:
name: store-v1
namespace: store-ns
spec:
selector:
app: store
version: v1
ports:
- port: 8080
targetPort: 8080
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: store-v2
namespace: store-ns-2
spec:
replicas: 2
selector:
matchLabels:
app: store
version: v2
template:
metadata:
labels:
app: store
version: v2
spec:
containers:
- name: whereami
image: us-docker.pkg.dev/google-samples/containers/gke/whereami:v1.2.11
ports:
- containerPort: 8080
env:
- name: METADATA
value: "store-v2"
---
apiVersion: v1
kind: Service
metadata:
name: store-v2
namespace: store-ns-2
spec:
selector:
app: store
version: v2
ports:
- port: 8080
targetPort: 8080
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: store-german
namespace: store-ns-3
spec:
replicas: 2
selector:
matchLabels:
app: store
version: german
template:
metadata:
labels:
app: store
version: german
spec:
containers:
- name: whereami
image: us-docker.pkg.dev/google-samples/containers/gke/whereami:v1.2.11
ports:
- containerPort: 8080
env:
- name: METADATA
value: "Gutentag!"
---
apiVersion: v1
kind: Service
metadata:
name: store-german
namespace: store-ns-3
spec:
selector:
app: store
version: german
ports:
- port: 8080
targetPort: 8080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment