Guest User

Untitled

a guest
Apr 19th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.81 KB | None | 0 0
  1. apiVersion: v1
  2. kind: Service
  3. metadata:
  4. name: building-1-service # http://building-1-service
  5. spec:
  6. ports:
  7. - port: 80
  8. targetPort: 80
  9. type: NodePort
  10. selector:
  11. app: building-1-pod #matches name of pod being created by deployment
  12. ---
  13. apiVersion: v1
  14. kind: Service
  15. metadata:
  16. name: building-2-service # http://building-2-service
  17. spec:
  18. ports:
  19. - port: 80
  20. targetPort: 80
  21. type: NodePort
  22. selector:
  23. app: building-2-pod #matches name of pod being created by deployment
  24. ---
  25. apiVersion: apps/v1beta2
  26. kind: Deployment
  27. metadata:
  28. name: building-1-deployment # name of the deployment
  29. spec:
  30. replicas: 1
  31. selector:
  32. matchLabels:
  33. app: building-1-pod # matches name of pod being created
  34. template:
  35. metadata:
  36. labels:
  37. app: building-1-pod # name of pod, matches name in deployment and route "location /building_1/" in nginx.conf
  38. spec:
  39. containers:
  40. - name: building-container # name of docker container
  41. image: us.gcr.io//proj-12345/building:2018_03_19_19_45
  42. resources:
  43. limits:
  44. cpu: "1"
  45. requests:
  46. cpu: "10m"
  47. ports:
  48. - containerPort: 80
  49. ---
  50. apiVersion: apps/v1beta2
  51. kind: Deployment
  52. metadata:
  53. name: building-2-deployment # name of the deployment
  54. spec:
  55. replicas: 1
  56. selector:
  57. matchLabels:
  58. app: building-2-pod # matches name of pod being created
  59. template:
  60. metadata:
  61. labels:
  62. app: building-2-pod # name of pod, matches name in deployment and route "location /building_2/" in nginx.conf
  63. spec:
  64. containers:
  65. - name: building-container # name of docker container
  66. image: us.gcr.io//proj-12345/building:2018_03_19_19_45
  67. resources:
  68. limits:
  69. cpu: "1"
  70. requests:
  71. cpu: "10m"
  72. ports:
  73. - containerPort: 80
Add Comment
Please, Sign In to add comment