2016-10-23 60 views
1

我一再看到類似的東西;configmaps不適用於pod?

Warning FailedSync Error syncing pod, skipping: failed to "StartContainer" for "some-service" with RunContainerError: "GenerateRunContainerOptions: Couldn't find key app-id in ConfigMap default/intercom"

部署嘗試設置env的位置。從configmap瓦爾,那就是:

apiVersion: v1 
data: 
    intercom: | 
    app-id=some-id 
    api-key=some-key 
kind: ConfigMap 
metadata: 
    creationTimestamp: 2016-10-23T13:09:58Z 
    name: intercom 
    namespace: default 
    resourceVersion: "3836" 
    selfLink: /api/v1/namespaces/default/configmaps/intercom 
    uid: ffeea5f0-9921-11e6-b2b7-0acff65e44c3 

以及部署的樣子:

apiVersion: extensions/v1beta1 
kind: Deployment 
metadata: 
    name: myservice 
spec: 
    replicas: 2 
    template: 
    metadata: 
    labels: 
     run: myservice 
    spec: 
     containers: 
     - name: myservice 
      image: somerepo/myservice:v1.0 
      env: 
      - name: INTERCOM_APPID 
       valueFrom: 
       configMapKeyRef: 
        name: intercom 
        key: app-id 
      - name: INTERCOM_APIKEY 
       valueFrom: 
       configMapKeyRef: 
        name: intercom 
        key: api-key 
      ports: 
      - containerPort: 9000 
     imagePullSecrets: 
     - name: docker-hub-key 

出了什麼問題嗎?

回答

2

您的配置圖只包含一個鍵:intercom

+0

是的,注意到這一點。當我使用'--from-file'創建配置映射時,這是一種奇怪的情況,它創建了我不期望的東西。我會在下一次從yaml's創建它們,以確保它。感謝您的迴應! – Ashesh

相關問題