-
Notifications
You must be signed in to change notification settings - Fork 0
/
k8s.yaml
173 lines (162 loc) · 3.95 KB
/
k8s.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
161
162
163
164
165
166
167
168
169
170
171
172
173
#app without ssl
# after you need add klinika.jks to pod
# example D:\Project\dev\klinik\src\main\resources\keystore> kubectl cp klinika.jks klinika-5c66d8b6b6-pg5ms:/app/keystore
# where name's pod - klinika-5c66d8b6b6-pg5ms
# path from (cmd ) D:\Project\dev\klinik\src\main\resources\keystore>
# path to /app/keystore
apiVersion: v1
kind: PersistentVolume
metadata:
name: klinika-keys-pv
spec:
capacity:
storage: 1Gi
accessModes:
- ReadWriteOnce
hostPath:
path: /host_mnt/d/Project/dev/klinik/src/main/resources/keys
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: klinika-keystore-pv
spec:
capacity:
storage: 1Gi
accessModes:
- ReadWriteOnce
hostPath:
path: /host_mnt/d/Project/dev/klinik/src/main/resources/keystore
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: klinika-keys-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: klinika-keystore-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
---
apiVersion: v1
kind: Service
metadata:
name: klinika
labels:
k8s-app: klinika
spec:
type: NodePort
selector:
app: klinika
ports:
- name: http
appProtocol: http
protocol: TCP
port: 8082
targetPort: 8082
nodePort: 30082
---
apiVersion: v1
kind: ConfigMap
metadata:
name: klinika-config
data:
SPRING_DATASOURCE_URL: jdbc:postgresql://host.docker.internal:5432/Klinika
SPRING_DATASOURCE_USERNAME: postgres
SPRING_DATASOURCE_PASSWORD: admin
SPRING_JPA_HIBERNATE_DDL_AUTO: none
jwt.private.key: "classpath:keys/private.pem"
jwt.public.key: "classpath:keys/public.pem"
encryption.key: "classpath:keys/encryption.key"
encryption.path: "/app/keys/encryption.key"
generate.keys.path: "/app/keys"
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: klinika
spec:
replicas: 1
selector:
matchLabels:
app: klinika
template:
metadata:
labels:
app: klinika
spec:
containers:
- name: klinika
image: kirillkus/klinika
ports:
- containerPort: 8082
env:
- name: SPRING_DATASOURCE_URL
valueFrom:
configMapKeyRef:
name: klinika-config
key: SPRING_DATASOURCE_URL
- name: SPRING_DATASOURCE_USERNAME
valueFrom:
configMapKeyRef:
name: klinika-config
key: SPRING_DATASOURCE_USERNAME
- name: SPRING_DATASOURCE_PASSWORD
valueFrom:
configMapKeyRef:
name: klinika-config
key: SPRING_DATASOURCE_PASSWORD
- name: SPRING_JPA_HIBERNATE_DDL_AUTO
valueFrom:
configMapKeyRef:
name: klinika-config
key: SPRING_JPA_HIBERNATE_DDL_AUTO
- name: jwt.private.key
valueFrom:
configMapKeyRef:
name: klinika-config
key: jwt.private.key
- name: jwt.public.key
valueFrom:
configMapKeyRef:
name: klinika-config
key: jwt.public.key
- name: encryption.key
valueFrom:
configMapKeyRef:
name: klinika-config
key: encryption.key
- name: encryption.path
valueFrom:
configMapKeyRef:
name: klinika-config
key: encryption.path
- name: generate.keys.path
valueFrom:
configMapKeyRef:
name: klinika-config
key: generate.keys.path
volumeMounts:
- name: keys-volume
mountPath: /app/keys
- name: keystore-volume
mountPath: /app/keystore
volumes:
- name: keys-volume
persistentVolumeClaim:
claimName: klinika-keys-pvc
- name: keystore-volume
persistentVolumeClaim:
claimName: klinika-keystore-pvc