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: |
Hung-Wei Chiu | 2e439de | 2022-02-25 20:42:56 -0800 | [diff] [blame] | 12 | app: opensearch-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: |
Hung-Wei Chiu | 2e439de | 2022-02-25 20:42:56 -0800 | [diff] [blame] | 16 | app: opensearch-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}}" |
Hung-Wei Chiu | 8676d08 | 2022-02-24 14:11:03 -0800 | [diff] [blame] | 25 | - name: AUTH_USERNAME |
| 26 | value: "{{ .Values.elasticsearch.auth.username}}" |
| 27 | - name: AUTH_PASSWORD |
| 28 | value: "{{ .Values.elasticsearch.auth.password}}" |
| 29 | - name: SKIP_TLS |
| 30 | value: "{{ .Values.elasticsearch.auth.skip_tls}}" |
Hung-Wei Chiu | 1887b93 | 2021-04-05 16:59:28 -0700 | [diff] [blame] | 31 | {{ if .Values.configuration.setting }} |
| 32 | - name: SETTING_DIR |
| 33 | value: "{{ .Values.configuration.base_dir }}/{{ .Values.configuration.setting }}" |
| 34 | {{ end }} |
| 35 | {{ if .Values.configuration.monitor }} |
| 36 | - name: MONITOR_DIR |
| 37 | value: "{{ .Values.configuration.base_dir }}/{{ .Values.configuration.monitor }}" |
| 38 | {{ end }} |
| 39 | {{ if .Values.configuration.destination }} |
| 40 | - name: DEST_DIR |
| 41 | value: "{{ .Values.configuration.base_dir }}/{{ .Values.configuration.destination }}" |
| 42 | {{ end }} |
| 43 | volumeMounts: |
| 44 | - name: config-script |
| 45 | mountPath: /tmp/update.sh |
| 46 | subPath: update.sh |
| 47 | {{ if .Values.configuration.setting }} |
| 48 | - name: setting-configs |
| 49 | mountPath: "{{ .Values.configuration.base_dir }}/{{ .Values.configuration.setting }}" |
| 50 | {{ end }} |
| 51 | {{ if .Values.configuration.monitor }} |
| 52 | - name: monitor-configs |
| 53 | mountPath: "{{ .Values.configuration.base_dir }}/{{ .Values.configuration.monitor }}" |
| 54 | {{ end }} |
| 55 | {{ if .Values.configuration.destination }} |
| 56 | - name: destination-configs |
| 57 | mountPath: "{{ .Values.configuration.base_dir }}/{{ .Values.configuration.destination }}" |
| 58 | {{ end }} |
| 59 | command: ["sh", "-c", "/tmp/update.sh"] |
| 60 | volumes: |
| 61 | - name: "config-script" |
| 62 | configMap: |
| 63 | name: "{{ .Release.Name }}-scripts" |
| 64 | defaultMode: 0755 |
| 65 | {{ if .Values.configuration.setting }} |
| 66 | - name: "setting-configs" |
| 67 | configMap: |
| 68 | name: "{{ .Values.configuration.setting_configmap }}" |
| 69 | defaultMode: 0644 |
| 70 | {{ end }} |
| 71 | {{ if .Values.configuration.monitor }} |
| 72 | - name: "monitor-configs" |
| 73 | configMap: |
| 74 | name: "{{ .Values.configuration.monitor_configmap }}" |
| 75 | defaultMode: 0644 |
| 76 | {{ end }} |
| 77 | {{ if .Values.configuration.destination }} |
| 78 | - name: "destination-configs" |
| 79 | secret: |
| 80 | secretName: "{{ .Values.configuration.destination_secret }}" |
| 81 | defaultMode: 0644 |
| 82 | {{ end }} |