-
Notifications
You must be signed in to change notification settings - Fork 16.8k
[stable/chart] prometheus-operator: Make namespace info explicit #13180
Conversation
Hi @surajssd. Thanks for your PR. I'm waiting for a helm member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
d9aa745
to
addc59d
Compare
addc59d
to
15e792a
Compare
The namespace to install the chart into is specified by the helm |
That's right. This value is placed by helm cli/tiller, somewhere. But this behavior is inconsistent with the helm rendering libraries. So if you go ahead and use libraries to parse certain charts which has no parameterizing like above they won't have namespace field in it. Following is run in the prometheus dir that is downloaded from stable. In kubectl the default namespace is $ helm fetch \
--repo https://kubernetes-charts.storage.googleapis.com \
--untar \
--untardir ./ \
prometheus-operator
$ helm template --namespace monitoring . | kubectl apply -f -
podsecuritypolicy.extensions/release-name-grafana created
podsecuritypolicy.extensions/release-name-kube-state-metrics created
podsecuritypolicy.extensions/release-name-prometheus-node-exporter created
...
servicemonitor.monitoring.coreos.com/release-name-prometheus-op-operator created
servicemonitor.monitoring.coreos.com/release-name-prometheus-op-prometheus created
Error from server (NotFound): namespaces "monitoring" not found
Error from server (NotFound): namespaces "monitoring" not found Above in The last two errors are because it is looking for namespace monitoring which does not exists. Even if it is present this means that half of the things will be created in $ kubectl get pods
NAME READY STATUS RESTARTS AGE
release-name-grafana-5759d4d766-rwk88 0/2 Init:CrashLoopBackOff 5 3m45s
release-name-grafana-test 0/1 Error 0 3m46s
release-name-kube-state-metrics-856fbc6f6-nq69k 1/1 Running 0 3m45s
release-name-prometheus-op-operator-7fc4955ddd-zhqbv 0/1 CrashLoopBackOff 5 3m45s Above does not deploy very well. You might argue that this should be fixed in upstream helm tool. But prometheus operator uses this way of fixating namespace in some places. e.g.: charts/stable/prometheus-operator/templates/prometheus-operator/cleanup-crds.yaml Lines 4 to 7 in 3840c5e
IMHO being explicit is no harm. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Any further update will cause the issue/pull request to no longer be considered stale. Thank you for your contributions. |
15e792a
to
718320b
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: surajssd If they are not already assigned, you can assign the PR to them by writing The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/assign @anothertobi |
718320b
to
a81f7fe
Compare
For all the configs that have missing namespace information, this commit adds following line to metadata of those namespaced objects. ``` namespace: {{ .Release.Namespace }} ``` Signed-off-by: Suraj Deshmukh <surajd.service@gmail.com>
a81f7fe
to
9be39c2
Compare
@vsliouniaev updated this PR as well! |
@surajssd, in order for this to work with all the resources provisioned by the chart, you would also have to do this for charts listed in the requirements.yaml kube-state-metrics and prometheus-node-exporter don't have the namespace made explicit. There's a pull request open for Grafana here, that hasn't gotten much traction: #14325. I think these charts would have to accept this change first before prometheus-operator can incorporate it. If you want to install the chart into a specific namespace using rendered templates, you can accomplish this by setting the correct namespace on the kubectl context. If you want to create templates with the namespace already populated, I think you can achieve this with some creative use of the |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Any further update will cause the issue/pull request to no longer be considered stale. Thank you for your contributions. |
For all the configs that have missing namespace information, this commit
adds following line to metadata of those namespaced objects.
Checklist