-
Notifications
You must be signed in to change notification settings - Fork 353
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
Creates alternative kustomize installer for installation of the camel-k operator #2284
Conversation
359eb42
to
0aff166
Compare
@astefanutti |
@phantomjinx wow, that looks fantastic! I love how you addressed patching, Role (resp. RoleBinding) auto-promoting to ClusterRole (resp. ClusterRoleBinding), and that you fixed #2167 in the process 👍🏼. I'd like to test it locally to give you more feedback on the Kustomize directory structure, even if that looks great at first glance. But if you prefer, we can have this merged once CI is green, and iterate later on. Whatever option we choose, may I suggest to create a new GitHub Actions workflow called |
Thanks.... e2e tests still failing (oddly!) so will run back through those again. |
Yes GH Actions didn't seem to be very healthy. I've restarted the failing workflows 🤞🏼. |
GH Actions are experiencing an incident: https://www.githubstatus.com/incidents/m16jzl31gnqt. |
Hoepfully, the openshift failing test is just a one-off since it passed fine here -> https://github.com/phantomjinx/camel-k/actions/runs/853465524 |
Right, the failure seems unrelated. I've restarted it 🤞🏼. |
Already seeing conflicts on this so will need to rebase. However, am now adding e2e tests so I'll finish those before rebasing. |
f3016ea
to
2a00c28
Compare
Rebased and now includes e2e tests for kustomize. Currently included in kubernetes.yml action but could be spun out if so desired. |
All checks passed! :-) |
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.
I'd like to keep the config
directory structure as simple as possible, and as close to the Kustomize way as possible. It is important for developers that maintain the configuration, and for users relying on it. I find it a bit difficult with the current structure to understand the graph of resources (thinking how to use this without the Makefile can help).
Here are a few propositions that I have in mind:
- Merge the
manager
and theoperator
directories (maybe keepmanager
which is the Kustomize way) - "Revert" the
infrastructure
directory: move the SA back into themanager
directory, move the RBAC resources into the mainrbac
directory - Flatten the structure as much as possible: simplify the
rbac
directory, move patches into the same directory, rather than creating a dedicated directory.
I've been reviewing this "interruptibly", so I apologise if the review sounds inconsistent or even off 😅.
config/infrastructure/rbac/kubernetes/builder-role-binding-kubernetes.yaml
Outdated
Show resolved
Hide resolved
config/infrastructure/rbac/kubernetes/builder-role-kubernetes.yaml
Outdated
Show resolved
Hide resolved
Noted. Maybe an ancillary directory structure targetting install-type operations would be more transparent?
The
Discussed elsewhere but to summarize, these are operand resources that the operator should be installing rather than resources required to get the operator installed. These 2 concepts are fundamentally different and that division should be maintained, in my view.
I can certainly run with that philosophy for the main config directory. Anything that requires 'Makefile-magic' I can migrate to the 'install' directory instead.
Absolutely, not a problem. This is a longstanding issue with some rather knotty problems so happy to label this WIP and we'll keep returning to it, iteratively. |
b4c9939
to
404ca71
Compare
555ac9a
to
94419cc
Compare
94419cc
to
a26a36a
Compare
…flag * When Global flag is used, the cluster-role-openshift conflicts with the promoted role so renames it to cluster-role-console-openshift * Updates all source relating to new cluster-role name * Re-generated resources
* Builder service account and related roles are operand managed by the operator and so are resources rather than configuration/install time artifacts
a9b7691
to
36fe3be
Compare
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.
Would it be possible to merge the install
directory into the config
directory, at least for the manifests / patches, to follow Kustomize conventions, and to have it working with plain Kustomize / kubectl apply -k
.
I wonder, would you think ultimately something like curl https://github.com/apache/camel-k/releases/download/$VERSION/installer.tar.gz | tar xvz | kubectl apply -k -
would be possible? Maybe we could produce default YAMLs as part of the release, with default configurations for Kubernetes and OpenShift, to have like curl https://github.com/apache/camel-k/releases/download/$VERSION/openshift-install.yaml | kubectl apply -k -
.
Once we have the structure right, I think it'll be good to go, and we'll be able to iterate subsequently on the testing and think about how to replace kamel install
.
36fe3be
to
36f9796
Compare
I have migrated all the patches over to the config directory but I think we should go with your original suggestion of keeping the install directory separate so as to avoid confusion with the kustomize layout. The install directory can be used to "drive" the automation of the kustomize install.
I do not think this is possible at the moment. The biggest obstacle is that the namespace of the service-account listed in the bindings is by default 'placeholder'. Therefore, I use the Makefile to call sed to change this. If this were fixed in kustomize so that 'kustomize set namespace' updated it would be worth doing.
|
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.
I've just left a couple of small comments. We can have this merged then as an initial version, and iterate further based on usage feedback.
e36770b
to
ab70702
Compare
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.
Let's merge it once CI passes. Thanks a lot for the awesome work!
ab70702
to
edbce10
Compare
* script/platform-check.sh * cmd/util/platform-check * Determines the type of cluster user currently is accessing, namely openshift or kubernetes * vfs-gen * Adds extra filters for ignoring files that should not be in resources * config/... * Tidies up directory and resources * Moves openshift-only resources into a kustomize-handled directory of their own - easier to manage * Adds scorecard tests for use in bundle * Prometheus monitoring to bundle * This breaks installation of the operator via OLM due to attempts to apply PromethusRule fail with no CRD found for monitoring.coreos.com/v1 * True for e2e tests using kind but not on Openshift * Prometheus rules should be installed separately where users are sure the environment supports them * install/... * Adds kustomize installer provisioning * make example: installing example camel-k integration * make operator: installing camel-k operator * make platform: installing camel-k integration platform * make setup-cluster: installing cluster-wide CRD & RBAC resources only * make setup: installing RBAC resources & calls setup-cluster * Makefile provides sciptable auto-configuration of kustomize files * kustomize can be executed over directories manually * pkg/... * Fixes typo in schema_types.go - causes warning in bundle generation * Updates resources names and paths * script/Makefile * Originally, considered allowing overriding of IMAGE_NAME & VERSION but this 'loses' the default values which are required for the `kustomize set image ...` command. * Revert overriding of IMAGE_NAME & VERSION * Allows easy updating of ancillary tools versions & downloads them if not available * Adds CUSTOM_IMAGE & CUSTOM_VERSION that default to IMAGE_NAME & VERSION but can be overridden, whilst also preserving original values * PROJECT * Updates PROJECT to version 3 due to use of operator-sdk 1.5.0
* upgrade.yml * Remove operator-sdk step as taken cared of in Makefile * Updates build variables to use CUSTOM_IMAGE * Replaces kustomize patching of 'replaces' property with sed as the manifest is no longer included in the kustomize.yaml * e2e/... * Tests for kustomize install
* config/manager * permanent default patches for node-toleration, node-selector and resource requirements always applied in their default state * pull-policy, ports and watch-namespace patches avalailable to be applied if user wishes to manually add them * config/rbac * role promotion patches available to be applied if user wishes to manually add them * config/samples * integration platform patch always applied but empty so user can add additional properties * install * Moves all patches out of directory so while this may drive and automated install, it is possible to do a manual kustomize install using just the config directory # Conflicts: # pkg/resources/resources.go
* Role installed by operator so not applicable to the kustomize install
edbce10
to
15f97d0
Compare
Well done! Thanks. |
Congrats! It has been a long way :) |
Re-layout config directory to implement a declarative kustomize installer.
Release Note