-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdeployment.yaml
133 lines (131 loc) · 4.86 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
123
124
125
126
127
128
129
130
131
132
133
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "splunk-sli-provider.fullname" . }}
namespace: {{ .Values.namespace | default .Release.Namespace }}
labels:
{{- include "splunk-sli-provider.labels" . | nindent 4 }}
spec:
replicas: 1
selector:
matchLabels:
{{- include "splunk-sli-provider.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "splunk-sli-provider.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "splunk-sli-provider.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: splunk-sli-provider
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.splunkservice.image.repository }}:{{ .Values.splunkservice.image.tag | default .Chart.AppVersion }}"
{{- end }}
imagePullPolicy: {{ .Values.splunkservice.image.pullPolicy }}
ports:
- containerPort: 80
envFrom:
- secretRef:
name: "{{ include "splunk-sli-provider.secret" . }}"
optional: true
env:
- name: env
value: 'production'
- name: LOG_LEVEL
value: "{{ .Values.splunkservice.logLevel }}"
- name: ALERT_SUPPRESS_PERIOD
value: "{{ .Values.splunkservice.alertSuppressPeriod }}"
- name: CRON_SCHEDULE
value: "{{ .Values.splunkservice.cronSchedule }}"
- name: DISPATCH_EARLIEST_TIME
value: "{{ .Values.splunkservice.dispatchEarliestTime }}"
- name: DISPATCH_LATEST_TIME
value: "{{ .Values.splunkservice.dispatchLatestTime }}"
- name: ACTIONS
value: "{{ .Values.splunkservice.actions }}"
- name: WEBHOOK_URL
value: "{{ .Values.splunkservice.webhookUrl }}"
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: {{ .Values.subscription.pubsubTopic }}
- 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 }}