/
statefulset.yaml
122 lines (115 loc) · 2.63 KB
/
statefulset.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
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: jms-statefulset
spec:
replicas: 1
selector:
matchLabels:
app: jms
serviceName: jms
template:
metadata:
name: jms
labels:
app: jms
spec:
containers:
- name: jms-api
image: zhoushoujian/jms:latest
imagePullPolicy: Always
env:
- name: API
value: "true"
volumeMounts:
- mountPath: /opt/jms/config.yaml
subPath: config.yaml
name: jms-config-volume
readOnly: true
- mountPath: /opt/jms/
name: ssh-volume
resources:
limits:
cpu: 1
memory: 1Gi
requests:
cpu: 0.1
memory: 256Mi
ports:
- name: api
containerPort: 8013
protocol: TCP
- name: jms
image: zhoushoujian/jms:latest
imagePullPolicy: Always
env:
- name: WITH_SSH_CHECK
value: "true"
- name: SSH_DIR
value: /opt/jms/.ssh/
volumeMounts:
- mountPath: /opt/jms/
name: ssh-volume
- mountPath: /opt/logs/
name: logs-volume
readOnly: false
- mountPath: /opt/jms/config.yaml
subPath: config.yaml
name: jms-config-volume
readOnly: true
resources:
limits:
cpu: 1
memory: 1Gi
requests:
cpu: 0.1
memory: 256Mi
ports:
- name: ssh
containerPort: 22222
protocol: TCP
volumes:
- name: jms-config-volume # 安全原因 configmap.yaml是没有上传的,需要自己去集群修改。
configMap:
name: jms-config
- name: ssh-volume
persistentVolumeClaim:
claimName: s-ops-jms-ssh-claim
- name: logs-volume
hostPath:
path: /mnt/logs/jms-tools/
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: jms-ssh-claim
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 80Gi
---
apiVersion: v1
kind: Service
metadata:
name: jms-svc
spec:
ports:
- port: 22222
targetPort: 22222
protocol: TCP
name: ssh
- port: 8013
targetPort: 8013
protocol: TCP
name: api
type: NodePort
---
apiVersion: v1
kind: ConfigMap
metadata:
name: jms-config
data:
config.yaml: |
# 请查看 config.yaml 的配置后在此配置。