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 installation does not reflect helm's --namespace argument, but hardcodes kube-system (or rather hides it in the values.yaml) #731

Closed
kastl-ars opened this issue Sep 12, 2024 · 3 comments
Assignees
Labels
good first issue Good for newcomers scope/S Change is Small type/bug Something isn't working

Comments

@kastl-ars
Copy link

Describe the bug
Normally one can install a helm release into a discrete namespace by using helm install --namespace foo ....

This does not work with the retina chart, as it puts the helm release into that namespace, but the resources into the kube-system namespace.

e.g. https://github.com/microsoft/retina/blob/main/deploy/legacy/manifests/controller/helm/retina/values.yaml#L47

If there is a technical reason for doing so, this should be documented. If not, this should be fixed to get the usual behaviour.

To Reproduce
Steps to reproduce the behavior:

  1. Install using the following command:
helm upgrade --install retina oci://ghcr.io/microsoft/retina/charts/retina \
    --namespace retina \
    --create-namespace \
    --version $VERSION \
    --namespace kube-system \
    --set image.tag=$VERSION \
    --set operator.tag=$VERSION \
    --set logLevel=info \
    --set enabledPlugin_linux="\[dropreason\,packetforward\,linuxutil\,dns\]"
  1. Issue helm ls -n retina and find the release there, but no pods or daemonsets (as kubectl get pod,ds -n retina shows)
  2. Check for daemonsets in the kube-system namespace using kubectl get pod,ds -n kube-system
  3. Voilá!

Expected behavior
The chart should respect helm's --namespace argument

Platform (please complete the following information):

  • OS: openSUSE Leap 15.6
  • Kubernetes Version: v1.30.4+k3s1
  • Host: self-hosted VM
  • Retina Version: 0.0.16
@kastl-ars
Copy link
Author

In addition, the operator daemonset always gets deploy to kube-system, even if its configMap is created in e.g. the retina namespace.

https://github.com/microsoft/retina/blob/main/deploy/legacy/manifests/controller/helm/retina/templates/operator.yaml#L6

@rbtr rbtr added type/bug Something isn't working good first issue Good for newcomers scope/S Change is Small labels Sep 18, 2024
github-merge-queue bot pushed a commit that referenced this issue Oct 17, 2024
# Description

- Replaced the hardcoded `kube-system` namespace with the helm value for
the retina operator and other places where it made sense
- Updated the E2E test to accept a namespace parameter to verify if the
retina-agents and retina-operator were deployed correctly
- Manually tested the changes in a local cluster for further
verification, as well as for my learning

## Related Issue
#731 

## Checklist

- [x] I have read the [contributing
documentation](https://retina.sh/docs/contributing).
- [x] I signed and signed-off the commits (`git commit -S -s ...`). See
[this
documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification)
on signing commits.
- [x] I have correctly attributed the author(s) of the code.
- [x] I have tested the changes locally.
- [x] I have followed the project's style guidelines.
- [x] I have updated the documentation, if necessary.
- [x] I have added tests, if applicable.

## Screenshots (if applicable) or Testing Completed
I've attached the E2E test output with the recent microsoft retina
manifest, i.e. 74b6ec2,

[updated_e2e_test_result.txt](https://github.com/user-attachments/files/17400534/updated_e2e_test_result.txt)


## Additional Notes
Add any additional notes or context about the pull request here.

---

Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more
information on how to contribute to this project.
@BeegiiK
Copy link
Contributor

BeegiiK commented Oct 18, 2024

@kastl-ars

Thank you for creating an issue. During my investigation, there's two things to mention:

  • The operator was always going to get deployed to kube-system. Now the daemonset can get deployed in any namepsace provided by the user.
  • The commands you provided needs to be updated. The --namespace option will get overrided if the namespace chart value exists (which in this case does) and that is why you'll never see it deployed elsewhere. You'll need to use the --set namespace=X option to override the value instead. I've tested this and it works!

@kastl-ars
Copy link
Author

Thanks for checking @BeegiiK.

If there is no technical reason to use the namespace value, I would recommend to remove it and use what most other charts are using: helm's --namespace argument...

@BeegiiK BeegiiK closed this as completed Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers scope/S Change is Small type/bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

4 participants