Skip to content
This repository was archived by the owner on Oct 20, 2022. It is now read-only.

Support --namespace helm arg #182

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

StevenBarre
Copy link

Q A
Bug fix? no
New feature? yes
API breaks? nos
Deprecations? nos
Related tickets None
License Apache 2.0

What's in this PR?

Adds support for --namespace helm argument to specify which ns to create objects in.

Why?

When installing this chart, it would be nice to be able to specify --namespace somens and have the objects put in the right namespace instead of always relying on the kube client being pointing at the correct ns.

Additional context

I don't actually know much about helm or if this is the correct way to do this.

Checklist

  • Implementation tested
  • Error handling code meets the guideline
  • User guide and development docs updated (if needed)
  • Append changelog with changes

To Do

  • Someone smarter than me should test this

@mh013370
Copy link
Contributor

Helm will add those metadata properties for you when you specify the --namespace argument via the helm client. :)

This is also shown in the docs: https://orange-opensource.github.io/nifikop/docs/2_setup/1_getting_started#installing-with-helm

Do some resources not get created in the specified namespace?

@StevenBarre
Copy link
Author

Do some resources not get created in the specified namespace?

# helm template nifikop orange-incubator/nifikop \
    --version 0.7.5 \
    --set image.tag=v0.7.5-release \
    --include-crds \
    --set "namespaces={openshift-bcgov-nifi}" \
    --namespace openshift-bcgov-nifi \
    | grep 'namespace: '
  namespace: openshift-bcgov-nifi
  namespace: openshift-bcgov-nifi
  namespace: openshift-bcgov-nifi

Only the Role and RoleBinding are getting their namespace set, even with the --namespace arg set. The Deployment, and ServiceAccount are not.

@mh013370
Copy link
Contributor

Do some resources not get created in the specified namespace?

# helm template nifikop orange-incubator/nifikop \
    --version 0.7.5 \
    --set image.tag=v0.7.5-release \
    --include-crds \
    --set "namespaces={openshift-bcgov-nifi}" \
    --namespace openshift-bcgov-nifi \
    | grep 'namespace: '
  namespace: openshift-bcgov-nifi
  namespace: openshift-bcgov-nifi
  namespace: openshift-bcgov-nifi

Only the Role and RoleBinding are getting their namespace set, even with the --namespace arg set. The Deployment, and ServiceAccount are not.

Do some resources not get created in the specified namespace?

# helm template nifikop orange-incubator/nifikop \
    --version 0.7.5 \
    --set image.tag=v0.7.5-release \
    --include-crds \
    --set "namespaces={openshift-bcgov-nifi}" \
    --namespace openshift-bcgov-nifi \
    | grep 'namespace: '
  namespace: openshift-bcgov-nifi
  namespace: openshift-bcgov-nifi
  namespace: openshift-bcgov-nifi

Only the Role and RoleBinding are getting their namespace set, even with the --namespace arg set. The Deployment, and ServiceAccount are not.

That's interesting. One difference might be that I'm using ArgoCD to deploy nifikop (which just uses Helm) and I provide the namespace as an argument in the ArgoCD Application yaml. Perhaps ArgoCD adds a little more logic to ensure every resource is created in the specified namespace.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants