Merge "Add elasticsearch snapshot policy template for SLM"
This commit is contained in:
commit
6af7303516
@ -15,7 +15,7 @@ apiVersion: v1
|
|||||||
appVersion: v7.1.0
|
appVersion: v7.1.0
|
||||||
description: OpenStack-Helm ElasticSearch
|
description: OpenStack-Helm ElasticSearch
|
||||||
name: elasticsearch
|
name: elasticsearch
|
||||||
version: 0.1.2
|
version: 0.1.3
|
||||||
home: https://www.elastic.co/
|
home: https://www.elastic.co/
|
||||||
sources:
|
sources:
|
||||||
- https://github.com/elastic/elasticsearch
|
- https://github.com/elastic/elasticsearch
|
||||||
|
@ -15,3 +15,17 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
{{ range $policy_name, $fields := .Values.conf.snapshot_policies }}
|
||||||
|
|
||||||
|
result=$(curl -K- <<< "--user ${ELASTICSEARCH_USERNAME}:${ELASTICSEARCH_PASSWORD}" \
|
||||||
|
-XPUT "${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}/_slm/policy/{{$policy_name}}" \
|
||||||
|
-H 'Content-Type: application/json' -d @/tmp/{{$policy_name}}.json \
|
||||||
|
| python -c "import sys, json; print(json.load(sys.stdin)['acknowledged'])")
|
||||||
|
if [ "$result" == "True" ]; then
|
||||||
|
echo "Policy {{$policy_name}} created!"
|
||||||
|
else
|
||||||
|
echo "Policy {{$policy_name}} not created!"
|
||||||
|
fi
|
||||||
|
|
||||||
|
{{ end }}
|
@ -25,4 +25,8 @@ data:
|
|||||||
{{ range $template, $fields := .Values.conf.templates }}
|
{{ range $template, $fields := .Values.conf.templates }}
|
||||||
{{ $template }}.json: {{ toJson $fields | b64enc }}
|
{{ $template }}.json: {{ toJson $fields | b64enc }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
{{ range $policy_name, $fields := .Values.conf.snapshot_policies }}
|
||||||
|
{{ $policy_name }}.json: {{ toJson $fields | b64enc }}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
@ -78,6 +78,12 @@ spec:
|
|||||||
subPath: {{$template}}.json
|
subPath: {{$template}}.json
|
||||||
readOnly: true
|
readOnly: true
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
{{ range $policy_name, $fields := .Values.conf.snapshot_policies }}
|
||||||
|
- name: elasticsearch-templates-etc
|
||||||
|
mountPath: /tmp/{{$policy_name}}.json
|
||||||
|
subPath: {{$policy_name}}.json
|
||||||
|
readOnly: true
|
||||||
|
{{ end }}
|
||||||
{{ if $mounts_elasticsearch_templates.volumeMounts }}{{ toYaml $mounts_elasticsearch_templates.volumeMounts | indent 12 }}{{ end }}
|
{{ if $mounts_elasticsearch_templates.volumeMounts }}{{ toYaml $mounts_elasticsearch_templates.volumeMounts | indent 12 }}{{ end }}
|
||||||
volumes:
|
volumes:
|
||||||
- name: pod-tmp
|
- name: pod-tmp
|
||||||
|
@ -774,6 +774,39 @@ conf:
|
|||||||
pod_name:
|
pod_name:
|
||||||
type: keyword
|
type: keyword
|
||||||
index: false
|
index: false
|
||||||
|
snapshot_policies:
|
||||||
|
non-security-snapshots:
|
||||||
|
schedule: "0 30 1 * * ?"
|
||||||
|
name: "<non-security-logs-snapshot-{now/d}>"
|
||||||
|
repository: logstash_snapshots
|
||||||
|
config:
|
||||||
|
indices: ["^(.*calico-|.*ceph-|.*jenkins-|.*journal-|.*kernel_syslog-|.*kubernetes-|.*libvirt-|.*logstash-|.*openvswitch-|.*utility_access-).*$"]
|
||||||
|
ignore_unavailable: true
|
||||||
|
include_global_state: false
|
||||||
|
wait_for_completion: true
|
||||||
|
max_wait: 64800
|
||||||
|
wait_interval: 30
|
||||||
|
ignore_empty_list: true
|
||||||
|
continue_if_exception: true
|
||||||
|
disable_action: false
|
||||||
|
retention:
|
||||||
|
expire_after: 29d
|
||||||
|
security-snapshots:
|
||||||
|
schedule: "0 30 1 * * ?"
|
||||||
|
name: "<security-logs-snapshot-{now/d}>"
|
||||||
|
repository: logstash_snapshots
|
||||||
|
config:
|
||||||
|
indices: ["^(.*airship-|.*audit_tsee-|.*auth-|.*flows-|.*lma-|.*openstack-).*$"]
|
||||||
|
ignore_unavailable: true
|
||||||
|
include_global_state: false
|
||||||
|
wait_for_completion: true
|
||||||
|
max_wait: 18000
|
||||||
|
wait_interval: 30
|
||||||
|
ignore_empty_list: true
|
||||||
|
continue_if_exception: true
|
||||||
|
disable_action: false
|
||||||
|
retention:
|
||||||
|
expire_after: 179d
|
||||||
|
|
||||||
endpoints:
|
endpoints:
|
||||||
cluster_domain_suffix: cluster.local
|
cluster_domain_suffix: cluster.local
|
||||||
|
Loading…
Reference in New Issue
Block a user