-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathdeployment.yaml
81 lines (81 loc) · 2.7 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
76
77
78
79
80
81
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "DotNetCoreDocker.fullname" . }}
labels:
{{ include "DotNetCoreDocker.labels" . | indent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "DotNetCoreDocker.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
template:
metadata:
labels:
app.kubernetes.io/name: {{ include "DotNetCoreDocker.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
securityContext:
# runAsUser: 1000
# runAsGroup: 1000
# fsGroup: 1000
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
restartPolicy: Always
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
securityContext:
allowPrivilegeEscalation: false
ports:
- name: http
containerPort: {{ .Values.containerPort }}
protocol: TCP
- name: https
containerPort: {{ .Values.containerPortHttps }}
protocol: TCP
livenessProbe:
httpGet:
path: /api/health
port: {{ .Values.containerPort }}
readinessProbe:
httpGet:
path: /api/health/ready
port: {{ .Values.containerPort }}
initialDelaySeconds: 10 # Start probing after 10 seconds of container creation.
timeoutSeconds: 1 # Timeout if you don't get a response in 1 second.
periodSeconds: 10 # Probe frequency in seconds.
failureThreshold: 2 # Probe declares failure after 2 attempts.
resources:
requests:
memory: "128Mi"
cpu: "100m"
limits:
memory: "256Mi"
cpu: "500m"
env:
- name: MyVar
value: "blah"
- name: Kestrel__Certificates__Default__Path
value: /certs/aspnetcore-cert.pfx
- name: Kestrel__Certificates__Default__Password
valueFrom:
secretKeyRef:
name: {{ .Release.Name }}-secret
key: certificatePassword
volumeMounts:
- name: certificatesvolume
mountPath: /certs/aspnetcore-cert.pfx
subPath: aspnetcore-cert.pfx
readOnly: true
volumes:
- name: certificatesvolume
secret:
secretName: {{ .Release.Name }}-secret
items:
- key: certificate
path: aspnetcore-cert.pfx