Advertisement
irobust

YAML for Kubernetes Deployments and Service

Jun 18th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. apiVersion: apps/v1beta1
  2. kind: Deployment
  3. metadata:
  4. name: helloworld-all-deployment
  5. spec:
  6. selector:
  7. matchLabels:
  8. app: helloworld
  9. replicas: 1 # tells deployment to run 1 pods matching the template
  10. template: # create pods using pod definition in this template
  11. metadata:
  12. labels:
  13. app: helloworld
  14. spec:
  15. containers:
  16. - name: helloworld
  17. image: karthequian/helloworld:latest
  18. ports:
  19. - containerPort: 80
  20. ---
  21. apiVersion: v1
  22. kind: Service
  23. metadata:
  24. name: helloworld-all-service
  25. spec:
  26. # if your cluster supports it, uncomment the following to automatically create
  27. # an external load-balanced IP for the frontend service.
  28. type: LoadBalancer
  29. ports:
  30. - port: 80
  31. protocol: TCP
  32. targetPort: 80
  33. selector:
  34. app: helloworld
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement