operator-framework / kubectl-operator

Manage Kubernetes Operators from the command line
https://operatorframework.io/
Apache License 2.0
128 stars 37 forks source link

The --namespace option does not have the expected effect #51

Closed kingdonb closed 3 years ago

kingdonb commented 3 years ago

In #50 I have reported that I tried to install the Flux operator with kubectl-operator, and I learned it includes some service accounts and some ClusterRoleBindings which should be associated with them.

The Flux operator sets operatorframework.io/preferred-namespace, but as #50 explains, kubectl-operator does not honor it today. However there is a -n or --namespace option which I assumed is meant to set the target namespace for the operator lifecycle manager to install the operator itself into.

kubectl operator install -n flux-system flux --create-operator-group
kingdonb commented 3 years ago

Apologies, I have just tried this again and it seems to work as expected. I thought I should report it anyway because we agreed I would, and thus someone was likely expecting it to show up in the issue queue, but I will close it now.

Perhaps the issue was a stray instance of the flux package that got absorbed somehow into my new installation attempt.

I ran

kubens operators
kubectl operator uninstall -X flux

followed by

kubectl operator install -n flux-system flux --create-operator-group
operatorgroup "flux-system" created
subscription "flux" created
operator "flux" installed; installed csv is "flux.v0.16.1"

and this time, worked exactly as expected:

flux-system   helm-controller-77fc6c74db-2clk5                                  1/1     Running     0          22s
flux-system   image-automation-controller-6744cf6f4c-pcwfn                      1/1     Running     0          22s
flux-system   image-reflector-controller-86989c7699-2dmrh                       1/1     Running     0          22s
flux-system   kustomize-controller-67c98f95df-42rsv                             1/1     Running     0          21s
flux-system   notification-controller-74789bddbc-vbhzb                          1/1     Running     0          21s
flux-system   source-controller-75c8c7759d-bbg5l                                1/1     Running     0          21s

I will go ahead and close this.