blob: d83db52a8f6be256e55f9628dca3dad1cb3f6394 [file] [log] [blame]
Hung-Wei Chiu1887b932021-04-05 16:59:28 -07001# Copyright 2020-present Open Networking Foundation
Scott Baker4cad5ee2022-06-09 14:17:35 -07002# SPDX-License-Identifier: Apache-2.0
Hung-Wei Chiu1887b932021-04-05 16:59:28 -07003
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:
Hung-Wei Chiu2e439de2022-02-25 20:42:56 -080012 app: opensearch-config
Hung-Wei Chiu1887b932021-04-05 16:59:28 -070013 template:
14 metadata:
Hung-Wei Chiu40bf9bf2021-06-22 19:15:51 -070015 labels:
Hung-Wei Chiu2e439de2022-02-25 20:42:56 -080016 app: opensearch-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}}"
Hung-Wei Chiu8676d082022-02-24 14:11:03 -080025 - 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 Chiu1887b932021-04-05 16:59:28 -070031 {{ 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 }}