blob: b1e43f426cbacbc817dcbee88fc1d1df64685782 [file] [log] [blame]
Hung-Wei Chiu1887b932021-04-05 16:59:28 -07001# Copyright 2020-present Open Networking Foundation
2# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
3
Hung-Wei Chiu40bf9bf2021-06-22 19:15:51 -07004apiVersion: apps/v1
5kind: Deployment
Hung-Wei Chiu1887b932021-04-05 16:59:28 -07006metadata:
7 name: "{{ .Release.Name }}"
8spec:
Hung-Wei Chiu40bf9bf2021-06-22 19:15:51 -07009 replicas: 1
10 selector:
11 matchLabels:
12 app: opendistro-config
Hung-Wei Chiu1887b932021-04-05 16:59:28 -070013 template:
14 metadata:
Hung-Wei Chiu40bf9bf2021-06-22 19:15:51 -070015 labels:
16 app: opendistro-config
Hung-Wei Chiu1887b932021-04-05 16:59:28 -070017 spec:
Hung-Wei Chiu1887b932021-04-05 16:59:28 -070018 containers:
19 - name: config
20 image: opennetworking/utils:jq-kubectl-curl
21 imagePullPolicy: IfNotPresent
22 env:
23 - name: ES_URL
24 value: "{{ .Values.elasticsearch.host }}:{{ .Values.elasticsearch.port}}"
25 {{ if .Values.configuration.setting }}
26 - name: SETTING_DIR
27 value: "{{ .Values.configuration.base_dir }}/{{ .Values.configuration.setting }}"
28 {{ end }}
29 {{ if .Values.configuration.monitor }}
30 - name: MONITOR_DIR
31 value: "{{ .Values.configuration.base_dir }}/{{ .Values.configuration.monitor }}"
32 {{ end }}
33 {{ if .Values.configuration.destination }}
34 - name: DEST_DIR
35 value: "{{ .Values.configuration.base_dir }}/{{ .Values.configuration.destination }}"
36 {{ end }}
37 volumeMounts:
38 - name: config-script
39 mountPath: /tmp/update.sh
40 subPath: update.sh
41 {{ if .Values.configuration.setting }}
42 - name: setting-configs
43 mountPath: "{{ .Values.configuration.base_dir }}/{{ .Values.configuration.setting }}"
44 {{ end }}
45 {{ if .Values.configuration.monitor }}
46 - name: monitor-configs
47 mountPath: "{{ .Values.configuration.base_dir }}/{{ .Values.configuration.monitor }}"
48 {{ end }}
49 {{ if .Values.configuration.destination }}
50 - name: destination-configs
51 mountPath: "{{ .Values.configuration.base_dir }}/{{ .Values.configuration.destination }}"
52 {{ end }}
53 command: ["sh", "-c", "/tmp/update.sh"]
54 volumes:
55 - name: "config-script"
56 configMap:
57 name: "{{ .Release.Name }}-scripts"
58 defaultMode: 0755
59 {{ if .Values.configuration.setting }}
60 - name: "setting-configs"
61 configMap:
62 name: "{{ .Values.configuration.setting_configmap }}"
63 defaultMode: 0644
64 {{ end }}
65 {{ if .Values.configuration.monitor }}
66 - name: "monitor-configs"
67 configMap:
68 name: "{{ .Values.configuration.monitor_configmap }}"
69 defaultMode: 0644
70 {{ end }}
71 {{ if .Values.configuration.destination }}
72 - name: "destination-configs"
73 secret:
74 secretName: "{{ .Values.configuration.destination_secret }}"
75 defaultMode: 0644
76 {{ end }}