generated from keptn-sandbox/keptn-service-template-go
-
Notifications
You must be signed in to change notification settings - Fork 5
/
deployment.yaml
122 lines (120 loc) · 4.42 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
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
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "datadog-service.fullname" . }}
namespace: {{ .Values.namespace | default .Release.Namespace }}
labels:
{{- include "datadog-service.labels" . | nindent 4 }}
spec:
replicas: 1
selector:
matchLabels:
{{- include "datadog-service.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "datadog-service.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "datadog-service.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: datadog-service
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
{{- if .Values.image }}
image: {{ .Values.image }} # use image from .Values.image (e.g., when starting via skaffold)
{{- else }}
image: "{{ .Values.datadogservice.image.repository }}:{{ .Values.datadogservice.image.tag | default .Chart.AppVersion }}"
{{- end }}
imagePullPolicy: {{ .Values.datadogservice.image.pullPolicy }}
ports:
- containerPort: 80
envFrom:
- secretRef:
name: "{{ include "datadog-service.secret" . }}"
env:
- name: env
value: 'production'
- name: SLEEP_BEFORE_API_IN_SECONDS
value: "{{ .Values.datadogservice.sleepBeforeAPIInSeconds }}"
- name: LOG_LEVEL
value: "{{ .Values.datadogservice.logLevel }}"
resources:
{{- toYaml .Values.resources | nindent 12 }}
- name: distributor
image: "{{ .Values.distributor.image.repository }}:{{ .Values.distributor.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: Always
ports:
- containerPort: 8080
resources:
requests:
memory: "32Mi"
cpu: "50m"
limits:
memory: "128Mi"
cpu: "500m"
env:
- name: PUBSUB_TOPIC
value: 'sh.keptn.event.monitoring.configure,sh.keptn.event.configure-monitoring.triggered,sh.keptn.event.get-sli.triggered'
- name: PUBSUB_RECIPIENT
value: '127.0.0.1'
- name: STAGE_FILTER
value: "{{ .Values.distributor.stageFilter }}"
- name: PROJECT_FILTER
value: "{{ .Values.distributor.projectFilter }}"
- name: SERVICE_FILTER
value: "{{ .Values.distributor.serviceFilter }}"
- name: VERSION
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: 'metadata.labels[''app.kubernetes.io/version'']'
- name: K8S_DEPLOYMENT_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: 'metadata.labels[''app.kubernetes.io/name'']'
- name: K8S_POD_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.name
- name: K8S_NAMESPACE
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
- name: K8S_NODE_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: spec.nodeName
{{- if .Values.remoteControlPlane.enabled }}
- name: KEPTN_API_ENDPOINT
value: "{{ .Values.remoteControlPlane.api.protocol }}://{{ .Values.remoteControlPlane.api.hostname }}/api"
- name: KEPTN_API_TOKEN
value: "{{ .Values.remoteControlPlane.api.token }}"
- name: HTTP_SSL_VERIFY
value: "{{ .Values.remoteControlPlane.api.apiValidateTls | default "true" }}"
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}