Skip to content

deploy: replace /var/lib/kubelet on-the-fly #286

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

Merged
merged 1 commit into from
May 11, 2021

Conversation

pohly
Copy link
Contributor

@pohly pohly commented May 5, 2021

What type of PR is this?
/kind feature

What this PR does / why we need it:

This is useful for clusters where kubelet is installed
differently. KinD cluster testing might be done with a non-default
location to recognize and cleanup loop devices that were set up by
the driver.

Which issue(s) this PR fixes:
Fixes #71

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

/var/lib/kubelet will be replaced on-the-fly by the deploy.sh scripts with the content of the KUBELET_DATA_DIR env variable.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels May 5, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pohly

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

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 5, 2021
@@ -187,7 +190,7 @@ echo "deploying with CSIStorageCapacity $csistoragecapacities_api: $have_csistor
echo "deploying hostpath components"
for i in $(ls ${BASE_DIR}/hostpath/*.yaml | sort); do
echo " $i"
modified="$(cat "$i" | while IFS= read -r line; do
modified="$(cat "$i" | sed -e "s;/var/lib/kubelet/;${KUBELET_DATA_DIR:-/var/lib/kubelet}/;" | while IFS= read -r line; do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably matter of style, would it be better to have somewhere on the top:

KUBELET_DATA_DIR=${KUBELET_DATA_DIR:-/var/lib/kubelet}

and then use $KUBELET_DATA_DIR without extra expansion, especially when part of a regexp here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that may be a bit more obvious. I'll change it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done and pushed.

@pohly pohly force-pushed the kubelet-data-dir branch from 0a4d695 to 88f8127 Compare May 10, 2021 14:12
This is useful for clusters where kubelet is installed
differently. KinD cluster testing might be done with a non-default
location to recognize and cleanup loop devices that were set up by
the driver.
@pohly pohly force-pushed the kubelet-data-dir branch from 88f8127 to 89ae426 Compare May 10, 2021 14:14
@jsafrane
Copy link
Contributor

/retest

@msau42
Copy link
Collaborator

msau42 commented May 10, 2021 via email

@pohly
Copy link
Contributor Author

pohly commented May 10, 2021

Longer term, I think it would be easier to maintain customization logic like this if we move to a templating tool like kustomize

I agree, but this is a significant change and some of the things we currently do in shell code (like taking parameters via env variables) will not be straight-forward. So unless we find someone with significant time at his hand I suspect we'll have to stick with what we have.

@jsafrane
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 11, 2021
@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented May 11, 2021

@pohly: The following tests failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
pull-kubernetes-csi-csi-driver-host-path-1-21-on-kubernetes-1-21 89ae426 link /test pull-kubernetes-csi-csi-driver-host-path-1-21-on-kubernetes-1-21
pull-kubernetes-csi-csi-driver-host-path-1-21-test-on-kubernetes-1-21 89ae426 link /test pull-kubernetes-csi-csi-driver-host-path-1-21-test-on-kubernetes-1-21

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@pohly
Copy link
Contributor Author

pohly commented May 11, 2021

/retest

@pohly pohly closed this May 11, 2021
@pohly pohly reopened this May 11, 2021
@k8s-ci-robot k8s-ci-robot merged commit 7a25259 into kubernetes-csi:master May 11, 2021
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", 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/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

hostpath.csi.k8s.io not found in the list of registered CSI drivers
4 participants