Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- apiVersion: v1
- kind: Service
- metadata:
- name: building-1-service # http://building-1-service
- spec:
- ports:
- - port: 80
- targetPort: 80
- type: NodePort
- selector:
- app: building-1-pod #matches name of pod being created by deployment
- ---
- apiVersion: v1
- kind: Service
- metadata:
- name: building-2-service # http://building-2-service
- spec:
- ports:
- - port: 80
- targetPort: 80
- type: NodePort
- selector:
- app: building-2-pod #matches name of pod being created by deployment
- ---
- apiVersion: apps/v1beta2
- kind: Deployment
- metadata:
- name: building-1-deployment # name of the deployment
- spec:
- replicas: 1
- selector:
- matchLabels:
- app: building-1-pod # matches name of pod being created
- template:
- metadata:
- labels:
- app: building-1-pod # name of pod, matches name in deployment and route "location /building_1/" in nginx.conf
- spec:
- containers:
- - name: building-container # name of docker container
- image: us.gcr.io//proj-12345/building:2018_03_19_19_45
- resources:
- limits:
- cpu: "1"
- requests:
- cpu: "10m"
- ports:
- - containerPort: 80
- ---
- apiVersion: apps/v1beta2
- kind: Deployment
- metadata:
- name: building-2-deployment # name of the deployment
- spec:
- replicas: 1
- selector:
- matchLabels:
- app: building-2-pod # matches name of pod being created
- template:
- metadata:
- labels:
- app: building-2-pod # name of pod, matches name in deployment and route "location /building_2/" in nginx.conf
- spec:
- containers:
- - name: building-container # name of docker container
- image: us.gcr.io//proj-12345/building:2018_03_19_19_45
- resources:
- limits:
- cpu: "1"
- requests:
- cpu: "10m"
- ports:
- - containerPort: 80
Add Comment
Please, Sign In to add comment