Kubernetes集群中Pod的状态为``CreateContainerConfigError''

时间:2020-07-30 20:17:38

标签: docker kubernetes

我是Kubernates的新手,必须在我们的基础架构中部署 TheHive 。我使用cummunity thehiveproject / thehive 创建的docker映像。

下面是我用于部署的脚本。

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

不幸的是,当我这样做 kubectl apply -f thehive-dep.yml 我收到 CreateContainerConfigError 。 Elasticsearch已成功部署,服务名称为 elasticsearch

我在做什么错了?

感谢您的帮助:(

0 个答案:

没有答案