-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Backport PVC Protection Feature Scheduler Changes #18110
Conversation
@jsafrane PTAL |
/test cmd |
/test unit |
flake: #17882 |
/test extended_conformance_install |
this was an alpha-level feature in kube 1.9. we typically do not enable features until they reach beta status |
The change in the scheduler is a bugfix because scheduler shouldn't schedule a pod that uses a PVC that is being deleted. Different people have a different point of view on the fact that a PVC can be deleted even though it's in active use by a pod. Some people view it as a security bug, however, upstream views it as a new feature. So the new feature is actually a bugfix. Because it's a security bug I've backported it here. And because of the backport I'm also backporting the change in the scheduler and enabling the possibility to switch on the PVC Protection feature. I know, this is unusual. |
It's only a security issue if you use the Recycle PV reclaim strategy to let pods reuse each the same PV, which has known issues and is not recommended. That doesn't seem a sufficient reason to backport an alpha feature |
@liggitt would you mind to split this discussion into two:
This PR consists of two commits that have different reasons: Adding policy for the PVC Protection controllerMy reasoning for this change is:
@liggitt please, do you agree with adding policy for the PVC Protection controller? Backporting changes in the schedulerMy reasoning for this change is: |
/test extended_conformance_install |
no, use the feature flag to enable the alpha feature if you want it, which automatically picks up the upstream role. In master-config.yaml: kubernetesMasterConfig:
...
apiServerArguments:
...
feature-gates:
- PVCProtection=true
...
controllerArguments:
feature-gates:
- PVCProtection=true
...
schedulerArguments:
feature-gates:
- PVCProtection=true $ oc get clusterroles.rbac/system:controller:pvc-protection-controller -o yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
annotations:
authorization.openshift.io/system-only: "true"
rbac.authorization.kubernetes.io/autoupdate: "true"
creationTimestamp: 2018-01-16T18:18:41Z
labels:
kubernetes.io/bootstrapping: rbac-defaults
name: system:controller:pvc-protection-controller
resourceVersion: "171"
selfLink: /apis/rbac.authorization.k8s.io/v1/clusterroles/system%3Acontroller%3Apvc-protection-controller
uid: ae45d5e0-fae9-11e7-bbad-acbc32c1ca87
rules:
- apiGroups:
- ""
resources:
- persistentvolumeclaims
verbs:
- get
- list
- update
- watch
- apiGroups:
- ""
resources:
- pods
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- events
verbs:
- create
- patch
- update
I'd like to see the cherry-pick to 1.9 proposed upstream first. I'm skeptical about picking things to old releases in support of alpha features. |
…leted PVC Protection feature consists of the below PRs: - kubernetes/kubernetes#55873 - kubernetes/kubernetes#55824 - kubernetes/kubernetes#55957 The PRs #55873 and #55824 were merged into K8s 1.9, however, the PR #55957 was merged into K8s 1.10. That's why this PR is backported. This commit modifies scheduler in such a way that it does not schedule a pod that uses a PVC that is being deleted.
9b671c7
to
eeb1dbb
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: pospispa Assign the PR to them by writing The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
@liggitt I didn't know that the upstream role is automatically picked up in case the alpha feature is enabled. Thank you for letting me know. So I deleted the commit that was "duplicating" the policy.
I prefer to firstly finish discussion about backporting the PVC Protection feature into a previous version of OpenShift in this PR and then continue the discussion here. |
just the scheduler pick makes more sense to me |
So @liggitt do you agree with the scheduler pick into OpenShift 3.9 that will make the PVC Protection alpha feature "complete" in OpenShift 3.9? I don't know whether you already reviewed the scheduler pick and if you have any comments. |
@liggitt @jsafrane we agreed not to backport PVC Protection into previous OpenShift version. So argument for backporting the scheduler changes because of a backport to previous OpenShift version is off the table. Let me think out loudly about pros for and cons against backporting the scheduler changes. Pros:
Cons:
I personally tend to not backporting. |
ok, let's not pick fixes that are not in upstream 1.9 |
Fixes bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1533081
Trello card: https://trello.com/c/cRyaIf5E/566-8-product-quality-prevent-pvc-deletion-if-pvc-in-use-by-a-pod
Backport of the K8s PR: kubernetes/kubernetes#55957
K8s documentation: kubernetes/website#6415