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

fix: add the namespace resource within helm templates #1332

Merged
merged 1 commit into from
Apr 20, 2023

Conversation

arkodg
Copy link
Contributor

@arkodg arkodg commented Apr 19, 2023

This is an unfortunate workaround due the difference in UX between helm template and helm install
The project recommends helm install as a way to install EG which supports a --create-namespace flag to create a namespace However we also generate a static YAML using helm template as part of the release artifact so a user can install the YAML directly using kubectl instead of helm . The issue here is helm template does not support --create-namespace, so instead this commit adds a knob called createNamespace to the Helm chart which is false by default, but turned on during make generate-manifests

Fixes: #1307

This is unfortunate workaround due the difference in
UX between `helm template` and `helm install`
The project recommends `helm install` as a way to install
EG which supports a `--create-namespace` flag to create a namespace
However we also generate a static YAML using `helm template` as part of
the release artficat so a user can install the YAML directly using
`kubectl` instead of `helm` . The issue here is `helm template` does
not support `--create-namespace`, so instead this commit adds a knob
called `createNamespace` to the Helm chart which is `false` by default,
but turned on during `make generate-manifests`

Fixes: envoyproxy#1307

Signed-off-by: Arko Dasgupta <arko@tetrate.io>
@arkodg arkodg requested a review from a team as a code owner April 19, 2023 18:02
@codecov
Copy link

codecov bot commented Apr 19, 2023

Codecov Report

Merging #1332 (f1fc385) into main (ef98e16) will increase coverage by 0.01%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #1332      +/-   ##
==========================================
+ Coverage   61.80%   61.82%   +0.01%     
==========================================
  Files          85       85              
  Lines       10853    10854       +1     
==========================================
+ Hits         6708     6710       +2     
  Misses       3699     3699              
+ Partials      446      445       -1     

see 3 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@arkodg arkodg added this to the 0.4.0 milestone Apr 19, 2023
@@ -0,0 +1,6 @@
{{ if .Values.createNamespace }}
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe I'm out of date, I recall it's not a good practice to put namespace in a helm chart.

Copy link
Contributor Author

@arkodg arkodg Apr 20, 2023

Choose a reason for hiding this comment

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

it is not, but we are using helm as the source of truth for manifest templates, in the previous release it was kustomize

  • for the common case using helm install we skip this file (createNamespace is false)
  • for the manifest generation case to support install via 1 single YAML, we rely on it

@arkodg arkodg requested a review from zirain April 20, 2023 01:32
Copy link
Contributor

@zirain zirain left a comment

Choose a reason for hiding this comment

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

/lgtm for now

we need review the helm chart in v0.5, this and the crds folder.

@Xunzhuo
Copy link
Member

Xunzhuo commented Apr 20, 2023

Thanks @arkodg

@Xunzhuo Xunzhuo merged commit 9d6d699 into envoyproxy:main Apr 20, 2023
Alice-Lilith pushed a commit that referenced this pull request Apr 24, 2023
Add the namespace resource within helm templates

This is unfortunate workaround due the difference in
UX between `helm template` and `helm install`
The project recommends `helm install` as a way to install
EG which supports a `--create-namespace` flag to create a namespace
However we also generate a static YAML using `helm template` as part of
the release artficat so a user can install the YAML directly using
`kubectl` instead of `helm` . The issue here is `helm template` does
not support `--create-namespace`, so instead this commit adds a knob
called `createNamespace` to the Helm chart which is `false` by default,
but turned on during `make generate-manifests`

Fixes: #1307

Signed-off-by: Arko Dasgupta <arko@tetrate.io>
(cherry picked from commit 9d6d699)
Signed-off-by: AliceProxy <alicewasko@datawire.io>
Alice-Lilith pushed a commit that referenced this pull request Apr 24, 2023
* Extension: fix pointer error (#1323)

(cherry picked from commit 2bf9607)
Signed-off-by: AliceProxy <alicewasko@datawire.io>

* fix: add the namespace resource within helm templates (#1332)

Add the namespace resource within helm templates

This is unfortunate workaround due the difference in
UX between `helm template` and `helm install`
The project recommends `helm install` as a way to install
EG which supports a `--create-namespace` flag to create a namespace
However we also generate a static YAML using `helm template` as part of
the release artficat so a user can install the YAML directly using
`kubectl` instead of `helm` . The issue here is `helm template` does
not support `--create-namespace`, so instead this commit adds a knob
called `createNamespace` to the Helm chart which is `false` by default,
but turned on during `make generate-manifests`

Fixes: #1307

Signed-off-by: Arko Dasgupta <arko@tetrate.io>
(cherry picked from commit 9d6d699)
Signed-off-by: AliceProxy <alicewasko@datawire.io>

---------

Signed-off-by: Arko Dasgupta <arko@tetrate.io>
Signed-off-by: AliceProxy <alicewasko@datawire.io>
Co-authored-by: Arko Dasgupta <arkodg@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The new helm template in generate-manifests doesn't create namespace
3 participants