-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeployment.yaml
75 lines (75 loc) · 2.17 KB
/
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
---
# based on https://github.com/richstokes/k8s-fah/blob/master/folding-cpu.yaml (Copyright 2020 richstokes et al)
apiVersion: apps/v1
kind: Deployment
metadata:
name: fah-cpu
labels:
app: fah-cpu
spec:
selector:
matchLabels:
app: fah-cpu
replicas: 1
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 100%
maxSurge: 100%
template:
metadata:
labels:
app: fah-cpu
spec:
containers:
- name: fah-cpu
image: {{ .Values.image }}
# --run-as UID should match runAsUser value in containers securityContext
command:
- "/usr/bin/FAHClient"
- "--allow=0/0:7396"
- "--web-allow=0/0:7396"
- "--user=Keptn" # auto generated for the cluster
- "--team=259797" # Keptn Team ID
- "--run-as"
- "1234"
- "--pid-file=/var/lib/fahclient/fahclient.pid"
- "--power=full"
- "--gpu=false"
ports:
- containerPort: 7396
resources:
limits:
cpu: "{{ .Values.replicaCount }}" # How much CPU you wish to donate per pod
memory: 512Mi
requests:
cpu: 100m
memory: 256Mi
# Make the container harder to break out of or exploit
securityContext:
runAsNonRoot: true
runAsUser: 1234
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
livenessProbe:
httpGet:
path: /
port: 7396
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 15
readinessProbe:
httpGet:
path: /
port: 7396
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 15
volumeMounts:
- mountPath: /var/lib/fahclient
name: fahclient
# We make an emptyDir to mount on the work directory /var/lib/fahclient
# so we can make the rest of the container's root filesystem read-only
volumes:
- name: fahclient
emptyDir: {}