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

66 lines
980 B
YAML
Raw Normal View History

2022-09-19 18:31:05 +02:00
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