Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---
- # tasks file for bookstore
- - name: Create the mongodb deployment
- k8s:
- definition:
- kind: Deployment
- apiVersion: apps/v1beta1
- metadata:
- name: mongodb-deployment
- namespace: '{{ meta.namespace }}'
- spec:
- replicas: 1
- selector:
- matchLabels:
- app: book-store-mongodb
- template:
- metadata:
- labels:
- app: book-store-mongodb
- spec:
- containers:
- - name: mongodb
- image: "{{image.mongodb.repository}}:{{image.mongodb.tag}}"
- imagePullPolicy: "{{ image.mongodb.pull_policy }}"
- ports:
- - containerPort: 27017
- - name: Create the mongodb service
- k8s:
- definition:
- apiVersion: v1
- kind: Service
- metadata:
- name: mongodb-service
- namespace: '{{ meta.namespace }}'
- labels:
- app: book-store-mongodb
- spec:
- type: "{{service.mongodb.type}}"
- ports:
- - name: elb-port
- port: 27017
- protocol: TCP
- targetPort: 27017
- selector:
- app: book-store-mongodb
- - name: Create the bookstore deployment
- k8s:
- definition:
- kind: Deployment
- apiVersion: apps/v1beta1
- metadata:
- name: book-store
- namespace: '{{ meta.namespace }}'
- spec:
- replicas: 1
- selector:
- matchLabels:
- app: book-store
- template:
- metadata:
- labels:
- app: book-store
- spec:
- containers:
- - name: book-store
- image: "{{image.app.repository}}:{{image.app.tag}}"
- imagePullPolicy: "{{image.app.pull_policy}}"
- ports:
- - containerPort: 3000
- - name: Create the bookstore service
- k8s:
- definition:
- apiVersion: v1
- kind: Service
- metadata:
- name: book-store
- namespace: '{{ meta.namespace }}'
- labels:
- app: book-store
- spec:
- type: "{{service.app.type}}"
- ports:
- - name: elb-port
- port: 80
- protocol: TCP
- targetPort: 3000
- selector:
- app: book-store
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement