Created
September 9, 2019 08:08
-
-
Save akash-gautam/c400db0c3781fe121867392e2b749798 to your computer and use it in GitHub Desktop.
mai tasks file for bookstore Ansible role.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
# 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment