Add preview cluster-wide kubectl install for the operator - #46980
Conversation
fe6b86b to
894b776
Compare
|
I think this warrants its own issue. It is staking out a middle ground we haven't yet talked about for cluster-wide mode - that is optionally (and possibly as unsupported) via non-olm mode. Please create an issue for this and we'll link it under #43955 As you can glean there hasn't been commitment yet on whether we are going to expose the simple cluster-wide mode. If you want to see this simple cluster wide mode supported in general please add comments about that to #43955 as well. In part we're also waiting for results from #43954 |
|
Thanks, that makes sense. |
894b776 to
6560da5
Compare
|
I've made a couple of refinements to this pr. The first was to minimize the amount of duplication there is between our normal artifacts and what was in the new overlay. The second was to broaden how we are using kustomize - what was initially shown here was only valid if you were in the checked out operator directory after building the operator. This is because the kustomize file referenced the target directory as a resource. Instead what I think we need is to be able to install the operator like this:
Or (which defaults to keycloak-operator namespace instead)
Putting the operator into a different namespace can then be done with a kustomize file similar to what is in this pr for switching to the default namespace, or we can just leave the current instuctions for now If we have this in place, then we'll be able to change the docs for all the places we are currently referencing the operator installation: https://github.com/search?q=org%3Akeycloak%20keycloak-k8s-resources&type=code to be just @vmuzikar where is the job defined for adding resources to keycloak-k8s-resources? It would need to add the overlay directory moving forward. The final change was to remove the use of kustomize from within the test code. I believe a goal in the test logic was to not directly call out to kubectl if possible. @vmuzikar are you good with docs here that refer to this as an experimental feature that is only mentioned in the community docs? We can of course also address this in follow-ups under #49037 |
0bfe1e3 to
f0fa14d
Compare
Unreported flaky test detectedIf the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR. org.keycloak.testsuite.forms.BruteForceTest#testNoFailureResetForPermanentLockout |
f0fa14d to
fd78662
Compare
| [source,bash] | ||
| ---- | ||
| kubectl create namespace keycloak-operator | ||
| kubectl apply -k 'github.com/keycloak/keycloak-k8s-resources/overlays/cluster-wide?ref={version}' |
There was a problem hiding this comment.
Is this really referencing the correct repo? Shouldn't it be github.com/keycloak/keycloak/operator/overlays/cluster-wide?
There was a problem hiding this comment.
Is this really referencing the correct repo?
Yes, we'll need to update the job that is publishing to keycloak-k8s-resources - see #46980 (comment)
39693bd to
d02b8d6
Compare
d02b8d6 to
53636c1
Compare
|
@keycloak/cloud-native this should be complete. My underlying assumption here is that we want to keep the single namespace installation the default behavior. If that changes later (needs of the helm chart, or if we want the cluster-wide to be the default) we can revisit this. |
|
@vmuzikar updated to the Preview term again, and needed to remove trying to share the crds. It violates the security model of kustomize to make parent references to anything other that other kustomize directories - which we don't want to do in this case as that puts us back into making this an overlay. |
Signed-off-by: Marcel Sander <marcel.sander@actidoo.com>
Signed-off-by: Steve Hawkins <shawkins@redhat.com>
Signed-off-by: Steve Hawkins <shawkins@redhat.com>
Signed-off-by: Steve Hawkins <shawkins@redhat.com>
Signed-off-by: Steve Hawkins <shawkins@redhat.com>
Signed-off-by: Steven Hawkins <shawkins@redhat.com>
Signed-off-by: Steve Hawkins <shawkins@redhat.com>
approach Signed-off-by: Steve Hawkins <shawkins@redhat.com>
Signed-off-by: Steve Hawkins <shawkins@redhat.com>
Signed-off-by: Steve Hawkins <shawkins@redhat.com>
Signed-off-by: Steve Hawkins <shawkins@redhat.com>
Signed-off-by: Steve Hawkins <shawkins@redhat.com>
I am assuming that would happen in which ever PR goes in last - in particular the current all namespace kubectl instructions in the other PR will need to be updated, and it contains a release note with a general cluster-wide heading under which kubectl installs for community should be called out as well.
Added. |
28feeeb to
18c49c1
Compare
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Steven Hawkins <shawkins@redhat.com>
vmuzikar
left a comment
There was a problem hiding this comment.
I am assuming that would happen in which ever PR goes in last - in particular the current all namespace kubectl instructions in the other PR will need to be updated, and it contains a release note with a general cluster-wide heading under which kubectl installs for community should be called out as well.
Ok, let's merge this and let's create some final release notes in the other PR.
…6980) * Add experimental cluster-wide kubectl install support for the operator Signed-off-by: Marcel Sander <marcel.sander@actidoo.com> * standardizing the usage of kustomize and reducing artifact duplication Signed-off-by: Steve Hawkins <shawkins@redhat.com> * removing the process call to kustomize, and refining docs Signed-off-by: Steve Hawkins <shawkins@redhat.com> * running spotless Signed-off-by: Steve Hawkins <shawkins@redhat.com> * preventing both instances from having the same hostname Signed-off-by: Steve Hawkins <shawkins@redhat.com> * Apply suggestion from @shawkins Signed-off-by: Steven Hawkins <shawkins@redhat.com> * switching to dynamic detection of crds Signed-off-by: Steve Hawkins <shawkins@redhat.com> * switching to generating multiple installs rather than an overlay approach Signed-off-by: Steve Hawkins <shawkins@redhat.com> * addressing review comments and adding a ci test Signed-off-by: Steve Hawkins <shawkins@redhat.com> * removing the crd dedup Signed-off-by: Steve Hawkins <shawkins@redhat.com> * updating the other ci waiting for crd Signed-off-by: Steve Hawkins <shawkins@redhat.com> * adding an own namespace test Signed-off-by: Steve Hawkins <shawkins@redhat.com> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Steven Hawkins <shawkins@redhat.com> --------- Signed-off-by: Marcel Sander <marcel.sander@actidoo.com> Signed-off-by: Steve Hawkins <shawkins@redhat.com> Signed-off-by: Steven Hawkins <shawkins@redhat.com> Co-authored-by: Steve Hawkins <shawkins@redhat.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Description
Adjust the non-OLM installation path to allow installing the Operator cluster-wide by using
kubectl.Support for watching all namespaces was already added in #22821, but it remained undocumented. This PR adds a dedicated overlay for that installation mode, updates the documentation, and adds integration test coverage for it.
closes: #46981
Motivation
Related to #43955.
A single cluster-wide Operator avoids installing one Operator per namespace and provides a documented path for environments where this setup is preferred.
Notes
kubectlinstalls only