-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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: Chart not using helm-flag '--namespace' #7226
Comments
__$ date
Wednesday 09 June 2021 04:03:44 PM IST
__$ k get ns
NAME STATUS AGE
default Active 32d
ingress-nginx Active 40m
kube-node-lease Active 32d
kube-public Active 32d
kube-system Active 32d
logdna-agent Active 16d
metallb-system Active 19d
postgres Active 8d
test Active 19d
__$ helm -n helm-template-test template ingress-nginx-helm-test
ingress-nginx/ingress-nginx | grep -i namespace
namespace: "helm-template-test"
- namespaces
namespace: "helm-template-test"
-
--publish-service=$(POD_NAMESPACE)/ingress-nginx-helm-test-controller
-
--configmap=$(POD_NAMESPACE)/ingress-nginx-helm-test-controller
- name: POD_NAMESPACE
fieldPath: metadata.namespace
namespace: "helm-template-test"
namespace: "helm-template-test"
namespace: "helm-template-test"
-
--host=ingress-nginx-helm-test-controller-admission,ingress-nginx-helm-test-controller-admission.$(POD_NAMESPACE).svc
- --namespace=$(POD_NAMESPACE)
- name: POD_NAMESPACE
fieldPath: metadata.namespace
- --namespace=$(POD_NAMESPACE)
- name: POD_NAMESPACE
fieldPath: metadata.namespace
__$ helm search repo ingress-nginx
NAME CHART VERSION APP VERSION DESCRIPTION
ingress-nginx/ingress-nginx 3.33.0 0.47.0 Ingress
controller for Kubernetes using NGINX a...
__$
Thanks,
; Long
…On 09/06/21 3:46 pm, Julian wrote:
*NGINX Ingress controller version*: 0.47.0
*Kubernetes version* (use |kubectl version|): Server Version:
version.Info{Major:"1", Minor:"19+", GitVersion:"v1.19.9-gke.1900",
GitCommit:"008fd38bf3dc201bebdd4fe26edf9bf87478309a",
GitTreeState:"clean", BuildDate:"2021-04-14T09:22:08Z",
GoVersion:"go1.15.8b5", Compiler:"gc", Platform:"linux/amd64"}
*Environment*:
* *Cloud provider or hardware configuration*: GKE
* *OS* (e.g. from /etc/os-release): Container-Optimized OS from Google
* *Kernel* (e.g. |uname -a|): 5.4.89+ #1
<#1> SMP Sat Feb
13 19:45:14 PST 2021
* *Install tools*: helm v3.6.0 (I hope this is what you want to know)
* *Others*:
*What happened*:
I was running |helm template --namespace gitlab-managed-apps
nginx-ingress ingress-nginx/ingress-nginx|
The result is (just a few resources, as the output would be too long):
---
# Source: ingress-nginx/templates/controller-serviceaccount.yaml
apiVersion:v1
kind:ServiceAccount
metadata:
labels:
helm.sh/chart:ingress-nginx-3.33.0
app.kubernetes.io/name:ingress-nginx
app.kubernetes.io/instance:ingress-nginx
app.kubernetes.io/version:"0.47.0"
app.kubernetes.io/managed-by:Helm
app.kubernetes.io/component:controller
name:ingress-nginx
automountServiceAccountToken:true
---
# Source: ingress-nginx/templates/controller-configmap.yaml
apiVersion:v1
kind:ConfigMap
metadata:
labels:
helm.sh/chart:ingress-nginx-3.33.0
app.kubernetes.io/name:ingress-nginx
app.kubernetes.io/instance:ingress-nginx
app.kubernetes.io/version:"0.47.0"
app.kubernetes.io/managed-by:Helm
app.kubernetes.io/component:controller
name:ingress-nginx-controller
data:
---
# ...
*What you expected to happen*:
Every resource exept cluster-wide resources (e.g. ClusterRole) should
have the namespace set in |metadata.namespace|
---
# Source: ingress-nginx/templates/controller-serviceaccount.yaml
apiVersion:v1
kind:ServiceAccount
metadata:
labels:
helm.sh/chart:ingress-nginx-3.33.0
app.kubernetes.io/name:ingress-nginx
app.kubernetes.io/instance:ingress-nginx
app.kubernetes.io/version:"0.47.0"
app.kubernetes.io/managed-by:Helm
app.kubernetes.io/component:controller
name:ingress-nginx
namespace:gitlab-managed-apps # <------ Is missing
automountServiceAccountToken:true
---
# Source: ingress-nginx/templates/controller-configmap.yaml
apiVersion:v1
kind:ConfigMap
metadata:
labels:
helm.sh/chart:ingress-nginx-3.33.0
app.kubernetes.io/name:ingress-nginx
app.kubernetes.io/instance:ingress-nginx
app.kubernetes.io/version:"0.47.0"
app.kubernetes.io/managed-by:Helm
app.kubernetes.io/component:controller
name:ingress-nginx-controller
namespace:gitlab-managed-apps # <------ Is missing
data:
---
# ...
*How to reproduce it*:
Just run:
|helm template --namespace gitlab-managed-apps nginx-ingress
ingress-nginx/ingress-nginx|
*Anything else we need to know*:
If this is a bug, I'm willing to fix it. ;)
/kind bug
/area helm
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#7226>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABGZVWRQENKTI2PIYZZJXBTTR45QTANCNFSM46LXIEJA>.
|
maybe we could add /good-first-issue |
@tao12345666333: Please ensure the request meets the requirements listed here. If this request no longer meets these requirements, the label can be removed In response to this:
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. |
@tao12345666333 if some more advise and guidance is available, then I can attempt a PR . I don't know the impact of adding {{ .Release.Namespace }} in all relevant template yaml files.
|
This is a known issue. As mentioned here helm/helm#3553 (comment) the So usually when we write helm chart, we will add
You only need to add this field for resources in the namespace scope |
@tao12345666333 bacongobbler's comments in that issue you linked make so much sense |
Sorry, my bad. I hit the wrong button by accident. There are at least some use-cases for the namespace parameter in the helm-template-functionality: We use it to create the manifests and then let them deploy via gitlab's kubernetes agent. In that case we need to manually adjust the rendered manifest every time we update the helm values. So, i will prepare a pr for this ;) bests |
@flyinggecko Don't worry, @longwuyuan has opened a PR #7256 |
Cool, is released and already in use. Thank you 👍 |
NGINX Ingress controller version: 0.47.0
Kubernetes version (use
kubectl version
): Server Version: version.Info{Major:"1", Minor:"19+", GitVersion:"v1.19.9-gke.1900", GitCommit:"008fd38bf3dc201bebdd4fe26edf9bf87478309a", GitTreeState:"clean", BuildDate:"2021-04-14T09:22:08Z", GoVersion:"go1.15.8b5", Compiler:"gc", Platform:"linux/amd64"}Environment:
uname -a
): 5.4.89+ Basic structure #1 SMP Sat Feb 13 19:45:14 PST 2021What happened:
I was running
helm template --namespace gitlab-managed-apps nginx-ingress ingress-nginx/ingress-nginx
The result is (just a few resources, as the output would be too long):
What you expected to happen:
Every resource, except cluster-wide resources (e.g. ClusterRole), should have the namespace set in
metadata.namespace
How to reproduce it:
Just run:
helm template --namespace gitlab-managed-apps nginx-ingress ingress-nginx/ingress-nginx
Anything else we need to know:
If this is a bug, I'm willing to fix it. ;)
/kind bug
/area helm
The text was updated successfully, but these errors were encountered: