Hung-Wei Chiu | 1887b93 | 2021-04-05 16:59:28 -0700 | [diff] [blame] | 1 | # Copyright 2020-present Open Networking Foundation |
| 2 | # SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0 |
| 3 | |
Hung-Wei Chiu | 40bf9bf | 2021-06-22 19:15:51 -0700 | [diff] [blame] | 4 | apiVersion: apps/v1 |
| 5 | kind: Deployment |
Hung-Wei Chiu | 1887b93 | 2021-04-05 16:59:28 -0700 | [diff] [blame] | 6 | metadata: |
| 7 | name: "{{ .Release.Name }}" |
| 8 | spec: |
Hung-Wei Chiu | 40bf9bf | 2021-06-22 19:15:51 -0700 | [diff] [blame] | 9 | replicas: 1 |
| 10 | selector: |
| 11 | matchLabels: |
| 12 | app: opendistro-config |
Hung-Wei Chiu | 1887b93 | 2021-04-05 16:59:28 -0700 | [diff] [blame] | 13 | template: |
| 14 | metadata: |
Hung-Wei Chiu | 40bf9bf | 2021-06-22 19:15:51 -0700 | [diff] [blame] | 15 | labels: |
| 16 | app: opendistro-config |
Hung-Wei Chiu | 1887b93 | 2021-04-05 16:59:28 -0700 | [diff] [blame] | 17 | spec: |
Hung-Wei Chiu | 1887b93 | 2021-04-05 16:59:28 -0700 | [diff] [blame] | 18 | 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 }} |