blob: 093749b3644512aef064c06fcc9433b732d89aa2 [file] [log] [blame]
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "solr-operator.fullname" . }}
labels:
control-plane: solr-operator
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
control-plane: solr-operator
template:
metadata:
annotations:
prometheus.io/scrape: "true"
{{- if .Values.annotations }}
{{ toYaml .Values.annotations | nindent 8 }}
{{- end }}
labels:
control-plane: solr-operator
{{- if .Values.labels }}
{{ toYaml .Values.labels | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ include "solr-operator.serviceAccountName" . }}
{{- if .Values.priorityClassName }}
priorityClassName: {{ .Values.priorityClassName }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
# DEPRECATION: v0.4.0 - Remove (eq "true" .Values.useZkOperator)
{{- if or (index .Values "zookeeper-operator" "install") (or (index .Values "zookeeper-operator" "use") (eq .Values.useZkOperator "true")) }}
- -zk-operator=true
{{- else }}
- -zk-operator=false
{{- end }}
{{- if .Values.watchNamespaces }}
- --watch-namespaces={{- include "solr-operator.watchNamespaces" . -}}
{{- end }}
{{- if .Values.mTLS.clientCertSecret }}
- --tls-client-cert-path={{- include "solr-operator.mTLS.clientCertDirectory" . -}}/tls.crt
- --tls-client-cert-key-path={{- include "solr-operator.mTLS.clientCertDirectory" . -}}/tls.key
{{- end }}
{{- if .Values.mTLS.caCertSecret }}
- --tls-ca-cert-path={{- include "solr-operator.mTLS.caCertDirectory" . -}}/{{- include "solr-operator.mTLS.caCertName" . -}}
{{- end }}
{{- if .Values.mTLS.insecureSkipVerify }}
- --tls-skip-verify-server={{ .Values.mTLS.insecureSkipVerify }}
{{- end }}
env:
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
{{- if .Values.envVars }}
{{- toYaml .Values.envVars | nindent 10 }}
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 10 }}
{{- if (include "solr-operator.mTLS.volumeMounts" .) }}
volumeMounts:
{{- include "solr-operator.mTLS.volumeMounts" . | nindent 10 }}
{{- end }}
{{- if (include "solr-operator.mTLS.volumes" .) }}
volumes:
{{- include "solr-operator.mTLS.volumes" . | nindent 8 }}
{{- end }}
{{- if .Values.sidecarContainers }}
{{ toYaml .Values.sidecarContainers | nindent 6 }}
{{- end }}
{{- if .Values.nodeSelector }}
nodeSelector:
{{ toYaml .Values.nodeSelector | nindent 8 }}
{{- end }}
{{- if .Values.affinity }}
affinity:
{{ toYaml .Values.affinity | nindent 8 }}
{{- end }}
{{- if .Values.tolerations }}
tolerations:
{{ toYaml .Values.tolerations | nindent 8 }}
{{- end }}
terminationGracePeriodSeconds: 10