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

Define Environment Variables for a Container #48273

Open
amitgitz opened this issue Oct 10, 2024 · 10 comments
Open

Define Environment Variables for a Container #48273

amitgitz opened this issue Oct 10, 2024 · 10 comments
Labels
language/en Issues or PRs related to English language needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. sig/docs Categorizes an issue or PR as relevant to SIG Docs. triage/needs-information Indicates an issue needs more information in order to work on it.

Comments

@amitgitz
Copy link

Not able to Login to Container

Screenshot 2024-10-10 at 1 29 56 PM
@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Oct 10, 2024
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

SIG Docs takes a lead on issue triage for this website, but any Kubernetes member can accept issues by applying the triage/accepted label.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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-sigs/prow repository.

@niranjandarshann
Copy link
Contributor

@amitgitz can you provide the yaml file you created?

@niranjandarshann
Copy link
Contributor

@k8s-ci-robot k8s-ci-robot added sig/docs Categorizes an issue or PR as relevant to SIG Docs. language/en Issues or PRs related to English language labels Oct 10, 2024
@tengqm
Copy link
Contributor

tengqm commented Oct 11, 2024

This could be caused by the image used failed to include the coreutils package.
We need to use a different image if so.

@tengqm
Copy link
Contributor

tengqm commented Oct 11, 2024

/triage needs-information

@k8s-ci-robot k8s-ci-robot added the triage/needs-information Indicates an issue needs more information in order to work on it. label Oct 11, 2024
@niranjandarshann
Copy link
Contributor

This could be caused by the image used failed to include the coreutils package. We need to use a different image if so.

Yes we should use the image where printenv command is used like busybox instead of gcr.io/google-samples/hello-app:2.0

@amitgitz
Copy link
Author

@amitgitz can you provide the yaml file you created?

pod.yaml

apiVersion: v1
kind: Pod
metadata:
  name: envar-demo
  labels:
    purpose: demonstrate-envars
spec:
  containers:
  - name: envar-demo-container
    image: gcr.io/google-samples/hello-app:2.0
    env:
    - name: DEMO_GREETING
      value: "Hello from the environment"
    - name: DEMO_FAREWELL
      value: "Such a sweet sorrow"
      

@niranjandarshann
Copy link
Contributor

@amitgitz yes the image is not correctly used.
Here we can use different image like nginx:1.21.6 putting rest yaml as it is will work perfectly.

@niranjandarshann
Copy link
Contributor

I am Adding the yaml file here which run successfully.

apiVersion: v1
kind: Pod
metadata:
  name: envar-demo
  labels:
    purpose: demonstrate-envars
spec:
  containers:
  - name: envar-demo-container
    image: nginx:1.21.6
    env:
    - name: DEMO_GREETING
      value: "Hello from the environment"
    - name: DEMO_FAREWELL
      value: "Such a sweet sorrow"

@niranjandarshann
Copy link
Contributor

@amitgitz Write the description of the issue so that it can be easily understandable To the new to the issue.

The issue is valid try to provide brief description of it clearly to understand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
language/en Issues or PRs related to English language needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. sig/docs Categorizes an issue or PR as relevant to SIG Docs. triage/needs-information Indicates an issue needs more information in order to work on it.
Projects
None yet
Development

No branches or pull requests

4 participants