V1.2 Atomic Host RHEL不支持Kubernetes secretRefKey?

时间:2016-05-14 19:23:08

标签: kubernetes rhel

当我从http://kubernetes.io/docs/user-guide/secrets/创建此Pod时:

apiVersion: v1
kind: Pod
metadata:
  name: secret-env-pod
spec:
  containers:
    - name: mycontainer
      image: redis
      env:
        - name: SECRET_USERNAME
          valueFrom:
            secretKeyRef:
              name: mysecret
              key: username
        - name: SECRET_PASSWORD
          valueFrom:
            secretKeyRef:
              name: mysecret
              key: password
  restartPolicy: Never

我收到此错误:

error validating "rc.yml": error validating data: [field fieldRef: is required, found invalid field secretKeyRef for v1.EnvVarSource]; if you choose to ignore these errors, turn validation off with --validate=false

我正在使用Atomic Host RHEL的最新版本1.2:

$ kubectl version
Client Version: version.Info{Major:"1", Minor:"2", GitVersion:"v1.2.0", GitCommit:"738b7603b042dcda7a5ba419ab0e7f40a617080c", GitTreeState:"clean"}
Server Version: version.Info{Major:"1", Minor:"2", GitVersion:"v1.2.0", GitCommit:"738b7603b042dcda7a5ba419ab0e7f40a617080c", GitTreeState:"clean"}

RHEL在Atomic Host中的Kubernetes发行版有什么问题吗?

1 个答案:

答案 0 :(得分:0)

事实证明,Kubernetes在〜/ .kube中缓存api版本的东西,我们最近升级到稳定的V1.2。这解决了这个问题:

rm -rf ~/.kube