-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathk8-deployment.yaml
160 lines (160 loc) · 3.42 KB
/
k8-deployment.yaml
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
apiVersion: apps/v1
kind: Deployment
metadata:
name: webapp-deployment
spec:
replicas: 1
selector:
matchLabels:
app: webapp
template:
metadata:
labels:
app: webapp
spec:
containers:
- name: webapp
image: sanyambassi/crdp-demo-app:latest
imagePullPolicy: Always
ports:
- containerPort: 80
env:
- name: DB_HOST
value: "mysql-service"
- name: DB_USER
valueFrom:
secretKeyRef:
name: db-secret
key: username
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: db-secret
key: password
- name: DB_NAME
value: "webappdb"
- name: CRDP_HOST
value: "localhost"
- name: CRDP_PORT
value: "8090"
- name: crdp-container
image: thalesciphertrust/ciphertrust-restful-data-protection:latest
imagePullPolicy: IfNotPresent
readinessProbe:
httpGet:
path: /healthz
port: 8090
scheme: HTTP
initialDelaySeconds: 10
periodSeconds: 5
livenessProbe:
httpGet:
path: /liveness
port: 8090
scheme: HTTP
initialDelaySeconds: 10
periodSeconds: 10
env:
- name: KEY_MANAGER_HOST
value:
- name: SERVER_MODE
value: "no-tls"
- name: REGISTRATION_TOKEN
valueFrom:
secretKeyRef:
name: regtoken
key: reg_token
- name: jmeter
image: justb4/jmeter:latest
imagePullPolicy: IfNotPresent
command: [ "sleep", "infinity" ]
volumeMounts:
- name: jmeter-volume
mountPath: /jmeter
imagePullSecrets:
- name: regcred
volumes:
- name: jmeter-volume
emptyDir: {}
---
apiVersion: v1
kind: Service
metadata:
name: webapp-service
spec:
selector:
app: webapp
ports:
- protocol: TCP
port: 80
targetPort: 80
type: LoadBalancer
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: mysql-deployment
spec:
replicas: 1
selector:
matchLabels:
app: mysql
template:
metadata:
labels:
app: mysql
spec:
containers:
- name: mysql
image: mysql:5.7
env:
- name: MYSQL_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: db-secret
key: password
- name: MYSQL_DATABASE
value: "webappdb"
- name: MYSQL_USER
valueFrom:
secretKeyRef:
name: db-secret
key: username
- name: MYSQL_PASSWORD
valueFrom:
secretKeyRef:
name: db-secret
key: password
- name: MYSQL_INITDB_SKIP_TZINFO
value: "1"
volumeMounts:
- name: initdb
mountPath: /docker-entrypoint-initdb.d
ports:
- containerPort: 3306
name: mysql
volumes:
- name: initdb
configMap:
name: mysql-initdb-config
---
apiVersion: v1
kind: Service
metadata:
name: mysql-service
spec:
selector:
app: mysql
ports:
- protocol: TCP
port: 3306
targetPort: 3306
---
apiVersion: v1
kind: Secret
metadata:
name: db-secret
type: Opaque
data:
username: ZGVtb3VzZXI=
password: RGVtb1Bhc3N3b3Jk