mirror of
https://github.com/bitnami/charts.git
synced 2026-03-16 06:47:30 +08:00
This results in errors such as: ```sh create Pod welp-solr-0 in StatefulSet welp-solr failed error: Pod "welp-solr-0" is invalid: spec.initContainers[1].name: Duplicate value: "load-solr-config" ```
246 lines
12 KiB
YAML
246 lines
12 KiB
YAML
apiVersion: {{ include "common.capabilities.statefulset.apiVersion" . }}
|
|
kind: StatefulSet
|
|
metadata:
|
|
name: {{ include "solr.fullname" . }}
|
|
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
|
app.kubernetes.io/component: solr
|
|
{{- if .Values.commonLabels }}
|
|
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
|
{{- end }}
|
|
{{- if .Values.commonAnnotations }}
|
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
|
{{- end }}
|
|
namespace: {{ .Release.Namespace | quote }}
|
|
spec:
|
|
podManagementPolicy: Parallel
|
|
replicas: {{ .Values.replicaCount }}
|
|
selector:
|
|
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
|
|
app.kubernetes.io/component: solr
|
|
serviceName: {{ include "solr.fullname" . }}-headless
|
|
updateStrategy: {{- include "common.tplvalues.render" (dict "value" .Values.updateStrategy "context" $) | nindent 4 }}
|
|
template:
|
|
metadata:
|
|
annotations:
|
|
{{- if .Values.podAnnotations }}
|
|
{{- include "common.tplvalues.render" (dict "value" .Values.podAnnotations "context" $) | nindent 8 }}
|
|
{{- end }}
|
|
{{- if .Values.commonAnnotations }}
|
|
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 8 }}
|
|
{{- end }}
|
|
labels: {{- include "common.labels.standard" . | nindent 8 }}
|
|
app.kubernetes.io/component: solr
|
|
{{- if .Values.podLabels }}
|
|
{{- include "common.tplvalues.render" (dict "value" .Values.podLabels "context" $) | nindent 8 }}
|
|
{{- end }}
|
|
{{- if .Values.commonLabels }}
|
|
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 8 }}
|
|
{{- end }}
|
|
spec:
|
|
serviceAccountName: {{ include "solr.serviceAccountName" . }}
|
|
{{- include "solr.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.priorityClassName }}
|
|
priorityClassName: {{ .Values.priorityClassName }}
|
|
{{- end }}
|
|
{{- if .Values.podSecurityContext.enabled }}
|
|
securityContext: {{- omit .Values.podSecurityContext "enabled" | toYaml | nindent 8 }}
|
|
{{- end }}
|
|
initContainers:
|
|
{{- if and .Values.volumePermissions.enabled .Values.persistence.enabled }}
|
|
- name: volume-permissions
|
|
image: {{ include "volumePermissions.image" . }}
|
|
imagePullPolicy: {{ .Values.volumePermissions.image.pullPolicy | quote }}
|
|
command:
|
|
- sh
|
|
- c
|
|
- chown -R "{{ .Values.containerSecurityContext.runAsUser }}:{{ .Values.podSecurityContext.fsGroup }}" "/bitnami/solr"
|
|
{{- if .Values.volumePermissions.containerSecurityContext.enabled }}
|
|
securityContext: {{- omit .Values.volumePermissions.containerSecurityContext "enabled" | toYaml | nindent 12 }}
|
|
{{- end }}
|
|
{{- if .Values.volumePermissions.resources }}
|
|
resources: {{- toYaml .Values.volumePermissions.resources | nindent 12 }}
|
|
{{- end }}
|
|
volumeMounts:
|
|
- name: data
|
|
mountPath: /bitnami/solr
|
|
{{- end }}
|
|
{{- if .Values.initContainers }}
|
|
{{- include "common.tplvalues.render" (dict "value" .Values.initContainers "context" $) | nindent 8 }}
|
|
{{- end }}
|
|
containers:
|
|
- name: solr
|
|
image: {{ include "solr.image" . }}
|
|
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
|
|
{{- if .Values.lifecycleHooks }}
|
|
lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.lifecycleHooks "context" $) | nindent 12 }}
|
|
{{- end }}
|
|
{{- if .Values.containerSecurityContext.enabled }}
|
|
securityContext: {{- omit .Values.containerSecurityContext "enabled" | toYaml | nindent 12 }}
|
|
{{- end }}
|
|
{{- if .Values.command }}
|
|
command: {{- include "common.tplvalues.render" (dict "value" .Values.command "context" $) | nindent 12 }}
|
|
{{- else }}
|
|
command:
|
|
- bash
|
|
- -ec
|
|
- |
|
|
{{- if .Values.cloudBootstrap }}
|
|
NODE_ID="${MY_POD_NAME#"{{ include "solr.fullname" . }}-"}"
|
|
if [[ "$NODE_ID" -eq "0" ]]; then
|
|
export SOLR_CLOUD_BOOTSTRAP=yes
|
|
fi
|
|
{{- end }}
|
|
# Use hostname instead of IP to register in Zookeeper
|
|
export SOLR_HOST="${MY_POD_NAME}.{{ include "solr.fullname" . }}-headless.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}"
|
|
/opt/bitnami/scripts/solr/entrypoint.sh /opt/bitnami/scripts/solr/run.sh
|
|
{{- end }}
|
|
{{- if .Values.args }}
|
|
args: {{- include "common.tplvalues.render" (dict "value" .Values.args "context" $) | nindent 12 }}
|
|
{{- end }}
|
|
env:
|
|
- name: MY_POD_NAME
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: metadata.name
|
|
- name: SOLR_ENABLE_CLOUD_MODE
|
|
value: {{ ternary "yes" "no" .Values.cloudEnabled | quote }}
|
|
- name: SOLR_NUMBER_OF_NODES
|
|
value: {{ .Values.replicaCount | quote }}
|
|
- name: SOLR_PORT_NUMBER
|
|
value: {{ .Values.containerPort | quote }}
|
|
- name: SOLR_SERVER_DIRECTORY
|
|
value: {{ .Values.serverDirectory | quote }}
|
|
{{- if .Values.cloudEnabled }}
|
|
- name: SOLR_COLLECTION
|
|
value: {{ .Values.collection | quote }}
|
|
{{- else }}
|
|
- name: SOLR_CORE
|
|
value: {{ .Values.coreName | quote }}
|
|
{{- end }}
|
|
- name: SOLR_COLLECTION_SHARDS
|
|
value: {{ .Values.collectionShards | quote }}
|
|
- name: SOLR_COLLECTION_REPLICAS
|
|
value: {{ .Values.collectionReplicas | quote }}
|
|
{{- if .Values.heap }}
|
|
- name: SOLR_HEAP
|
|
value: {{ .Values.heap | quote }}
|
|
{{- end }}
|
|
{{- if .Values.javaMem }}
|
|
- name: SOLR_JAVA_MEM
|
|
value: {{ .Values.javaMem | quote }}
|
|
{{- end }}
|
|
{{- if .Values.authentication.enabled }}
|
|
- name: SOLR_ENABLE_AUTHENTICATION
|
|
value: "yes"
|
|
- name: SOLR_ADMIN_USERNAME
|
|
value: {{ .Values.authentication.adminUsername | quote }}
|
|
- name: SOLR_ADMIN_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ include "solr.secretName" . }}
|
|
key: solr-password
|
|
{{- end }}
|
|
- name: SOLR_ZK_HOSTS
|
|
value: {{ include "solr.zookeeper.host" . | quote }}
|
|
{{- if .Values.extraEnvVars }}
|
|
{{ include "common.tplvalues.render" ( dict "value" .Values.extraEnvVars "context" $) | nindent 12 }}
|
|
{{- end }}
|
|
envFrom:
|
|
{{- if .Values.extraEnvVarsCM }}
|
|
- configMapRef:
|
|
name: {{ include "common.tplvalues.render" (dict "value" .Values.extraEnvVarsCM "context" $) }}
|
|
{{- end }}
|
|
{{- if .Values.extraEnvVarsSecret }}
|
|
- secretRef:
|
|
name: {{ include "common.tplvalues.render" (dict "value" .Values.extraEnvVarsSecret "context" $) }}
|
|
{{- end }}
|
|
ports:
|
|
- name: solr-client
|
|
containerPort: {{ .Values.containerPort }}
|
|
{{- if .Values.resources }}
|
|
resources: {{- include "common.tplvalues.render" (dict "value" .Values.resources "context" $) | nindent 12 }}
|
|
{{- end }}
|
|
{{- if .Values.livenessProbe.enabled }}
|
|
livenessProbe:
|
|
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
|
|
timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
|
|
failureThreshold: {{ .Values.livenessProbe.failureThreshold }}
|
|
periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
|
|
successThreshold: {{ .Values.livenessProbe.successThreshold }}
|
|
httpGet:
|
|
scheme: "HTTP"
|
|
path: "/solr"
|
|
port: {{ .Values.service.port }}
|
|
{{- else if .Values.customLivenessProbe }}
|
|
livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customLivenessProbe "context" $) | nindent 12 }}
|
|
{{- end }}
|
|
{{- if .Values.readinessProbe.enabled }}
|
|
readinessProbe:
|
|
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}
|
|
timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }}
|
|
failureThreshold: {{ .Values.readinessProbe.failureThreshold }}
|
|
periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
|
|
successThreshold: {{ .Values.readinessProbe.successThreshold }}
|
|
httpGet:
|
|
scheme: "HTTP"
|
|
path: "/solr"
|
|
port: {{ .Values.service.port }}
|
|
{{- else if .Values.customReadinessProbe }}
|
|
readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customReadinessProbe "context" $) | nindent 12 }}
|
|
{{- end }}
|
|
volumeMounts:
|
|
- name: data
|
|
mountPath: {{ .Values.persistence.mountPath }}
|
|
{{- 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:
|
|
{{- if .Values.extraVolumes }}
|
|
{{- include "common.tplvalues.render" (dict "value" .Values.extraVolumes "context" $) | nindent 8 }}
|
|
{{- end }}
|
|
{{- if and .Values.persistence.enabled .Values.persistence.existingClaim }}
|
|
- name: data
|
|
persistentVolumeClaim:
|
|
claimName: {{ printf "%s" (tpl .Values.persistence.existingClaim .) }}
|
|
{{- else }}
|
|
- name: data
|
|
emptyDir: {}
|
|
{{- end }}
|
|
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
|
|
volumeClaimTemplates:
|
|
- metadata:
|
|
name: data
|
|
{{- if .Values.persistence.annotations }}
|
|
annotations: {{- include "common.tplvalues.render" (dict "value" .Values.persistence.annotations "context" $) | nindent 10 }}
|
|
{{- end }}
|
|
spec:
|
|
accessModes:
|
|
{{- range .Values.persistence.accessModes }}
|
|
- {{ . | quote }}
|
|
{{- end }}
|
|
resources:
|
|
requests:
|
|
storage: {{ .Values.persistence.size | quote }}
|
|
{{ include "solr.storageClass" . | nindent 8 }}
|
|
{{- end }}
|