Skip to content
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

✨ Allow setting root directory to empty string to disable creation #3158

Merged
merged 1 commit into from
Aug 31, 2024

Conversation

embik
Copy link
Member

@embik embik commented Aug 30, 2024

Summary

--root-directory is an extremely handy flag when running kcp start locally, and the .kcp directory is filled with automatically generated certificates, kubeconfigs, etc.

When running kcp in Kubernetes (e.g. via the Helm chart), this is not needed because certificates are fed from the outside (generated by cert-manager) and kubeconfig generation is disabled. We set this in the Helm chart:

https://github.com/kcp-dev/helm-charts/blob/5e745b2cfbd7ad7cf926fd61b550d9c6c695265e/charts/kcp/templates/server-deployment.yaml#L135

This references an emptyDir volume we mount. The only reason we do that is because kcp fails to start if the root-directory doesn't exist and it cannot create it.

Thus, this PR eliminates the code path that was always trying to create the root directory. It should allow us to set --root-directory="" in the Helm chart and eliminate the emptyDir we've been using as a workaround to make the kcp binary happy.

Related issue(s)

Fixes #

Release Notes

Skip attempt to create root directory if `--root-directory=""` is set

Signed-off-by: Marvin Beckers <marvin@kubermatic.com>
@kcp-ci-bot kcp-ci-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. dco-signoff: yes Indicates the PR's author has signed the DCO. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 30, 2024
@embik embik changed the title ✨ Allow setting root directory ro empty string to disable creation ✨ Allow setting root directory to empty string to disable creation Aug 30, 2024
@sttts
Copy link
Member

sttts commented Aug 31, 2024

/lgtm
/approve

@kcp-ci-bot kcp-ci-bot added the lgtm Indicates that a PR is ready to be merged. label Aug 31, 2024
@kcp-ci-bot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 8c8a4b33ec8e9498cf9421dc09ad4bfdda5b5ad0

@kcp-ci-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sttts

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kcp-ci-bot kcp-ci-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 31, 2024
@kcp-ci-bot kcp-ci-bot merged commit 6598f89 into kcp-dev:main Aug 31, 2024
17 checks passed
@embik embik deleted the remove-root-dir-dependency branch September 1, 2024 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has signed the DCO. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants