You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 0238231
Browse filesBrowse the repository at this point in the historyBrowse files
fix(linstor-scheduler): re-vendor to upstream 0.3.1 with native admission webhook (#3201)
## What this PR does
Re-vendors the `linstor-scheduler` chart from upstream **0.3.1**
(appVersion **v0.3.6**). Upstream now ships the admission webhook
natively (contributed via
[piraeusdatastore/helm-charts#94](piraeusdatastore/helm-charts#94)),
so the loose downstream admission templates — which round-tripped every
Pod through an old `k8s.io/api` and silently stripped fields they did
not know about, the `image` volume source and the native-sidecar
`restartPolicy` among them, breaking KubeVirt containerDisk VMs and
native sidecars cluster-wide — are dropped in favour of the upstream
copy.
- The admission webhook comes from the upstream chart now; the previous
downstream copy and its patch are removed. `make update` pulls 0.3.1 and
applies only `cozystack-scheduler-deployment.patch` (the scheduler pod
component label and the distro-suffix-stripped kube-scheduler image tag,
neither of which is upstream yet), so vendoring stays deterministic and
reproducible.
- The upstream admission Deployment keeps the same name but changes its
immutable pod selector, so an in-place upgrade of an existing install
would fail with `field is immutable`. Migration 52 deletes the old
admission Deployment before the upgrade so the new one is recreated
cleanly (`targetVersion` 52 → 53).
- appVersion v0.3.6 also carries the webhook's TLS certificate
hot-reload fix
([piraeusdatastore/linstor-scheduler-extender#22](piraeusdatastore/linstor-scheduler-extender#22)):
the webhook used to load its certificate once at startup, so after the
mounted Secret was rotated it kept serving a stale certificate and —
with `failurePolicy: Ignore` — silently stopped mutating until it was
restarted. It now reloads on rotation, so no external cert-reload
workaround is needed here.
- Wrapper values keep `replicaCount: 2`, now that the admission Pods
have their own PodDisruptionBudget and no longer share the scheduler's.
- Adds a helm-unittest suite covering the admission resources,
PodDisruptionBudget selector isolation, least-privilege RBAC, the TLS
provisioning modes and their rejection paths, the scheduler image-tag
strip, and backward compatibility with the webhook disabled.
Closes#3198.
### Screenshots
N/A — no UI changes.
### Downstream repositories
I walked the trigger map against the diff, file by file. It touches
`packages/system/linstor-scheduler/` and, under
`packages/core/platform/`, only migration 52 and the
`migrations.targetVersion` bump — an internal, release-managed counter,
not a user-facing `spec.components.platform.values.*` key documented on
the website. No trigger matches.
- [x] No downstream repository is affected by this change
- [ ] [cozystack/website](https://github.com/cozystack/website) -
follow-up:
- [ ]
[cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack)
- follow-up:
- [ ]
[cozystack/ansible-cozystack](https://github.com/cozystack/ansible-cozystack)
- follow-up:
- [ ] [cozystack/ccp](https://github.com/cozystack/ccp) - follow-up:
- [ ] [cozystack/talm](https://github.com/cozystack/talm) - follow-up:
- [ ] [cozystack/cozyhr](https://github.com/cozystack/cozyhr) -
follow-up:
- [ ] [cozystack/cozy-proxy](https://github.com/cozystack/cozy-proxy) -
follow-up:
- [ ]
[cozystack/cozystack-telemetry-server](https://github.com/cozystack/cozystack-telemetry-server)
- follow-up:
- [ ]
[cozystack/external-apps-example](https://github.com/cozystack/external-apps-example)
- follow-up:
- [ ] [cozystack/examples](https://github.com/cozystack/examples) -
follow-up:
### Release note
```release-note
fix(linstor-scheduler): the LINSTOR scheduler admission webhook no longer strips unknown Pod fields (the `image` volume source and native-sidecar `restartPolicy`), which had broken KubeVirt containerDisk VMs and native sidecars, and it now reloads its TLS certificate after rotation instead of silently failing. The chart is re-vendored from upstream 0.3.1; an automatic upgrade migration replaces the admission Deployment whose immutable selector changed.
```
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Expanded the optional Linstor Scheduler admission webhook with richer
configuration, including automated `schedulerName` mutation for LINSTOR
CSI-backed PVC Pods.
* **Improvements**
* Updated the Linstor Scheduler Helm chart to **0.3.1** (scheduler app
**v0.3.6**), including updated admission webhook behavior, safer
defaults, and **2 replicas**.
* Platform migrations now advance to **version 53**, with upgrade-safe
cleanup of the existing admission deployment.
* **Documentation**
* Updated Helm README and post-install notes with detailed guidance for
admission webhook and TLS modes.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Copy file name to clipboardExpand all lines: packages/system/linstor-scheduler/charts/linstor-scheduler/README.md
+26-1Lines changed: 26 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,4 +69,29 @@ The following options are available:
69
69
|`serviceAccount.create`| Create the service account resource |`true`|
70
70
|`serviceAccount.name`| Sets the name of the service account. If left empty, will use the release name as default |`""`|
71
71
|`podDisruptionBudget.enabled`| Enable creation of a pod disruption budget to protect the availability of the scheduler |`true`|
72
-
|`autoscaling.enabled`| Enable creation of a horizontal pod autoscaler to ensure availability in case of high usage` |`"false`|
72
+
|`autoscaling.enabled`| Enable creation of a horizontal pod autoscaler to ensure availability in case of high usage |`false`|
73
+
|`admission.enabled`| Deploy the admission webhook that auto-sets `schedulerName` on Pods using LINSTOR-backed PVCs. |`false`|
74
+
|`admission.replicaCount`| Number of webhook replicas to deploy. |`2`|
75
+
|`admission.driver`| CSI driver name treated as LINSTOR-backed. Pods whose PVCs resolve to it get the mutation. |`linstor.csi.linbit.com`|
76
+
|`admission.failurePolicy`| Webhook `failurePolicy`. `Ignore` keeps Pod creation working if the webhook is unavailable. |`Ignore`|
77
+
|`admission.timeoutSeconds`| Webhook call timeout. Kept under the Kubernetes default of 10s to limit Pod-creation latency. |`5`|
78
+
|`admission.namespaceSelector`| Namespace selector for the webhook. Empty selects all namespaces (including `kube-system`). |`{}`|
79
+
|`admission.resources`| Resources to request and limit on the webhook container. |`{}`|
80
+
|`admission.podSecurityContext`| Pod-level security context for the webhook pod. |`{runAsNonRoot: true, runAsUser: 1000, runAsGroup: 1000, fsGroup: 1000}`|
81
+
|`admission.securityContext`| Container-level security context for the webhook container. |`{allowPrivilegeEscalation: false, capabilities: {drop: [ALL]}, readOnlyRootFilesystem: true}`|
82
+
|`admission.createTLS`| How to provision the webhook TLS: `cert-manager`, `helm`, or `""` (bring your own). See note below. |`cert-manager`|
83
+
|`admission.tls.secretName`| Name of the TLS secret. Empty defaults to `<fullname>-admission-tls`. |`""`|
84
+
|`admission.tls.caBundle`| CA bundle (base64 PEM) injected into the webhook. Only used when `createTLS` is `""`. |`""`|
85
+
|`admission.tls.certManager.rotationPolicy`|`privateKey.rotationPolicy` of the cert-manager CA. `Never` keeps the CA key (and caBundle) stable. |`Never`|
86
+
|`admission.affinity`| Affinity for the webhook pods. Empty applies a soft anti-affinity spreading replicas across nodes. |`{}`|
87
+
|`admission.reloadOnCertChange`| Add Stakater Reloader annotations so the pods restart when the TLS secret changes (see note below). |`false`|
88
+
89
+
## Admission webhook (optional)
90
+
91
+
As noted above, the LINSTOR Scheduler itself is no longer maintained and `volumeBindingMode: WaitForFirstConsumer` is the preferred approach for new deployments. For clusters that still run this scheduler, the optional admission webhook (`admission.enabled`, disabled by default) removes the need to set `schedulerName` on every Pod: it watches Pod creation and, when a Pod uses a PersistentVolumeClaim backed by the LINSTOR CSI driver, sets `schedulerName` to this scheduler automatically. It changes nothing when disabled.
92
+
93
+
> **Note:**`admission.createTLS: helm` regenerates the CA and certificate on every `helm upgrade`; it suits one-shot installs, not GitOps or continuously-reconciled setups (Flux/Argo) where the certificate would churn on each reconcile. Use `cert-manager` or bring your own secret (`""`) there.
94
+
95
+
> **Note:** the default `failurePolicy: Ignore` fails open, so an unreachable webhook never blocks Pod creation (affected Pods just fall back to the default scheduler). Setting `failurePolicy: Fail` makes the webhook mandatory for every Pod `CREATE` in the selected namespaces; with `createTLS: cert-manager` this also requires the cert-manager CA injector to be running so the `caBundle` is populated, otherwise all matching Pod creation is blocked until injection completes. Because the empty default `namespaceSelector` also intercepts the webhook's own namespace and `kube-system`, running with `failurePolicy: Fail` can deadlock a restart of the webhook (its own new Pods cannot be admitted while all replicas are down) — exclude the release namespace and `kube-system` via `admission.namespaceSelector` if you switch to `Fail`.
96
+
97
+
> **Note:** the webhook binary loads its serving certificate once at startup and does not hot-reload it. When the certificate is renewed — cert-manager rotates the leaf roughly yearly, or you rotate an external secret — the running Pods keep serving the old certificate until they restart, after which the webhook silently stops mutating. Set `admission.reloadOnCertChange: true` (requires the Stakater Reloader controller) to roll the Deployment automatically when the secret changes, or restart the webhook Pods manually after each renewal. In `createTLS: helm` mode a `helm upgrade` regenerates the certificate and already rolls the Pods.
0 commit comments