-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeployment.yaml
More file actions
119 lines (119 loc) · 3.54 KB
/
Copy pathdeployment.yaml
File metadata and controls
119 lines (119 loc) · 3.54 KB
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
apiVersion: apps/v1
kind: Deployment
metadata:
name: wallet
namespace: wallet
labels:
app: wallet
app.kubernetes.io/name: wallet
spec:
replicas: 2
selector:
matchLabels:
app: wallet
template:
metadata:
labels:
app: wallet
app.kubernetes.io/name: wallet
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "8080"
prometheus.io/path: "/actuator/prometheus"
spec:
serviceAccountName: wallet
securityContext:
runAsNonRoot: true
fsGroup: 2000
initContainers:
- name: rename-heap-dump
image: ubuntu:20.04
command: ["bash","-c","if [[ -f /dumps/oom.bin ]]; then mv /dumps/oom.bin /dumps/oom-$(date +%s).bin; fi"]
resources:
requests:
cpu: "50m"
memory: "300Mi"
limits:
cpu: "50m"
memory: "300Mi"
volumeMounts:
- name: heap-dumps
mountPath: /dumps
containers:
- name: wallet
image: registry.example.com/dnastack/wallet@sha256:1111111111111111111111111111111111111111111111111111111111111111
imagePullPolicy: IfNotPresent
ports:
- name: http
containerPort: 8080
env:
- name: WALLET_URL
value: "https://wallet.example.internal"
- name: SPRING_DATASOURCE_URL
value: "jdbc:postgresql://postgres.wallet.svc.cluster.local:5432/wallet"
- name: SPRING_DATASOURCE_USERNAME
valueFrom:
secretKeyRef:
name: wallet-db-credentials
key: username
- name: SPRING_DATASOURCE_PASSWORD
valueFrom:
secretKeyRef:
name: wallet-db-credentials
key: password
- name: APP_JDBI_ENCRYPTION_KEYS_WALLET_MASTER_KEY
valueFrom:
secretKeyRef:
name: wallet-master-key
key: key
- name: LOGGING_LEVEL_COM_DNASTACK_WALLET
value: "INFO"
resources:
requests:
cpu: "250m"
memory: "512Mi"
limits:
cpu: "1"
memory: "1Gi"
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
runAsUser: 1000
capabilities:
drop: ["ALL"]
startupProbe:
httpGet:
path: /actuator/health
port: 8080
initialDelaySeconds: 10
periodSeconds: 3
failureThreshold: 60
readinessProbe:
httpGet:
path: /actuator/health
port: 8080
periodSeconds: 10
failureThreshold: 2
livenessProbe:
httpGet:
path: /actuator/health
port: 8080
periodSeconds: 20
failureThreshold: 5
volumeMounts:
- name: heap-dumps
mountPath: /dumps
volumes:
- name: heap-dumps
emptyDir: {}
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
topologyKey: kubernetes.io/hostname
labelSelector:
matchExpressions:
- key: app
operator: In
values: ["wallet"]