-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathstatefulset-tomcat.yaml
51 lines (50 loc) · 1.21 KB
/
statefulset-tomcat.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
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: backend
spec:
serviceName: tomcat-service
podManagementPolicy: "Parallel"
selector:
matchLabels:
app: tomcat-test
tier: backend
track: stable
replicas: 3
template:
metadata:
labels:
app: tomcat-test
tier: backend
track: stable
spec:
containers:
- name: tomcat-9
image: tomcat:9.0
command: ["/bin/sh","-c"]
args: ["printf '%s' $API_TOKEN > $SA_TOKEN_FILE && catalina.sh run"]
volumeMounts:
- mountPath: /usr/local/tomcat/conf/server.xml
subPath: server.xml
readOnly: true
name: serverxml
ports:
- name: http
protocol: TCP
containerPort: 8080
env:
- name: SA_TOKEN_FILE
value: /usr/local/tokenFile
- name: KUBERNETES_NAMESPACE
value: {namespace}
- name: API_TOKEN
valueFrom:
secretKeyRef:
name: "api-access-token"
key: "token"
volumes:
- name: serverxml
configMap:
name: testconfig
...