Revert "Revert "oran-shell-release: release image for F""
[pti/rtp.git] / meta-starlingx / meta-stx-flock / stx-monitor-armada-app / monitor-helm / 0005-decouple-config.patch
1 From ac9bce2e01870d8623dc7910cd68079d56f917ca Mon Sep 17 00:00:00 2001
2 From: Kevin Smith <kevin.smith@windriver.com>
3 Date: Wed, 11 Sep 2019 18:07:50 -0400
4 Subject: [PATCH 1/1] decouple config
5
6 ---
7  stable/elasticsearch/templates/configmap.yaml | 8 ++++++++
8  stable/elasticsearch/values.yaml              | 1 +
9  stable/filebeat/templates/configmap.yaml      | 2 +-
10  stable/metricbeat/templates/configmap.yaml    | 2 +-
11  stable/metricbeat/values.yaml                 | 6 ++++--
12  5 files changed, 15 insertions(+), 4 deletions(-)
13
14 diff --git a/stable/elasticsearch/templates/configmap.yaml b/stable/elasticsearch/templates/configmap.yaml
15 index 977ee9a..6bc2065 100644
16 --- a/stable/elasticsearch/templates/configmap.yaml
17 +++ b/stable/elasticsearch/templates/configmap.yaml
18 @@ -87,6 +87,14 @@ data:
19      gateway.recover_after_time: ${RECOVER_AFTER_TIME:5m}
20      gateway.recover_after_master_nodes: ${RECOVER_AFTER_MASTER_NODES:2}
21      gateway.recover_after_data_nodes: ${RECOVER_AFTER_DATA_NODES:1}
22 +
23 +{{- if .Values.cluster.auto_config_initial_masters }}
24 +    cluster.initial_master_nodes:
25 +    {{- range $i := until (.Values.master.replicas|int) }}
26 +    - {{template "elasticsearch.master.fullname" $ }}-{{ $i }}
27 +    {{- end }}
28 +{{- end }}
29 +
30  {{- with .Values.cluster.config }}
31  {{ toYaml . | indent 4 }}
32  {{- end }}
33 diff --git a/stable/elasticsearch/values.yaml b/stable/elasticsearch/values.yaml
34 index 6dcd9b0..37321dc 100644
35 --- a/stable/elasticsearch/values.yaml
36 +++ b/stable/elasticsearch/values.yaml
37 @@ -70,6 +70,7 @@ cluster:
38    plugins: []
39      # - ingest-attachment
40      # - mapper-size
41 +  auto_config_initial_masters: true
42  
43  client:
44    name: client
45 diff --git a/stable/filebeat/templates/configmap.yaml b/stable/filebeat/templates/configmap.yaml
46 index 9433176..8377e5a 100644
47 --- a/stable/filebeat/templates/configmap.yaml
48 +++ b/stable/filebeat/templates/configmap.yaml
49 @@ -22,7 +22,7 @@ data:
50  
51      # Check if this is a map of entries.  If so, we'll only export the template
52      # to the first address
53 -    if [[ ${ADDR:0:1} == [ ]]; then
54 +    if [ ${ADDR: 0:1} == [ ] && [ ${ADDR: -1} == ] ]; then
55         # Remove the square brackets
56         ADDR=${ADDR:1:-1}
57         # Take the first entry in case there are more than one
58 diff --git a/stable/metricbeat/templates/configmap.yaml b/stable/metricbeat/templates/configmap.yaml
59 index f990f0c..4249e7f 100644
60 --- a/stable/metricbeat/templates/configmap.yaml
61 +++ b/stable/metricbeat/templates/configmap.yaml
62 @@ -22,7 +22,7 @@ data:
63  
64      # Check if this is a map of entries.  If so, we'll only export the template
65      # to the first address
66 -    if [[ ${ADDR:0:1} == [ ]]; then
67 +    if [ ${ADDR: 0:1} == [ ] && [ ${ADDR: -1} == ] ]; then
68         # Remove the square brackets
69         ADDR=${ADDR:1:-1}
70         # Take the first entry in case there are more than one
71 diff --git a/stable/metricbeat/values.yaml b/stable/metricbeat/values.yaml
72 index 2908a1b..c8f758c 100644
73 --- a/stable/metricbeat/values.yaml
74 +++ b/stable/metricbeat/values.yaml
75 @@ -113,7 +113,7 @@ deployment:
76              # Uncomment this to get k8s events:
77              # - event
78            period: 10s
79 -          hosts: ["kube-state-metrics:8080"]
80 +          hosts: ["${KUBE_STATE_METRICS_HOST}:8080"]
81    # If overrideModules is not empty, metricbeat chart's default modules won't be used at all.
82    overrideModules: {}
83  
84 @@ -122,7 +122,9 @@ plugins: []
85    # - kinesis.so
86  
87  # additional environment
88 -# extraEnv:
89 +extraEnv:
90 +  - name: KUBE_STATE_METRICS_HOST
91 +    value: "mon-kube-state-metrics"
92  #  - name: test1
93  #    value: "test1"
94  #  - name: test2
95 -- 
96 1.8.3.1
97