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

Explicitly set the PVC's storageClassName to default #51

Merged
merged 4 commits into from
Oct 16, 2023

Conversation

ialidzhikov
Copy link
Member

@ialidzhikov ialidzhikov commented Sep 27, 2023

How to categorize this PR?

/kind bug

What this PR does / why we need it:
In the registry-cache extension we deploy PVCs to the Shoot. We see cases where the PVC and StorageClass creation can be racy. In K8s < 1.26, when the default StorageClass is created after the PVC, the PVC hangs in Pending state with reason no persistent volumes available for this claim and no storage class is set. In K8s, there is a feature gate called RetroactiveDefaultStorageClass which makes possible the StorageClass from PVC to be set when the PVC is created before the StorageClass. See https://kubernetes.io/docs/concepts/storage/persistent-volumes/#retroactive-default-storageclass-assignment In the registry-cache extension we decided to hard-code the StorageClass name to default for time being. When it is ensured that RetroactiveDefaultStorageClass is enabled by default in the supported K8s versions, then we can drop this.

UPDATE: We need to explicitly set the spec.storageClassName to default as marking the Gardener managed StorageClass as the default one is configurable on provider extensions side. For example, for provider-aws see the storage.managedDefaultClass field in the ControlPlaneConfig (https://github.com/gardener/gardener-extension-provider-aws/blob/v1.48.0/docs/usage/usage.md#controlplaneconfig).

Which issue(s) this PR fixes:
Part of #3

Special notes for your reviewer:
The PR depends on gardener/gardener#8565 to make the e2e tests happy.

Release note:

NONE

@gardener-prow gardener-prow bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 27, 2023
@gardener-prow
Copy link
Contributor

gardener-prow bot commented Sep 27, 2023

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@gardener-prow gardener-prow bot added the kind/bug Bug label Sep 27, 2023
@gardener-prow gardener-prow bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Sep 27, 2023
@gardener-prow gardener-prow bot added cla: no Indicates the PR's author has not signed the cla-assistant.io CLA. cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. and removed cla: no Indicates the PR's author has not signed the cla-assistant.io CLA. labels Sep 27, 2023
@ialidzhikov ialidzhikov force-pushed the fix/storage-class-assignment branch from c07ed17 to 7b85be4 Compare September 27, 2023 09:57
@ialidzhikov ialidzhikov force-pushed the fix/storage-class-assignment branch from 7b85be4 to 40a6d73 Compare October 7, 2023 08:38
@gardener-prow gardener-prow bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Oct 7, 2023
@ialidzhikov ialidzhikov marked this pull request as ready for review October 7, 2023 08:43
@gardener-prow gardener-prow bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 7, 2023
@gardener-prow gardener-prow bot requested a review from rfranzke October 7, 2023 08:43
In the registry-cache extension we deploy PVCs to the Shoot. We see cases where the PVC and StorageClass creation can be racy. In K8s < 1.26, when the default StorageClass is created after the PVC, the PVC hangs in Pending state with reason `no persistent volumes available for this claim and no storage class is set`. In K8s, there is a feature gate called `RetroactiveDefaultStorageClass` which makes possible the StorageClass from PVC to be set when the PVC is created before the StorageClass. See https://kubernetes.io/docs/concepts/storage/persistent-volumes/#retroactive-default-storageclass-assignment
In the registry-cache extension we decided to hard-code the StorageClass name to `default` for time being. When it is ensured that `RetroactiveDefaultStorageClass` is enabled by default in the supported K8s versions, then we can drop this.
@ialidzhikov ialidzhikov force-pushed the fix/storage-class-assignment branch from db671de to 7b41748 Compare October 12, 2023 12:50
@ialidzhikov
Copy link
Member Author

/approve

@gardener-prow gardener-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 16, 2023
@ialidzhikov ialidzhikov force-pushed the fix/storage-class-assignment branch from 629740b to de70605 Compare October 16, 2023 06:29
Copy link
Contributor

@dimitar-kostadinov dimitar-kostadinov left a comment

Choose a reason for hiding this comment

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

/lgtm

@gardener-prow gardener-prow bot added the lgtm Indicates that a PR is ready to be merged. label Oct 16, 2023
@gardener-prow
Copy link
Contributor

gardener-prow bot commented Oct 16, 2023

LGTM label has been added.

Git tree hash: 81ff1d8557f1c79d508f87c1f508f37a52e3f86c

@gardener-prow
Copy link
Contributor

gardener-prow bot commented Oct 16, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dimitar-kostadinov, ialidzhikov

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:
  • OWNERS [dimitar-kostadinov,ialidzhikov]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@gardener-prow gardener-prow bot merged commit e98f4a6 into gardener:main Oct 16, 2023
1 check passed
@ialidzhikov ialidzhikov deleted the fix/storage-class-assignment branch October 16, 2023 07:17
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. cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. kind/bug Bug lgtm Indicates that a PR is ready to be merged. 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.

2 participants