-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeployment.yaml
More file actions
93 lines (93 loc) · 2.87 KB
/
deployment.yaml
File metadata and controls
93 lines (93 loc) · 2.87 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
apiVersion: apps/v1
kind: Deployment
metadata:
name: mpafastapi
labels:
app.kubernetes.io/name: mpafastapi
{{ include "common.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.pod.replicas | int }}
selector:
matchLabels:
{{ include "common.labels" . | nindent 6 }}
template:
metadata:
labels:
{{ include "common.labels" . | nindent 8 }}
annotations:
prometheus.io/scrape: "true"
prometheus.io/scheme: http
prometheus.io/port: "8000"
prometheus.io/path: /metrics
spec:
serviceAccountName: {{ .Values.sa.name }}
volumes:
- name: config-volume
secret:
secretName: config-mpafastapi
- name: data-volume
emptyDir:
sizeLimit: 10Mi
medium: Memory
containers:
- name: mpafastapi
image: {{ .Values.pod.repository }}:{{ .Chart.AppVersion }}
imagePullPolicy: {{ .Values.pod.imagePullPolicy }}
env:
- name: APP_CONFIG
value: /config/app_config.json
- name: OTEL_SERVICE_NAME
value: "mrmat-python-api-fastapi"
- name: OTEL_TRACES_EXPORTER
value: "otlp"
- name: OTEL_METRICS_EXPORTER
value: "none"
- name: OTEL_LOGS_EXPORTER
value: "none"
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: "jaeger-collector.jaeger.svc.cluster.local:4317"
- name: OTEL_EXPORTER_OTLP_INSECURE
value: "true"
- name: OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
value: "jaeger-collector.jaeger.svc.cluster.local:4317"
- name: OTEL_EXPORTER_OTLP_TRACES_INSECURE
value: "true"
ports:
- name: http
containerPort: {{ .Values.pod.port }}
protocol: TCP
volumeMounts:
- name: config-volume
mountPath: /config
readOnly: true
- name: data-volume
mountPath: /data
securityContext:
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 1000
livenessProbe:
periodSeconds: 10
httpGet:
path: /api/healthz/liveness/
port: {{ .Values.pod.port }}
scheme: HTTP
readinessProbe:
periodSeconds: 10
httpGet:
path: /api/healthz/readiness/
port: {{ .Values.pod.port }}
scheme: HTTP
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- topologyKey: "kubernetes.io/hostname"
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- {{ .Values.pod.name }}