Advertisement
Guest User

Untitled

a guest
Sep 19th, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.19 KB | None | 0 0
  1. ---
  2. # tasks file for bookstore
  3.  
  4. - name: Create the mongodb deployment
  5. k8s:
  6. definition:
  7. kind: Deployment
  8. apiVersion: apps/v1beta1
  9. metadata:
  10. name: mongodb-deployment
  11. namespace: '{{ meta.namespace }}'
  12. spec:
  13. replicas: 1
  14. selector:
  15. matchLabels:
  16. app: book-store-mongodb
  17. template:
  18. metadata:
  19. labels:
  20. app: book-store-mongodb
  21. spec:
  22. containers:
  23. - name: mongodb
  24. image: "{{image.mongodb.repository}}:{{image.mongodb.tag}}"
  25. imagePullPolicy: "{{ image.mongodb.pull_policy }}"
  26. ports:
  27. - containerPort: 27017
  28.  
  29. - name: Create the mongodb service
  30. k8s:
  31. definition:
  32. apiVersion: v1
  33. kind: Service
  34. metadata:
  35. name: mongodb-service
  36. namespace: '{{ meta.namespace }}'
  37. labels:
  38. app: book-store-mongodb
  39. spec:
  40. type: "{{service.mongodb.type}}"
  41. ports:
  42. - name: elb-port
  43. port: 27017
  44. protocol: TCP
  45. targetPort: 27017
  46. selector:
  47. app: book-store-mongodb
  48. - name: Create the bookstore deployment
  49. k8s:
  50. definition:
  51. kind: Deployment
  52. apiVersion: apps/v1beta1
  53. metadata:
  54. name: book-store
  55. namespace: '{{ meta.namespace }}'
  56. spec:
  57. replicas: 1
  58. selector:
  59. matchLabels:
  60. app: book-store
  61. template:
  62. metadata:
  63. labels:
  64. app: book-store
  65. spec:
  66. containers:
  67. - name: book-store
  68. image: "{{image.app.repository}}:{{image.app.tag}}"
  69. imagePullPolicy: "{{image.app.pull_policy}}"
  70. ports:
  71. - containerPort: 3000
  72.  
  73. - name: Create the bookstore service
  74. k8s:
  75. definition:
  76. apiVersion: v1
  77. kind: Service
  78. metadata:
  79. name: book-store
  80. namespace: '{{ meta.namespace }}'
  81. labels:
  82. app: book-store
  83. spec:
  84. type: "{{service.app.type}}"
  85. ports:
  86. - name: elb-port
  87. port: 80
  88. protocol: TCP
  89. targetPort: 3000
  90. selector:
  91. app: book-store
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement