Commit 2eadcd0f authored by Matt Pryor's avatar Matt Pryor
Browse files

Add Solr remote shard configuration

parent 70c29dec
Loading
Loading
Loading
Loading
+73 −0
Original line number Diff line number Diff line
{{- range $shard := .Values.solr.shards.shardList }}
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: "{{ template "fullname" . }}-solr-{{ $shard.name }}"
  labels:
{{ include "default-labels" . | indent 4 }}
    component: solr
    solr-role: shard
    shard-name: "{{ $shard.name }}"
spec:
  # Select pods on release and component only, rather than all labels
  # This means that the selector will match all pods from all versions of the chart when upgrading
  selector:
    matchLabels:
      release: {{ .Release.Name }}
      component: solr
      solr-role: shard
      shard-name: "{{ $shard.name }}"
  replicas: 1
  template:
    metadata:
      labels:
{{ include "default-labels" . | indent 8 }}
        component: solr
        solr-role: shard
        shard-name: "{{ $shard.name }}"
    spec:
      # Setting fsGroup for the pod allows some provisioners to chown mounted volumes to the given group
      #   The solr group is 8983 inside the container
      securityContext:
        fsGroup: 8983
      containers:
        - name: solr
          image: "{{ .Values.solr.image.repository }}:{{ .Values.solr.image.tag }}"
          imagePullPolicy: {{ default "" .Values.solr.image.pullPolicy | quote }}
          ports:
            - name: solr
              containerPort: 8983
          # The readiness and liveness probes run the same thing, but the liveness
          # probe just waits a while before kicking in whereas the readiness probe
          # starts straight away
          readinessProbe: &probe
            httpGet:
              path: /solr/admin/info/system?wt=json
              port: 8983
            initialDelaySeconds: 10
            periodSeconds: 10
          livenessProbe:
            <<: *probe
            initialDelaySeconds: 600
          env:
            - name: ESGF_SOLR_MASTER_URL
              value: "{{ $shard.url }}"
            {{- if hasKey $shard "replicationInterval" }}
            - name: ESGF_SOLR_REPLICATION_INTERVAL
              value: "{{ $shard.replicationInterval }}"
            {{- end }}
          resources:
{{ toYaml .Values.solr.shards.resources | indent 12 }}
          volumeMounts:
            - name: solr-home
              mountPath: /esg/solr-home
      volumes:
        - name: solr-home
{{- if .Values.solr.shards.persistence.enabled }}
          persistentVolumeClaim:
            claimName: "{{ template "fullname" . }}-solr-{{ $shard.name }}"
{{- else }}
          emptyDir: {}
{{- end }}
{{- end }}
+27 −0
Original line number Diff line number Diff line
{{- if .Values.solr.shards.persistence.enabled }}
{{- range $shard := .Values.solr.shards.shardList }}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: "{{ template "fullname" . }}-solr-{{ $shard.name }}"
  labels:
{{ include "default-labels" . | indent 4 }}
    component: solr
    solr-role: shard
    shard-name: "{{ $shard.name }}"
spec:
  accessModes:
    - ReadWriteOnce
{{- if .Values.solr.shards.persistence.storageClass }}
  storageClassName: "{{ .Values.solr.shards.persistence.storageClass }}"
{{- end }}
  resources:
    requests:
      storage: {{ .Values.solr.shards.persistence.size }}
{{- if .Values.solr.shards.persistence.selector }}
  selector:
{{ toYaml .Values.solr.shards.persistence.selector | indent 4 }}
{{- end }}
{{- end }}
{{- end }}
+21 −0
Original line number Diff line number Diff line
{{- range $shard := .Values.solr.shards.shardList }}
---
apiVersion: v1
kind: Service
metadata:
  name: "{{ template "fullname" . }}-solr-{{ $shard.name }}"
  labels:
{{ include "default-labels" . | indent 4 }}
    component: solr
    solr-role: shard
    shard-name: "{{ $shard.name }}"
spec:
  ports:
    - name: solr
      port: 8983
  selector:
    release: {{ .Release.Name }}
    component: solr
    solr-role: shard
    shard-name: "{{ $shard.name }}"
{{- end }}