apiVersion: v1
kind: Pod
metadata:
  name: ctafrontend
  labels:
    k8s-app: ctafrontend
spec:
  restartPolicy: Never
  containers:
  - name: ctafrontend
    image: gitlab-registry.cern.ch/cta/ctageneric:78673git921a9300
    stdin: true
    env:
    - name: MY_NAME
      valueFrom:
        fieldRef:
          fieldPath: metadata.name
    - name: MY_NAMESPACE
      valueFrom:
        fieldRef:
          fieldPath: metadata.namespace
    - name: INSTANCE_NAME
      value: "$(MY_NAMESPACE)"
    - name: TERM
      value: "xterm"
    command: ['/opt/run/bin/ctafrontend.sh']
    args: ["none"]
    volumeMounts:
    - mountPath: /shared
      name: shared
    - mountPath: /etc/config/objectstore
      name: myobjectstore
    - mountPath: /etc/config/database
      name: mydatabase
    - mountPath: /etc/config/library
      name: mylibrary
    - mountPath: /mnt/logs
      name: logstorage
    - mountPath: /etc/config/eoscta
      name: eosctaconfig
    securityContext:
      # RW access needed to volumes
      privileged: true
    ports:
    - containerPort: 10955
      name: ctafrontend
      protocol: TCP
  volumes:
  - name: shared
    hostPath:
      path: /opt/cta
  - name: myobjectstore
    configMap:
      name: objectstore-config
  - name: mydatabase
    configMap:
      name: database-config
  - name: mylibrary
    configMap:
      name: library-config
  - name: logstorage
    persistentVolumeClaim:
      claimName: claimlogs
  - name: eosctaconfig
    configMap:
      name: eoscta-config

  imagePullSecrets:
  - name: ctaregsecret
