d681396412
This moves Elasticsearch and Kibana to use the latest version (6.2.2), as the images we were using are no longer supported with the 6.x release. There was a change in the doc reference in the log entries that prevented the previous ES version from indexing those entries, resulting in a busted gate. Moving Kibana to 6.2.2 was required to match major/minor versions with Elasticsearch The Elasticsearch version change also required changing config file locations, changing the entrypoint used for launching the service, changing the running user for the elasticsearch service, and updated the ES tests as some of the API responses changed between versions This also required updating the elasticsearch template job as the mapping definition entries changed between versions Change-Id: Ia4cd9a66851754a1bb8f225c7e24513c43568e93
201 lines
7.4 KiB
YAML
201 lines
7.4 KiB
YAML
{{/*
|
|
Copyright 2017 The Openstack-Helm Authors.
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
you may not use this file except in compliance with the License.
|
|
You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
See the License for the specific language governing permissions and
|
|
limitations under the License.
|
|
*/}}
|
|
|
|
{{- if .Values.manifests.deployment_master }}
|
|
{{- $envAll := . }}
|
|
{{- if .Values.images.local_registry.active -}}
|
|
{{- $_ := set .Values "pod_dependency" dict -}}
|
|
{{- $_ := include "helm-toolkit.utils.merge" (tuple .Values.pod_dependency .Values.dependencies.static.elasticsearch_master .Values.dependencies.dynamic.common.local_image_registry) -}}
|
|
{{- else -}}
|
|
{{- $_ := set .Values "pod_dependency" .Values.dependencies.static.elasticsearch_master -}}
|
|
{{- end -}}
|
|
|
|
{{- $mounts_elasticsearch := .Values.pod.mounts.elasticsearch.elasticsearch }}
|
|
|
|
{{- $serviceAccountName := "elasticsearch-master"}}
|
|
{{ tuple $envAll $envAll.Values.pod_dependency $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
|
|
---
|
|
apiVersion: rbac.authorization.k8s.io/v1beta1
|
|
kind: ClusterRoleBinding
|
|
metadata:
|
|
name: run-elasticsearch-master
|
|
subjects:
|
|
- kind: ServiceAccount
|
|
name: {{ $serviceAccountName }}
|
|
namespace: {{ .Release.Namespace }}
|
|
roleRef:
|
|
kind: ClusterRole
|
|
name: {{ $serviceAccountName }}
|
|
apiGroup: rbac.authorization.k8s.io
|
|
---
|
|
apiVersion: rbac.authorization.k8s.io/v1beta1
|
|
kind: ClusterRole
|
|
metadata:
|
|
name: {{ $serviceAccountName }}
|
|
rules:
|
|
- nonResourceURLs:
|
|
- /
|
|
verbs:
|
|
- get
|
|
- apiGroups:
|
|
- ""
|
|
resources:
|
|
- endpoints
|
|
verbs:
|
|
- get
|
|
- apiGroups:
|
|
- apps
|
|
resources:
|
|
- statefulsets/status
|
|
verbs:
|
|
- get
|
|
---
|
|
apiVersion: extensions/v1beta1
|
|
kind: Deployment
|
|
metadata:
|
|
name: elasticsearch-master
|
|
spec:
|
|
replicas: {{ .Values.pod.replicas.master }}
|
|
{{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }}
|
|
template:
|
|
metadata:
|
|
labels:
|
|
{{ tuple $envAll "elasticsearch" "master" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
|
|
annotations:
|
|
configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }}
|
|
configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "helm-toolkit.utils.hash" }}
|
|
spec:
|
|
serviceAccountName: {{ $serviceAccountName }}
|
|
affinity:
|
|
{{ tuple $envAll "elasticsearch" "master" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }}
|
|
terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.master.timeout | default "600" }}
|
|
nodeSelector:
|
|
{{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }}
|
|
initContainers:
|
|
{{ tuple $envAll .Values.pod_dependency list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
|
|
- name: memory-map-increase
|
|
securityContext:
|
|
privileged: true
|
|
runAsUser: 0
|
|
{{ tuple $envAll "memory_init" | include "helm-toolkit.snippets.image" | indent 10 }}
|
|
command:
|
|
- sysctl
|
|
- -w
|
|
- vm.max_map_count={{ .Values.conf.init.max_map_count }}
|
|
{{ if .Values.storage.filesystem_repository.enabled }}
|
|
- name: elasticsearch-repository-perms
|
|
{{ tuple $envAll "elasticsearch" | include "helm-toolkit.snippets.image" | indent 10 }}
|
|
securityContext:
|
|
runAsUser: 0
|
|
{{ tuple $envAll $envAll.Values.pod.resources.client | include "helm-toolkit.snippets.kubernetes_resources" | indent 8 }}
|
|
command:
|
|
- chown
|
|
- -R
|
|
- "elasticsearch:"
|
|
- {{ .Values.conf.elasticsearch.repository.location }}
|
|
volumeMounts:
|
|
- name: storage
|
|
mountPath: {{ .Values.conf.elasticsearch.repository.location }}
|
|
{{ end }}
|
|
containers:
|
|
- name: elasticsearch-master
|
|
securityContext:
|
|
privileged: true
|
|
capabilities:
|
|
add:
|
|
- IPC_LOCK
|
|
- SYS_RESOURCE
|
|
{{ tuple $envAll "elasticsearch" | include "helm-toolkit.snippets.image" | indent 10 }}
|
|
{{ tuple $envAll $envAll.Values.pod.resources.master | include "helm-toolkit.snippets.kubernetes_resources" | indent 8 }}
|
|
command:
|
|
- /tmp/elasticsearch.sh
|
|
- start
|
|
lifecycle:
|
|
preStop:
|
|
exec:
|
|
command:
|
|
- /tmp/elasticsearch.sh
|
|
- stop
|
|
ports:
|
|
- name: transport
|
|
containerPort: {{ .Values.network.discovery.port }}
|
|
livenessProbe:
|
|
tcpSocket:
|
|
port: {{ .Values.network.discovery.port }}
|
|
initialDelaySeconds: 20
|
|
periodSeconds: 10
|
|
env:
|
|
- name: NAMESPACE
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: metadata.namespace
|
|
- name: NODE_NAME
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: metadata.name
|
|
- name: NODE_MASTER
|
|
value: "true"
|
|
- name: NODE_DATA
|
|
value: "false"
|
|
- name: HTTP_ENABLE
|
|
value: "false"
|
|
- name: DISCOVERY_SERVICE
|
|
value: {{ tuple "elasticsearch" "discovery" $envAll | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
|
|
- name: ES_JAVA_OPTS
|
|
value: "{{ .Values.conf.elasticsearch.env.java_opts }}"
|
|
volumeMounts:
|
|
- name: elasticsearch-logs
|
|
mountPath: {{ .Values.conf.elasticsearch.config.path.logs }}
|
|
- name: elasticsearch-bin
|
|
mountPath: /tmp/elasticsearch.sh
|
|
subPath: elasticsearch.sh
|
|
readOnly: true
|
|
- name: elasticsearch-etc
|
|
mountPath: /usr/share/elasticsearch/config/elasticsearch.yml
|
|
subPath: elasticsearch.yml
|
|
readOnly: true
|
|
- name: elasticsearch-etc
|
|
mountPath: /usr/share/elasticsearch/config/log4j2.properties
|
|
subPath: log4j2.properties
|
|
readOnly: true
|
|
- name: storage
|
|
mountPath: {{ .Values.conf.elasticsearch.config.path.data }}
|
|
{{ if .Values.storage.filesystem_repository.enabled }}
|
|
- name: snapshots
|
|
mountPath: {{ .Values.conf.elasticsearch.repository.location }}
|
|
{{ end }}
|
|
{{ if $mounts_elasticsearch.volumeMounts }}{{ toYaml $mounts_elasticsearch.volumeMounts | indent 12 }}{{ end }}
|
|
volumes:
|
|
- name: elasticsearch-logs
|
|
emptyDir: {}
|
|
- name: elasticsearch-bin
|
|
configMap:
|
|
name: elasticsearch-bin
|
|
defaultMode: 0555
|
|
- name: elasticsearch-etc
|
|
configMap:
|
|
name: elasticsearch-etc
|
|
defaultMode: 0444
|
|
- name: storage
|
|
emptyDir: {}
|
|
{{ if .Values.storage.filesystem_repository.enabled }}
|
|
- name: snapshots
|
|
persistentVolumeClaim:
|
|
claimName: {{ .Values.storage.filesystem_repository.pvc.name }}
|
|
{{ end }}
|
|
{{ if $mounts_elasticsearch.volumes }}{{ toYaml $mounts_elasticsearch.volumes | indent 8 }}{{ end }}
|
|
{{- end }}
|