Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error validating data: found invalid field envFrom for v1.Container #49461

Closed
bw2 opened this issue Jul 24, 2017 · 6 comments
Closed

error validating data: found invalid field envFrom for v1.Container #49461

bw2 opened this issue Jul 24, 2017 · 6 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery.

Comments

@bw2
Copy link

bw2 commented Jul 24, 2017

Is this a BUG REPORT or FEATURE REQUEST?:

Uncomment only one, leave it on its own line:

/kind bug

/kind feature

What happened:

Deploying this config:

kind: Deployment
apiVersion: extensions/v1beta1
metadata:
  name: some-name
  labels:
    name: some-name
    deployment: some-target
spec:
  replicas: 1
  template:
    metadata:
      labels:
        name: some-name
        deployment: some-target
    spec:
      volumes:
      - name: some-volume
        hostPath:
          path: /some-path
      - name: data-dir
        hostPath:
          path: /data
      containers:
      - name: some-pod
        image: image-name-prefix/image-name:timestamp
        ports:
        - containerPort: 1234
          protocol: TCP
        imagePullPolicy: IfNotPresent
        volumeMounts:
        - name: some-volume
          mountPath: /path
        - name: data-dir
          mountPath: /data
        env:
        - name: POSTGRES_USERNAME
          valueFrom:
            secretKeyRef:
              name: postgres-secrets
              key: postgres.username
        - name: POSTGRES_PASSWORD
          valueFrom:
            secretKeyRef:
              name: postgres-secrets
              key: postgres.password
        envFrom:
          - configMapRef:
              name: all-settings
      restartPolicy: Always
      dnsPolicy: ClusterFirst

fails with the following error:

error: error validating "config.yaml": error validating data: found invalid field envFrom for v1.Container; if you choose to ignore these errors, turn validation off with --validate=false

What you expected to happen:

no error

How to reproduce it (as minimally and precisely as possible):

Run:
kubectl apply -f config.yaml --record

Anything else we need to know?:

Environment:

  • Kubernetes version (use kubectl version):
Client Version: version.Info{Major:"1", Minor:"6", GitVersion:"v1.6.6", GitCommit:"7fa1c1756d8bc963f1a389f4a6937dc71f08ada2", GitTreeState:"clean", BuildDate:"2017-06-16T18:34:20Z", GoVersion:"go1.7.6", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"5", GitVersion:"v1.5.1", GitCommit:"82450d03cb057bab0950214ef122b67c83fb11df", GitTreeState:"clean", BuildDate:"2016-12-14T00:52:01Z", GoVersion:"go1.7.4", Compiler:"gc", Platform:"linux/amd64"}
  • Cloud provider or hardware configuration**: Kube-Solo
2017-07-23 21:07:17,774 INFO     Server Version: 17.05.0-ce
2017-07-23 21:07:17,774 INFO     Storage Driver: overlay2
2017-07-23 21:07:17,775 INFO      Backing Filesystem: extfs
2017-07-23 21:07:17,775 INFO      Supports d_type: true
2017-07-23 21:07:17,775 INFO      Native Overlay Diff: true
2017-07-23 21:07:17,775 INFO     Logging Driver: json-file
2017-07-23 21:07:17,775 INFO     Cgroup Driver: cgroupfs
2017-07-23 21:07:17,775 INFO     Plugins:
2017-07-23 21:07:17,775 INFO      Volume: local
2017-07-23 21:07:17,775 INFO      Network: bridge host macvlan null overlay
2017-07-23 21:07:17,775 INFO     Swarm: inactive
2017-07-23 21:07:17,775 INFO     Runtimes: runc
2017-07-23 21:07:17,775 INFO     Default Runtime: runc
2017-07-23 21:07:17,776 INFO     Init Binary: docker-init
2017-07-23 21:07:17,776 INFO     Security Options:
2017-07-23 21:07:17,776 INFO      seccomp
2017-07-23 21:07:17,776 INFO       Profile: default
2017-07-23 21:07:17,776 INFO      selinux
2017-07-23 21:07:17,776 INFO     Kernel Version: 4.12.0-coreos
2017-07-23 21:07:17,776 INFO     Operating System: Container Linux by CoreOS 1465.0.0 (Ladybug)
2017-07-23 21:07:17,776 INFO     OSType: linux
2017-07-23 21:07:17,777 INFO     Architecture: x86_64
2017-07-23 21:07:17,777 INFO     CPUs: 2
2017-07-23 21:07:17,777 INFO     Total Memory: 7.801GiB
2017-07-23 21:07:17,777 INFO     run: 'docker images'
2017-07-23 21:07:17,777 INFO     Name: k8solo-01
2017-07-23 21:07:17,780 INFO     Registry: https://index.docker.io/v1/
2017-07-23 21:07:17,780 INFO     Experimental: false
  • OS (e.g. from /etc/os-release):
    MacOSX
  • Kernel (e.g. uname -a):
Darwin wmd2b-dec 15.6.0 Darwin Kernel Version 15.6.0: Tue Apr 11 16:00:51 PDT 2017; root:xnu-3248.60.11.5.3~1/RELEASE_X86_64 x86_64
  • Install tools:
  • Others:
@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Jul 24, 2017
@k8s-github-robot
Copy link

@bw2
There are no sig labels on this issue. Please add a sig label by:

  1. mentioning a sig: @kubernetes/sig-<group-name>-<group-suffix>
    e.g., @kubernetes/contributor-experience-<group-suffix> to notify the contributor experience sig, OR

  2. specifying the label manually: /sig <label>
    e.g., /sig scalability to apply the sig/scalability label

Note: Method 1 will trigger an email to the group. You can find the group list here and label list here.
The <group-suffix> in the method 1 has to be replaced with one of these: bugs, feature-requests, pr-reviews, test-failures, proposals

@k8s-github-robot k8s-github-robot added the needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. label Jul 24, 2017
@dixudx
Copy link
Member

dixudx commented Jul 24, 2017

@bw2 This is not a bug. Please upgrade your apiserver to v1.6.1+.

For v1.5.1, envFrom has not been implemented until v1.6.1.

@xiangpengzhao
Copy link
Contributor

@dixudx yeah 👍 .

I use @bw2 's config on HEAD, it works.

@xiangpengzhao
Copy link
Contributor

/sig api-machinery

@k8s-ci-robot k8s-ci-robot added the sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. label Jul 24, 2017
@k8s-github-robot k8s-github-robot removed the needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. label Jul 24, 2017
@supereagle
Copy link
Contributor

@bw2 Your server version(v1.5.1) is too low, which does not support envFrom. Please update your server version.

@bw2
Copy link
Author

bw2 commented Jul 24, 2017

thanks all!

I'll revisit after TheNewNormal/kube-solo-osx#179

@bw2 bw2 closed this as completed Jul 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery.
Projects
None yet
Development

No branches or pull requests

6 participants