-
Notifications
You must be signed in to change notification settings - Fork 44
/
deploy_node_webapp.yml
53 lines (52 loc) · 1.35 KB
/
deploy_node_webapp.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
---
- hosts: server
gather_facts: false
become: yes
become_user: ubuntu
vars:
ansible_python_interpreter: "/usr/bin/env python3"
tasks:
# Create Kubernetes replica set
- name: Create replicaset object
k8s:
state: present
definition:
apiVersion: apps/v1
kind: ReplicaSet
metadata:
name: webapp
namespace: default
spec:
replicas: 2
selector:
matchLabels:
app: node-webapp
template:
metadata:
labels:
app: node-webapp
spec:
containers:
- name: springapp
image: 403959134869.dkr.ecr.ap-south-1.amazonaws.com/nodeapp
ports:
- containerPort: 8080
imagePullSecrets:
- name: ap-south-1-ecr-registry
- name: Create a Service to access spring app
k8s:
state: present
definition:
apiVersion: v1
kind: Service
metadata:
name: hello-node-webapp
namespace: default
spec:
type: NodePort
ports:
- port: 8080
nodePort: 30003
protocol: TCP
selector:
app: node-webapp