Update curator auth config and actions

Curator is unable to use environment variables for configuration
values if the configured option contains more than the env
variable.  In the case of the http_auth value (which expects
user:password), using ${USER}:${PASS} prevents curator from
successfully authenticating to elasticsearch.  This moves to
dynamically define these values in the configmap if the value is
empty

This also updates values for curators actions to target logstash-
indices for its actions

Change-Id: Id5b49171e00847432e4ab0cf4be60005b70c21e3
This commit is contained in:
Steve Wilkerson 2018-04-19 09:00:22 -05:00
parent d93649da5f
commit 5a4d56d068
3 changed files with 8 additions and 12 deletions

View File

@ -20,6 +20,7 @@ limitations under the License.
{{- if and (.Values.conf.elasticsearch.repository.enabled) (empty .Values.conf.elasticsearch.config.path.repo) -}} {{- if and (.Values.conf.elasticsearch.repository.enabled) (empty .Values.conf.elasticsearch.config.path.repo) -}}
{{- set .Values.conf.elasticsearch.config.path "repo" .Values.conf.elasticsearch.repository.location -}} {{- set .Values.conf.elasticsearch.config.path "repo" .Values.conf.elasticsearch.repository.location -}}
{{- end -}} {{- end -}}
--- ---
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap

View File

@ -47,17 +47,10 @@ spec:
{{ tuple $envAll $envAll.Values.pod.resources.jobs.curator | include "helm-toolkit.snippets.kubernetes_resources" | indent 14 }} {{ tuple $envAll $envAll.Values.pod.resources.jobs.curator | include "helm-toolkit.snippets.kubernetes_resources" | indent 14 }}
env: env:
- name: ELASTICSEARCH_HOST - name: ELASTICSEARCH_HOST
value: {{ tuple "elasticsearch" "internal" "http" . | include "helm-toolkit.endpoints.host_and_port_endpoint_uri_lookup" }}
- name: ELASTICSEARCH_USERNAME
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: {{ $esUserSecret }} name: {{ $esUserSecret }}
key: ELASTICSEARCH_USERNAME key: ELASTICSEARCH_URI
- name: ELASTICSEARCH_PASSWORD
valueFrom:
secretKeyRef:
name: {{ $esUserSecret }}
key: ELASTICSEARCH_PASSWORD
volumeMounts: volumeMounts:
- name: pod-etc-curator - name: pod-etc-curator
mountPath: /etc/config mountPath: /etc/config

View File

@ -195,13 +195,15 @@ conf:
ignore_empty_list: True ignore_empty_list: True
disable_action: True disable_action: True
filters: filters:
- filtertype: pattern
kind: prefix
value: logstash-
- filtertype: age - filtertype: age
source: name source: name
direction: older direction: older
timestring: '%Y.%m.%d' timestring: '%Y.%m.%d'
unit: days unit: days
unit_count: 7 unit_count: 7
exclude: True
2: 2:
action: delete_indices action: delete_indices
description: >- description: >-
@ -213,6 +215,9 @@ conf:
ignore_empty_list: True ignore_empty_list: True
disable_action: True disable_action: True
filters: filters:
- filtertype: pattern
kind: prefix
value: logstash-
- filtertype: space - filtertype: space
source: creation_date source: creation_date
use_age: True use_age: True
@ -220,7 +225,6 @@ conf:
# replicas. This must be adjusted if changed due to Curator being # replicas. This must be adjusted if changed due to Curator being
# unable to calculate percentages of total disk space # unable to calculate percentages of total disk space
disk_space: 12 disk_space: 12
exclude: False
3: 3:
action: snapshot action: snapshot
description: >- description: >-
@ -243,7 +247,6 @@ conf:
timestring: '%Y.%m.%d' timestring: '%Y.%m.%d'
unit: days unit: days
unit_count: 1 unit_count: 1
exclude: False
4: 4:
action: delete_snapshots action: delete_snapshots
description: >- description: >-
@ -271,7 +274,6 @@ conf:
- ${ELASTICSEARCH_HOST} - ${ELASTICSEARCH_HOST}
use_ssl: False use_ssl: False
ssl_no_validate: False ssl_no_validate: False
http_auth: ${ELASTICSEARCH_USERNAME}:${ELASTICSEARCH_PASSWORD}
timeout: 60 timeout: 60
logging: logging:
loglevel: INFO loglevel: INFO