-
Notifications
You must be signed in to change notification settings - Fork 20
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
Deploy to arbitrary namespace #176
Conversation
fd7a45c
to
07bda38
Compare
07bda38
to
da8d0e1
Compare
I tried doing this, and it seems to work okay. What kind of problems did you see? pushd config/default && $(KUSTOMIZE) edit set namespace $(DEPLOY_NAMESPACE) && popd |
Hmm. I end up with a diff like this:
|
Removing the commented blocks is a bit annoying but fine, but this part is troublesome:
|
I see. I hadn't noticed that. I think it's doing this because Still, I understand the concern. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This approach also works, if we want to avoid Kustomize altering our files.
I do prefer to do it this way than to have file contents edited upon deployment, although it isn't a big deal. I will add a commit shortly to update the README. |
This seems to be due to kubernetes-sigs/kubebuilder#1637, and will be fixed when we upgrade to a newer kube-rbac-proxy. |
Nice find. Looks like operator-sdk 1.5.x should clear it up for us: https://github.com/operator-framework/operator-sdk/releases/tag/v1.5.0 . |
This allows the user to (un)deploy the Operator to arbitrary namespaces, not only
container-jfr-operator-system
. This can be done like so:make DEPLOY_NAMESPACE=some_namespace deploy
(orundeploy
)Deployment to the current namespace would then look like
make DEPLOY_NAMESPACE=$(oc project -q) deploy
. I could also set the default value forDEPLOY_NAMESPACE
to the current namespace, but I thought it might be better to require this to be explicit.I tried to use the
config/default/kustomization.yaml
'snamespace
property for this purpose withkustomize
, but this ended up modifying the file in an unexpected way and changing it beyond simply replacing thenamespace
value. So I have simply used a pipedsed
here, which is similar to what we did before the1.x
migration. I leave the defaultcontainer-jfr-operator-system
namespace value intact however, rather than replacing it with something likeREPLACE_NAMESPACE
, so that the default value is something reasonable looking whenmake bundle
is run.This doesn't seem to work for the
default
namespace - I see an error that the operator pod cannot be started because it hasrunAsNonRoot
but will be run as root. It does deploy successfully in other namespaces, however. I'm looking into what the reason is here.Fixes #172