-
Notifications
You must be signed in to change notification settings - Fork 56
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
Add helper image for generating static deploy yamls for the operator. #254
Conversation
Since we moved to multi-version devfile/api CRDs, the webhook server is a required component of the DevWorkspace Operator. Currently, the server is set up to not interfere with any default flows (e.g. local debugging) as it is a separate deployment. It has also been restricted to only apply when the restricted-access annotation is set. Signed-off-by: Angel Misevski <amisevsk@redhat.com>
Signed-off-by: Angel Misevski <amisevsk@redhat.com>
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: amisevsk The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
cc: @tolusha |
Are templates changed often? |
./update_devworkspace_crds.sh --init --api-version "$DEVWORKSPACE_API_VERSION" | ||
|
||
# Fill env in template files | ||
mv config/cert-manager/kustomization.yaml config/cert-manager/kustomization.yaml.bak |
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.
That seems to duplicate stuff we have in Makefile, which means we have more to maintain and test.
According to discussion with @tolusha, it would simplify things for chectl if it can just grab static files from devworkspace-operator repo (even if then it will modify some pieces, like namespace, possible operator image, ...).
After go vendoring we're not afraid of redundant ~16k lines )
So, it make me thinking what if:
- We have a script that generates static deploy files, according to the current env vars.
- We generate static deploy files with default values and keep them in the repo, PR checks that they are up to date.
- Makefile invokes the script from 1, but result is stored in another not commited place.
@amisevsk WDYT?
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.
Makes sense; my main concern is the levels of indirection (pkg/api -> CRDs -> deployable yamls) but that can be addressed with PR checks I suppose. I'll close this one and port the changes over to a new one that includes the full yamls.
Closing in favor of Serhii's suggestion. |
What does this PR do?
While trying to figure out a solution for eclipse-che/che#18842 since we removed static deployment yamls from the repo, I realized there's no easy way of generating the files directly and figured we would eventually need a way of generating static files that can be deployed directly to a cluster without relying on
make
for environment substitution and kustomize for applying overlays. (note: theenvsubst
step is currently required beforekustomize
, as the CRDs have fields whose descriptions contain env vars)I wrote a dockerfile that generates a tarball containing all yaml files required for deploying the operator, with the only requirement that the configmap is updated to have the correct routingSuffix on Kubernetes.
This commit also hard-codes the webhooks-enabled property to
true
, as webhooks have been required for quite some time.What issues does this PR fix or reference?
Potentially helpful for eclipse-che/che#18842
Is it tested? How?
Building the image:
Extracting yamls:
The file structure of the tarball is
where
combined.yaml
is a fat yaml of all the objects (~16k lines) anddeploy/platform/objects
contains each of the records incombined.yaml
named after the object they represent.I've pushed
quay.io/amisevsk/devworkspace-yaml:latest
for testing