apiVersion: apps/v1
kind: Deployment
metadata:
name: backend-deployment
spec:
replicas: 1
selector:
matchLabels: # tells what pods the deployment will apply to, refer to line number 11 for pod template
app: dev-backend
template: # actually, this is the pod template, describes a pod that is launched
metadata:
labels:
app: dev-backend # this should match with the matchLabels value above, otherwise, this kind of pod will not be controlled by the above deployment
spec:
containers:
- name: backend-container
image: asia.gcr.io/mhdanh-hello-kubernete/api-backend
# Add opening port
ports: #+
- containerPort: 8080 #+
name: http #+
- containerPort: 9990 #+
name: http-admin #+
---
kind: Service #+
apiVersion: v1 #+
metadata: #+
name: backend-service #+
spec: #+
selector: #+
app: dev-backend #+
ports: #+
- protocol: TCP #+
targetPort: 8080 #+
port: 8080 #+
name: http #+
- protocol: TCP #+
targetPort: 9990 #+
port: 9990 #+
name: http-admin #+
type: LoadBalancer #+
loadBalancerIP: 35.240.212.150 #++ with the static IP address
Monday, August 12, 2019
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment