Commit 4427ab1d authored by Matt Pryor's avatar Matt Pryor
Browse files

Search is working

parent 0c5aa42e
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
# esgf.properties file for the search application
{{- $solr := .Values.index.solr -}}
{{- if $solr.localEnabled }}
esg.search.solr.query.url=http://{{ include "esgf.component.fullname" (list . "solr" "slave") }}:8983/solr
esg.search.solr.publish.url=http://{{ include "esgf.component.fullname" (list . "solr" "master") }}:8983/solr
{{- else }}
esg.search.solr.query.url={{ $solr.slaveExternalUrl }}
esg.search.solr.publish.url={{ $solr.masterExternalUrl }}
{{- end }}
+15 −0
Original line number Diff line number Diff line
{{- $solr := .Values.index.solr -}}
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<shards xmlns="http://www.esgf.org/whitelist">
    <!-- Local Solr instance -->
    {{- if $solr.localEnabled }}
    <value>{{ include "esgf.component.fullname" (list . "solr" "slave") }}:8983/solr</value>
    {{- else }}
    <value>{{ $solr.slaveExternalUrl }}</value>
    {{- end }}

    <!-- Replicas -->
    {{- range $solr.replicas }}
    <value>{{ include "esgf.component.fullname" (list $ "solr" .name) }}:8983/solr</value>
    {{- end }}
</shards>
+8 −0
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ spec:
          {{- end }}
          {{- end }}
          {{- if .Values.index.enabled }}
          {{- if .Values.index.solr.localEnabled }}
          # We only want to permit access to the replication handler for each core from outside
          # However wildcard paths are not supported on all ingress controllers
          # So we make a path definition for each core
@@ -47,3 +48,10 @@ spec:
          - path: /solr/files/replication
            backend: *solr
          {{- end }}
          {{- if .Values.index.search.enabled }}
          - path: /esg-search
            backend:
              serviceName: {{ include "esgf.component.fullname" (list . "search") }}
              servicePort: 8080
          {{- end }}
          {{- end }}
+11 −0
Original line number Diff line number Diff line
{{- $search := .Values.index.search -}}
{{- if (and .Values.index.enabled $search.enabled) -}}
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "esgf.component.fullname" (list . "search") }}
  labels: {{ include "esgf.component.labels" (list . "search" $search.labels) | nindent 4 }}
data:
  esgf.properties: {{ tpl (.Files.Get "files/search/esgf.properties") . | quote }}
  esgf_shards_static.xml: {{ tpl (.Files.Get "files/search/esgf_shards_static.xml") . | quote }}
{{- end -}}
+65 −0
Original line number Diff line number Diff line
{{- $search := .Values.index.search -}}
{{- if (and .Values.index.enabled $search.enabled) -}}
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "esgf.component.fullname" (list . "search") }}
  labels: {{ include "esgf.component.labels" (list . "search" $search.labels) | nindent 4 }}
spec:
  replicas: {{ $search.replicaCount }}
  selector:
    matchLabels: {{ include "esgf.component.selectorLabels" (list . "search") | nindent 6 }}
  template:
    metadata:
      labels: {{ include "esgf.component.selectorLabels" (list . "search") | nindent 8 }}
      annotations:
        # Roll the deployment when the configmap changes
        checksum/configmap: {{ include (print $.Template.BasePath "/search/configmap.yaml") . | sha256sum }}
    spec:
      {{- with (default .Values.image.pullSecrets $search.image.pullSecrets) }}
      imagePullSecrets: {{ toYaml . | nindent 8 }}
      {{- end }}
      containers:
        - name: search
          {{ include "esgf.deployment.image" (list . $search.image) }}
          resources: {{ toYaml $search.resources | nindent 12 }}
          ports:
            - name: http
              containerPort: 8080
          env: {{ toYaml $search.extraEnv | nindent 12 }}
          readinessProbe: &probe
            httpGet:
              path: /esg-search/search
              port: 8080
              httpHeaders:
                - name: Host
                  value: "{{ .Values.hostname }}"
                - name: X-Forwarded-Host
                  value: "{{ .Values.hostname }}"
                - name: X-Forwarded-Proto
                  value: https
            initialDelaySeconds: 10
            periodSeconds: 10
          livenessProbe:
            <<: *probe
            initialDelaySeconds: 120
          securityContext:
            readOnlyRootFilesystem: true
          volumeMounts:
            - name: esg-config
              mountPath: /esg/config
              readOnly: true
      {{- with $search.nodeSelector }}
      nodeSelector: {{ toYaml . | nindent 8 }}
      {{- end }}
      {{- with $search.affinity }}
      affinity: {{ toYaml . | nindent 8 }}
      {{- end }}
      {{- with $search.tolerations }}
      tolerations: {{ toYaml . | nindent 8 }}
      {{- end }}
      volumes:
        - name: esg-config
          configMap:
            name: {{ include "esgf.component.fullname" (list . "search") }}
{{- end -}}
Loading