去掉后缀
This commit is contained in:
283
kibana/templates/deployment.yaml
Normal file
283
kibana/templates/deployment.yaml
Normal file
@ -0,0 +1,283 @@
|
||||
{{- if and .Values.elasticsearch.hosts .Values.elasticsearch.port -}}
|
||||
apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }}
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ include "common.names.fullname" . }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
spec:
|
||||
replicas: {{ .Values.replicaCount }}
|
||||
{{- if .Values.updateStrategy }}
|
||||
strategy: {{- tpl (toYaml .Values.updateStrategy) $ | nindent 4 }}
|
||||
{{- end }}
|
||||
selector:
|
||||
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
|
||||
template:
|
||||
metadata:
|
||||
{{- if or .Values.podAnnotations (include "kibana.createTlsSecret" .) }}
|
||||
annotations:
|
||||
{{- if (include "kibana.createTlsSecret" .) }}
|
||||
checksum/tls: {{ include (print $.Template.BasePath "/tls-secret.yaml") . | sha256sum }}
|
||||
{{- end }}
|
||||
{{- if .Values.podAnnotations }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.podAnnotations "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 8 }}
|
||||
app: kibana
|
||||
{{- if .Values.podLabels }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.podLabels "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- include "kibana.imagePullSecrets" . | nindent 6 }}
|
||||
{{- if .Values.hostAliases }}
|
||||
hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.hostAliases "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.affinity }}
|
||||
affinity: {{- include "common.tplvalues.render" (dict "value" .Values.affinity "context" $) | nindent 8 }}
|
||||
{{- else }}
|
||||
affinity:
|
||||
podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAffinityPreset "context" $) | nindent 10 }}
|
||||
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAntiAffinityPreset "context" $) | nindent 10 }}
|
||||
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.nodeAffinityPreset.type "key" .Values.nodeAffinityPreset.key "values" .Values.nodeAffinityPreset.values) | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- if .Values.nodeSelector }}
|
||||
nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.nodeSelector "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.tolerations }}
|
||||
tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.tolerations "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.schedulerName }}
|
||||
schedulerName: {{ .Values.schedulerName | quote }}
|
||||
{{- end }}
|
||||
serviceAccountName: {{ include "kibana.serviceAccountName" . }}
|
||||
{{- if .Values.securityContext.enabled }}
|
||||
securityContext:
|
||||
fsGroup: {{ .Values.securityContext.fsGroup }}
|
||||
{{- end }}
|
||||
{{- if or .Values.initContainers (and .Values.volumePermissions.enabled .Values.persistence.enabled) }}
|
||||
initContainers:
|
||||
{{- if and .Values.volumePermissions.enabled .Values.persistence.enabled }}
|
||||
- name: volume-permissions
|
||||
image: "{{ template "kibana.volumePermissions.image" . }}"
|
||||
imagePullPolicy: {{ default "" .Values.volumePermissions.image.pullPolicy | quote }}
|
||||
command: ["chown", "-R", "{{ .Values.securityContext.runAsUser }}:{{ .Values.securityContext.fsGroup }}", "/bitnami/kibana"]
|
||||
securityContext:
|
||||
runAsUser: 0
|
||||
resources: {{ toYaml .Values.volumePermissions.resources | nindent 12 }}
|
||||
volumeMounts:
|
||||
- name: kibana-data
|
||||
mountPath: /bitnami/kibana
|
||||
{{- end }}
|
||||
{{- if .Values.initContainers }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.initContainers "context" $) | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: kibana
|
||||
image: {{ include "kibana.image" . }}
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
{{- if .Values.securityContext.enabled }}
|
||||
securityContext:
|
||||
runAsUser: {{ .Values.securityContext.runAsUser }}
|
||||
{{- end }}
|
||||
env:
|
||||
- name: KIBANA_PORT_NUMBER
|
||||
value: {{ .Values.containerPort | quote }}
|
||||
- name: KIBANA_ELASTICSEARCH_URL
|
||||
value: {{ include "kibana.elasticsearch.url" . | quote }}
|
||||
- name: KIBANA_ELASTICSEARCH_PORT_NUMBER
|
||||
value: {{ include "kibana.elasticsearch.port" . | quote }}
|
||||
- name: KIBANA_FORCE_INITSCRIPTS
|
||||
value: {{ .Values.forceInitScripts | quote }}
|
||||
- name: KIBANA_SERVER_ENABLE_TLS
|
||||
value: {{ ternary "true" "false" .Values.tls.enabled | quote }}
|
||||
{{- if or .Values.tls.usePemCerts (include "kibana.createTlsSecret" . ) }}
|
||||
- name: KIBANA_SERVER_TLS_USE_PEM
|
||||
value: "true"
|
||||
{{- end }}
|
||||
{{- if and .Values.tls.enabled .Values.tls.usePemCerts (or .Values.tls.keyPassword .Values.tls.passwordsSecret) }}
|
||||
- name: KIBANA_SERVER_KEY_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "kibana.tls.secretName" . }}
|
||||
key: kibana-key-password
|
||||
{{- end }}
|
||||
{{- if and .Values.tls.enabled (not .Values.tls.usePemCerts) (or .Values.tls.keystorePassword .Values.tls.passwordsSecret) }}
|
||||
- name: KIBANA_SERVER_KEYSTORE_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "kibana.tls.secretName" . }}
|
||||
key: kibana-keystore-password
|
||||
{{- end }}
|
||||
{{- if .Values.elasticsearch.security.auth.enabled }}
|
||||
- name: KIBANA_USERNAME
|
||||
value: {{ .Values.elasticsearch.security.auth.kibanaUsername | quote }}
|
||||
- name: KIBANA_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "kibana.elasticsearch.auth.secretName" . }}
|
||||
key: kibana-password
|
||||
{{- end }}
|
||||
- name: KIBANA_ELASTICSEARCH_ENABLE_TLS
|
||||
value: {{ ternary "true" "false" .Values.elasticsearch.security.tls.enabled | quote }}
|
||||
- name: KIBANA_ELASTICSEARCH_TLS_USE_PEM
|
||||
value: {{ ternary "true" "false" .Values.elasticsearch.security.tls.usePemCerts | quote }}
|
||||
- name: KIBANA_ELASTICSEARCH_TLS_VERIFICATION_MODE
|
||||
value: {{ .Values.elasticsearch.security.tls.verificationMode | quote }}
|
||||
{{- if and .Values.elasticsearch.security.tls.enabled (not .Values.elasticsearch.security.tls.usePemCerts) (or .Values.elasticsearch.security.tls.truststorePassword .Values.elasticsearch.security.tls.passwordsSecret) }}
|
||||
- name: KIBANA_ELASTICSEARCH_TRUSTSTORE_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "kibana.elasticsearch.tls.secretName" . }}
|
||||
key: elasticsearch-truststore-password
|
||||
{{- end }}
|
||||
{{- if .Values.extraEnvVars }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.extraEnvVars "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if or .Values.extraEnvVarsCM .Values.extraEnvVarsSecret }}
|
||||
envFrom:
|
||||
{{- if .Values.extraEnvVarsCM }}
|
||||
- configMapRef:
|
||||
name: {{ .Values.extraEnvVarsCM }}
|
||||
{{- end }}
|
||||
{{- if .Values.extraEnvVarsSecret }}
|
||||
- secretRef:
|
||||
name: {{ .Values.extraEnvVarsSecret }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: {{ .Values.containerPort }}
|
||||
protocol: TCP
|
||||
{{- if .Values.livenessProbe.enabled }}
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
{{- if .Values.configuration.server.rewriteBasePath }}
|
||||
path: {{ .Values.configuration.server.basePath }}/login
|
||||
{{- else }}
|
||||
path: /login
|
||||
{{- end }}
|
||||
port: http
|
||||
scheme: {{ ternary "HTTPS" "HTTP" .Values.tls.enabled }}
|
||||
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
|
||||
periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
|
||||
timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
|
||||
successThreshold: {{ .Values.livenessProbe.successThreshold }}
|
||||
failureThreshold: {{ .Values.livenessProbe.failureThreshold }}
|
||||
{{- end }}
|
||||
{{- if .Values.readinessProbe.enabled }}
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
{{- if .Values.configuration.server.rewriteBasePath }}
|
||||
path: {{ .Values.configuration.server.basePath }}/login
|
||||
{{- else }}
|
||||
path: /login
|
||||
{{- end }}
|
||||
port: http
|
||||
scheme: {{ ternary "HTTPS" "HTTP" .Values.tls.enabled }}
|
||||
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}
|
||||
periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
|
||||
timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }}
|
||||
successThreshold: {{ .Values.readinessProbe.successThreshold }}
|
||||
failureThreshold: {{ .Values.readinessProbe.failureThreshold }}
|
||||
{{- end }}
|
||||
{{- if .Values.resources }}
|
||||
resources: {{- include "common.tplvalues.render" (dict "value" .Values.resources "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
- name: kibana-data
|
||||
mountPath: /bitnami/kibana
|
||||
- name: kibana-config
|
||||
mountPath: /bitnami/kibana/conf
|
||||
{{- if .Values.tls.enabled }}
|
||||
- name: kibana-certificates
|
||||
mountPath: /opt/bitnami/kibana/config/certs/server
|
||||
readOnly: true
|
||||
{{- end }}
|
||||
{{- if and .Values.elasticsearch.security.tls.enabled (not (eq .Values.elasticsearch.security.tls.verificationMode "none" )) }}
|
||||
- name: elasticsearch-certificates
|
||||
mountPath: /opt/bitnami/kibana/config/certs/elasticsearch
|
||||
readOnly: true
|
||||
{{- end }}
|
||||
{{- if .Values.plugins }}
|
||||
- name: plugins-init-scripts
|
||||
mountPath: /docker-entrypoint-initdb.d/plugin-install
|
||||
{{- end }}
|
||||
{{- if (include "kibana.importSavedObjects" .) }}
|
||||
- name: saved-objects-init-scripts
|
||||
mountPath: /docker-entrypoint-initdb.d/saved-objects-import
|
||||
{{- end }}
|
||||
{{- if .Values.savedObjects.configmap }}
|
||||
- name: saved-objects-configmap
|
||||
mountPath: /bitnami/kibana/saved-objects
|
||||
{{- end }}
|
||||
{{- if .Values.initScriptsCM }}
|
||||
- name: custom-init-scripts-cm
|
||||
mountPath: /docker-entrypoint-initdb.d/cm
|
||||
{{- end }}
|
||||
{{- if .Values.initScriptsSecret }}
|
||||
- name: custom-init-scripts-secret
|
||||
mountPath: /docker-entrypoint-initdb.d/secret
|
||||
{{- end }}
|
||||
{{- if .Values.extraVolumeMounts }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.extraVolumeMounts "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.sidecars }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.sidecars "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
volumes:
|
||||
- name: kibana-data
|
||||
{{- if .Values.persistence.enabled }}
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ include "kibana.pvc" . }}
|
||||
{{- else }}
|
||||
emptyDir: {}
|
||||
{{ end }}
|
||||
{{- if .Values.tls.enabled }}
|
||||
- name: kibana-certificates
|
||||
secret:
|
||||
secretName: {{ include "kibana.tlsSecretName" . }}
|
||||
defaultMode: 256
|
||||
{{- end }}
|
||||
{{- if and .Values.elasticsearch.security.tls.enabled (ne .Values.elasticsearch.security.tls.verificationMode "none" ) }}
|
||||
- name: elasticsearch-certificates
|
||||
secret:
|
||||
secretName: {{ required "A secret containing the Truststore or CA certificate for Elasticsearch is required" .Values.elasticsearch.security.tls.existingSecret }}
|
||||
defaultMode: 256
|
||||
{{- end }}
|
||||
- name: kibana-config
|
||||
configMap:
|
||||
name: {{ include "kibana.configurationCM" . }}
|
||||
{{- if (include "kibana.importSavedObjects" .) }}
|
||||
- name: saved-objects-init-scripts
|
||||
configMap:
|
||||
name: {{ include "common.names.fullname" . }}-saved-objects
|
||||
defaultMode: 0755
|
||||
{{- end }}
|
||||
{{- if .Values.plugins }}
|
||||
- name: plugins-init-scripts
|
||||
configMap:
|
||||
name: {{ include "common.names.fullname" . }}-plugins
|
||||
defaultMode: 0755
|
||||
{{- end }}
|
||||
{{- if .Values.initScriptsCM }}
|
||||
- name: custom-init-scripts-cm
|
||||
configMap:
|
||||
name: {{ template "kibana.initScriptsCM" . }}
|
||||
defaultMode: 0755
|
||||
{{- end }}
|
||||
{{- if .Values.initScriptsSecret }}
|
||||
- name: custom-init-scripts-secret
|
||||
secret:
|
||||
name: {{ template "kibana.initScriptsSecret" . }}
|
||||
defaultMode: 0755
|
||||
{{- end }}
|
||||
{{- if .Values.savedObjects.configmap }}
|
||||
- name: saved-objects-configmap
|
||||
configMap:
|
||||
name: {{ template "kibana.savedObjectsCM" . }}
|
||||
{{- end }}
|
||||
{{- if .Values.extraVolumes }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.extraVolumes "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
Reference in New Issue
Block a user