apiVersion: v1
kind: Pod
metadata:
  name: cp-search-srv
  namespace: default
  labels:
    cloud-pipeline/cp-search-srv: "true"
spec:
  nodeSelector:
    cloud-pipeline/cp-search-srv: "true"
  tolerations:
  - key: node-role.kubernetes.io/master
    effect: NoSchedule
  containers:
    - name: cp-search-srv
      image: lifescience/cloud-pipeline:search-$CP_VERSION
      imagePullPolicy: "Always"
      command: ["/init"]
      ports:
        - containerPort: 8080
      envFrom:
      - configMapRef:
          name: cp-config-global
      volumeMounts:
        - mountPath: /opt/search/logs
          name: search-logs
      readinessProbe:
        tcpSocket:
          port: 8080
        initialDelaySeconds: 5
        periodSeconds: 10
      lifecycle:
        preStop:
          exec:
            command: ["/bin/sh", "-c", "kill -9 $(pgrep -f elasticsearch-agent.jar); sleep 1"]
  volumes:
    - name: search-logs
      hostPath:
        path: /opt/search/logs
  imagePullSecrets:
    - name: cp-distr-docker-registry-secret
  