Guia-Tutorial-kubernetes/files/yaml-del-pelado/10-hello-v1-v2-deployment-svc.yaml
Manuel Vergara de7a4de537 Restructuración de los contenidos
Signed-off-by: Manuel Vergara <manuel@vergaracarmona.es>
2022-11-12 03:01:25 +01:00

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