Pod status as `CreateContainerConfigError` in Kubernetes cluster

7/30/2020

I am new to Kubernates and have to deploy TheHive in our infrastructure. I use the docker image created by the cummunity thehiveproject/thehive.

Below are my scripts that I'm using for deployment.

apiVersion: v1
kind: Service
metadata:
  name: thehive
  labels:
    app: thehive
spec:
  type: NodePort
  ports:
    - port: 9000
      targetPort: 9000
      nodePort: 30900
      protocol: TCP
  selector:
    app: thehive
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: thehive-pv-claim
  labels:
   app: thehive
spec:
  accessModes:
    - ReadWriteOnce
  storageClassName: "local-path"
  resources:
    requests:
      storage: 1Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: thehive
  labels:
    app: thehive
spec:
  selector: 
    matchLabels:
      app: thehive
  template:
    metadata:
      labels: 
        app: thehive
    spec:
      containers:
      - image: thehiveproject/thehive 
        name: thehive
        env:
        - name: TH_NO_CONFIG
          value: 1
        - name: TH_SECRET
          value: "test@123"
        - name: TH_CONFIG_ES
          value: "elasticsearch"
        - name: TH_CORTEX_PORT
          value: "9001"
        ports:
        - containerPort: 9000
          name: thehive
        volumeMounts:
        - name: thehive-config-file
          mountPath: /etc/thehive/application.conf
          subPath: application.conf
        - name: thehive-storage
          mountPath: /etc/thehive/
      volumes:
        - name: thehive-storage
          persistentVolumeClaim:
            claimName: thehive-pv-claim
        - name: thehive-config-file
          hostPath:
            path: /home/ubuntu/k8s/thehive

Unfortunattly when I do kubectl apply -f thehive-dep.yml I get a CreateContainerConfigError. Elasticsearch is successfully deployed with the service name elasticsearch.

What am i doing wrong?

thank for every help :(

-- Alexa
docker
kubernetes

0 Answers