Guia-Tutorial-kubernetes/yaml-del-pelado/10-hello-v1-v2-deployment-svc.yaml

66 lines
980 B
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: hello-v1
spec:
replicas: 3
selector:
matchLabels:
role: hello-v1
template:
metadata:
labels:
role: hello-v1
spec:
containers:
- name: hello-v1
image: gcr.io/google-samples/hello-app:1.0
ports:
- containerPort: 8080
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: hello-v2
spec:
replicas: 3
selector:
matchLabels:
role: hello-v2
template:
metadata:
labels:
role: hello-v2
spec:
containers:
- name: hello-v2
image: gcr.io/google-samples/hello-app:2.0
ports:
- containerPort: 8080
---
apiVersion: v1
kind: Service
metadata:
name: hello-v1
spec:
ports:
- port: 8080
targetPort: 8080
selector:
role: hello-v1
---
apiVersion: v1
kind: Service
metadata:
name: hello-v2
spec:
ports:
- port: 8080
targetPort: 8080
selector:
role: hello-v2