Re: [kubernetes/kubernetes] kubectl run overrides envFrom doesn't add env vars (#48361)

280 views
Skip to first unread message

Brian Grant

unread,
Oct 2, 2017, 1:16:37 PM10/2/17
to kubernetes/kubernetes, k8s-mirror-cli-feature-requests, Team mention

+1 to @harmjanblok's request to dump the API spec

cc @kubernetes/sig-cli-bugs @kubernetes/sig-cli-feature-requests


You are receiving this because you are on a team that was mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

Jakub Kvita

unread,
Nov 8, 2017, 8:03:24 AM11/8/17
to kubernetes/kubernetes, k8s-mirror-cli-feature-requests, Team mention

Hello, I tried dry running it and looks like it is missing in the spec.

kubectl run ubuntu --overrides='
{
  "spec": {
    "template": {
      "spec": {
        "containers": [
          {
            "name": "app",
            "image": "ubuntu",
            "envFrom": [
              {
                "configMapRef": {
                  "name": "config-env"
                }
              },
              {
                "secretRef": {
                  "name": "secret-env"
                }
              }
            ]
          }
        ]
      }
    }
  }
}
'  --image=ubuntu --restart=Never --dry-run -o yaml -- bash -c "sleep 3 && env"
apiVersion: v1
kind: Pod
metadata:
  creationTimestamp: null
  labels:
    run: ubuntu
  name: ubuntu
spec:
  containers:
  - args:
    - bash
    - -c
    - sleep 3 && env
    image: ubuntu
    imagePullPolicy: IfNotPresent
    name: ubuntu
    resources: {}
    terminationMessagePath: /dev/termination-log
    terminationMessagePolicy: File
  dnsPolicy: ClusterFirst
  restartPolicy: Never
  schedulerName: default-scheduler
  securityContext: {}
  terminationGracePeriodSeconds: 30
status: {}

No envFrom secret or configmap.

kubectl version
Client Version: version.Info{Major:"1", Minor:"7", GitVersion:"v1.7.5", GitCommit:"17d7182a7ccbb167074be7a87f0a68bd00d58d97", GitTreeState:"clean", BuildDate:"2017-08-31T09:14:02Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"7", GitVersion:"v1.7.4", GitCommit:"793658f2d7ca7f064d2bdf606519f9fe1229c381", GitTreeState:"clean", BuildDate:"2017-08-17T08:30:51Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}

fejta-bot

unread,
Feb 7, 2018, 12:34:40 PM2/7/18
to kubernetes/kubernetes, k8s-mirror-cli-feature-requests, Team mention

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

fejta-bot

unread,
Mar 9, 2018, 1:19:38 PM3/9/18
to kubernetes/kubernetes, k8s-mirror-cli-feature-requests, Team mention

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.

/lifecycle rotten
/remove-lifecycle stale

fejta-bot

unread,
Apr 8, 2018, 3:07:38 PM4/8/18
to kubernetes/kubernetes, k8s-mirror-cli-feature-requests, Team mention

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.


Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

k8s-ci-robot

unread,
Apr 8, 2018, 3:07:48 PM4/8/18
to kubernetes/kubernetes, k8s-mirror-cli-feature-requests, Team mention

Closed #48361.

Sam Moore

unread,
Dec 27, 2018, 2:10:14 PM12/27/18
to kubernetes/kubernetes, k8s-mirror-cli-feature-requests, Team mention

I believe I'm seeing the same issue outlined here where --overrides with a spec that has env or envFrom doesn't show up in the resulting pod.

/reopen
/remove-lifecycle rotten

Kubernetes Prow Robot

unread,
Dec 27, 2018, 2:10:28 PM12/27/18
to kubernetes/kubernetes, k8s-mirror-cli-feature-requests, Team mention

@samandmoore: You can't reopen an issue/PR unless you authored it or you are a collaborator.

In response to this:

I believe I'm seeing the same issue outlined here where --overrides with a spec that has env or envFrom doesn't show up in the resulting pod.

/reopen
/remove-lifecycle rotten

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Axel

unread,
Nov 17, 2020, 7:37:31 AM11/17/20
to kubernetes/kubernetes, k8s-mirror-cli-feature-requests, Team mention

If anyone still has this issue like me I found a solution, I think it's an issue with the parsing of the file ...
I transformed

  - envFrom:
    - configMapRef:
        name: config-env
    - secretRef:
        name: secret-env

By

  - envFrom:
    - configMapRef: { name: config-env }
    - secretRef: { name: secret-env }

Don't know why but it works


You are receiving this because you are on a team that was mentioned.

Reply to this email directly, view it on GitHub, or unsubscribe.

Reply all
Reply to author
Forward
0 new messages