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

[Helm] Add POD_NAMESPACE environment variable into Che server pod #17773

Merged
merged 1 commit into from
Sep 2, 2020

Conversation

mmorhun
Copy link
Contributor

@mmorhun mmorhun commented Sep 2, 2020

Signed-off-by: Mykola Morhun mmorhun@redhat.com

What does this PR do?

Adds POD_NAMESPACE environment variable with value of Che server namespace name into Che server container in Helm chart.

What issues does this PR fix or reference?

#17766

@mmorhun mmorhun self-assigned this Sep 2, 2020
@che-bot che-bot added status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. kind/bug Outline of a bug - must adhere to the bug report template. labels Sep 2, 2020
@che-bot
Copy link
Contributor

che-bot commented Sep 2, 2020

❌ E2E Happy path tests failed ❗

See Details

Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1)

ℹ️ Use comment "[crw-ci-test]" to rerun happy path E2E test.

@tolusha tolusha mentioned this pull request Sep 2, 2020
58 tasks
@@ -72,7 +72,8 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace

- name: POD_NAMESPACE
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've already seen that code. I used POD_NAMESPACE because this environment variable is already used in the Chart unlike KUBERNETES_NAMESPACE. Also, in my opinion, pod namespace is more clear in context of deploying a pod than kubernetes namesapce (which is more like a term to me).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

operator is setting KUBERNETES_NAMESPACE

@@ -72,7 +72,8 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace

- name: POD_NAMESPACE
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not reference it with metadata.namespace as done on many places in this file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tried that approach first, the result:

 ›   Error: Error: Unable to execute helm command helm upgrade --install che --force --namespace che --set global.cheDomain=192.168.39.227.nip.io --set global.tls.useSelfSignedCerts=true 
 ›   --set global.ingressDomain=192.168.39.227.nip.io --set cheImage=quay.io/eclipse/che-server:nightly --set che.disableProbes=false  -f 
 ›   /home/user/.cache/chectl/templates/kubernetes/helm/che/values/tls.yaml /home/user/.cache/chectl/templates/kubernetes/helm/che/ / Error: YAML parse error on 
 ›   che/templates/deployment.yaml: error converting YAML to JSON: yaml: line 52: mapping values are not allowed in this context
 ›   Installation failed, check logs in '/tmp/chectl-logs/1599033986714'

Using of Release.Namespace is safe as it returns the namespace in which the chart is being deployed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sparkoo if you know how to overcome that error, I'll use the reference to metadata.namespace as it is already used in other places.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mmorhun looks strange. I don't know how to fix it and I'm ok with keeping it as is.

Copy link
Contributor

@tolusha tolusha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my comment pls

Signed-off-by: Mykola Morhun <mmorhun@redhat.com>
@che-bot
Copy link
Contributor

che-bot commented Sep 2, 2020

✅ E2E Happy path tests succeed 🎉

See Details

Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1)

@mmorhun mmorhun merged commit dd42190 into master Sep 2, 2020
@mmorhun mmorhun deleted the che-17766 branch September 2, 2020 11:23
@che-bot che-bot added this to the 7.19 milestone Sep 2, 2020
@che-bot che-bot removed the status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. label Sep 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Outline of a bug - must adhere to the bug report template.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants