arshad75

deployment-objects

Apr 16th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. apiVersion: apps/v1
  2. kind: Deployment
  3. metadata:
  4. name: <your-name>-deployment
  5. spec:
  6. selector:
  7. matchLabels:
  8. app: <your-name>-app
  9. replicas: 2 # tells deployment to run 2 pods matching the template
  10. template:
  11. metadata:
  12. labels:
  13. app: <your-name>-app
  14. spec:
  15. containers:
  16. - name: <your-name>-container
  17. image: nginx:latest
  18. ports:
  19. - containerPort: 80
  20. ---
  21. apiVersion: v1
  22. kind: Service
  23. metadata:
  24. name: <your-name>-service
  25. labels:
  26. app: <your-name>-app
  27. spec:
  28. ports:
  29. - port: 80
  30. selector:
  31. app: <your-name>-app
  32. type: ClusterIP
Add Comment
Please, Sign In to add comment