From 896552df5076fffc6ea3111858c351d309f291e1 Mon Sep 17 00:00:00 2001 From: "Jens W. Klein" Date: Tue, 21 Apr 2026 00:23:07 +0200 Subject: [PATCH 1/9] docs(plan): pod volumes + volumeClaimTemplates for SSD-backed storage (#43) --- ...19-pod-volumes-and-volumeclaimtemplates.md | 1027 +++++++++++++++++ 1 file changed, 1027 insertions(+) create mode 100644 docs/superpowers/plans/2026-04-19-pod-volumes-and-volumeclaimtemplates.md diff --git a/docs/superpowers/plans/2026-04-19-pod-volumes-and-volumeclaimtemplates.md b/docs/superpowers/plans/2026-04-19-pod-volumes-and-volumeclaimtemplates.md new file mode 100644 index 0000000..af0cfb6 --- /dev/null +++ b/docs/superpowers/plans/2026-04-19-pod-volumes-and-volumeclaimtemplates.md @@ -0,0 +1,1027 @@ +# Pod Volumes and VolumeClaimTemplates — Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** Let `VinylCache` users plumb their own `corev1.Volume`s, `corev1.VolumeMount`s, and `PersistentVolumeClaim` templates into the generated StatefulSet, so `spec.storage[].type=file` paths can land on user-provided PVCs (StorageClass-controlled SSD / NVMe) or on EmptyDir with `sizeLimit`, instead of the one hardcoded EmptyDir under `/var/lib/varnish`. + +**Architecture:** Three new optional fields on the CRD — `spec.pod.volumes`, `spec.pod.volumeMounts`, `spec.volumeClaimTemplates`. The controller appends them to the operator-managed defaults when building the StatefulSet. An admission webhook rejects collisions with reserved names (`agent-token`, `varnish-secret`, `varnish-workdir`, `varnish-tmp`, `bootstrap-vcl`) and reserved mount paths (`/run/vinyl`, `/etc/varnish/secret`, `/var/lib/varnish`, `/tmp`, `/etc/varnish/default.vcl`), rejects duplicate volume names across `pod.volumes` and `volumeClaimTemplates`, rejects unresolvable `pod.volumeMounts[].name`, and rejects `spec.storage[].path` values that would write into the operator-owned mounts. The existing `spec.storage[]` -s arg emission is unchanged — users choose the path, the operator trusts it. + +**Tech Stack:** Go (controller-runtime), Kubernetes corev1 API, kubebuilder, testify. + +**Scope:** single subsystem — pod-volume plumbing + its validation. Out of scope per the issue: multi-tier eviction, cache warming, snapshotting, stock-entrypoint `s0` collision (tracked separately in #44). + +--- + +## File Structure + +- [api/v1alpha1/vinylcache_types.go](api/v1alpha1/vinylcache_types.go) — new fields on `PodSpec` and `VinylCacheSpec`. +- [api/v1alpha1/zz_generated.deepcopy.go](api/v1alpha1/zz_generated.deepcopy.go) — regenerated. +- [config/crd/bases/vinyl.bluedynamics.eu_vinylcaches.yaml](config/crd/bases/vinyl.bluedynamics.eu_vinylcaches.yaml) — regenerated. +- [charts/cloud-vinyl/crds/vinylcache.yaml](charts/cloud-vinyl/crds/vinylcache.yaml) — synced from `config/crd/bases/` (manual copy; issue #34 tracks automating this). +- [internal/controller/statefulset.go](internal/controller/statefulset.go) — append user volumes, mounts, claim templates. +- [internal/controller/statefulset_test.go](internal/controller/statefulset_test.go) — new tests covering volume/mount/claim passthrough and interaction with reserved defaults. +- [internal/webhook/vinylcache_validator.go](internal/webhook/vinylcache_validator.go) — new validation rules. +- [internal/webhook/vinylcache_validator_test.go](internal/webhook/vinylcache_validator_test.go) — new test cases. +- Create: `e2e/fixtures/vinylcaches/ssd-backed-storage.yaml` — fixture for the new chainsaw test. +- Create: `e2e/tests/volumes-and-pvc/chainsaw-test.yaml` — E2E for the two scenarios. +- Create: `docs/sources/how-to/ssd-backed-storage.md` — user-facing how-to. +- Modify: `docs/sources/how-to/index.md` — add the new guide to the toctree. +- Modify: `docs/sources/reference/vinylcache-spec.md` — document the new fields. + +One file = one clear responsibility. No restructuring of existing code. + +--- + +### Task 1: CRD — add `PodSpec.Volumes`, `PodSpec.VolumeMounts`, `VinylCacheSpec.VolumeClaimTemplates` + +**Files:** +- Modify: `api/v1alpha1/vinylcache_types.go` + +- [ ] **Step 1: Add fields to `PodSpec`** + +In `api/v1alpha1/vinylcache_types.go`, extend the existing `PodSpec` struct (currently ending with `PriorityClass`). Add the two new fields at the end of the struct: + +```go + // volumes are additional pod-level volumes appended to the operator-managed + // defaults (agent-token, varnish-secret, varnish-workdir, varnish-tmp, + // bootstrap-vcl). Use to back spec.storage[].path with a PVC, an EmptyDir + // with sizeLimit, or any VolumeSource supported by Kubernetes. Reserved + // names collide with operator-managed volumes and are rejected by the + // admission webhook. Volume names must also be unique across volumes and + // volumeClaimTemplates. + // +optional + Volumes []corev1.Volume `json:"volumes,omitempty"` + + // volumeMounts are additional mounts appended to the varnish container. + // Each entry must reference a name present in spec.pod.volumes or + // spec.volumeClaimTemplates. Reserved mount paths (/run/vinyl, + // /etc/varnish/secret, /var/lib/varnish, /tmp, /etc/varnish/default.vcl) + // are rejected by the admission webhook. + // +optional + VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty"` +``` + +- [ ] **Step 2: Add `VolumeClaimTemplates` to `VinylCacheSpec`** + +In the same file, add to `VinylCacheSpec` — insert the field alphabetically between `VarnishParams` and `VCL` (or immediately above `Pod` if ordering by usage is preferred; pick whichever matches the file's existing ordering): + +```go + // volumeClaimTemplates are appended verbatim to the generated StatefulSet's + // spec.volumeClaimTemplates. Each template yields one PVC per replica + // (named --) that persists across pod restarts + // for that replica. Useful for per-replica SSD-backed file storage. + // Reference the claim name from spec.pod.volumeMounts; reference the + // resulting mountPath from spec.storage[].path. + // +optional + VolumeClaimTemplates []corev1.PersistentVolumeClaim `json:"volumeClaimTemplates,omitempty"` +``` + +- [ ] **Step 3: Regenerate deepcopy + CRD manifest** + +Run: + +```bash +make generate manifests +``` + +Expected: `api/v1alpha1/zz_generated.deepcopy.go` updates so `PodSpec.DeepCopyInto` copies `Volumes` and `VolumeMounts`, and `VinylCacheSpec.DeepCopyInto` copies `VolumeClaimTemplates`. `config/crd/bases/vinyl.bluedynamics.eu_vinylcaches.yaml` gains the three subschemas. If any unrelated CRDs (`_prometheusrules.yaml`, `_servicemonitors.yaml`) or RBAC files drift due to controller-gen version skew (observed in prior releases), revert them: + +```bash +git checkout -- config/crd/bases/_prometheusrules.yaml config/crd/bases/_servicemonitors.yaml config/rbac/role.yaml 2>/dev/null || true +``` + +- [ ] **Step 4: Sync the Helm-chart CRD copy** + +Until #34 automates this, copy the canonical CRD into the chart: + +```bash +cp config/crd/bases/vinyl.bluedynamics.eu_vinylcaches.yaml charts/cloud-vinyl/crds/vinylcache.yaml +``` + +- [ ] **Step 5: Verify build + commit** + +```bash +go build ./... +``` +Expected: no output, exit 0. + +```bash +git add api/v1alpha1/vinylcache_types.go api/v1alpha1/zz_generated.deepcopy.go config/crd/bases/vinyl.bluedynamics.eu_vinylcaches.yaml charts/cloud-vinyl/crds/vinylcache.yaml +git commit -m "feat(api): add spec.pod.{volumes,volumeMounts} + spec.volumeClaimTemplates + +Three new optional fields that let users back spec.storage[].path with +a PVC, a StorageClass-provisioned SSD, or an EmptyDir with sizeLimit +instead of the operator's fixed varnish-workdir EmptyDir. + +Generator + controller wiring land in follow-up commits; this change +only extends the type + regenerates manifests. + +Refs #43" +``` + +--- + +### Task 2: Controller — append user volumes / mounts / claim-templates to the StatefulSet + +**Files:** +- Modify: `internal/controller/statefulset.go` +- Modify: `internal/controller/statefulset_test.go` + +- [ ] **Step 1: Write failing tests** + +Append to `internal/controller/statefulset_test.go`: + +```go +func TestReconcileStatefulSet_UserVolumesAndMountsAppended(t *testing.T) { + sch := newScheme(t) + quantity := resource.MustParse("100Mi") + vc := &v1alpha1.VinylCache{ + ObjectMeta: metav1.ObjectMeta{Name: "my-cache", Namespace: "app"}, + Spec: v1alpha1.VinylCacheSpec{ + Replicas: 1, + Image: "varnish:7.6", + Backends: []v1alpha1.BackendSpec{{ + Name: "app", ServiceRef: v1alpha1.ServiceRef{Name: "svc"}, + }}, + Pod: v1alpha1.PodSpec{ + Volumes: []corev1.Volume{ + { + Name: "cache-ssd", + VolumeSource: corev1.VolumeSource{ + EmptyDir: &corev1.EmptyDirVolumeSource{ + SizeLimit: &quantity, + }, + }, + }, + }, + VolumeMounts: []corev1.VolumeMount{ + {Name: "cache-ssd", MountPath: "/var/lib/varnish-cache"}, + }, + }, + }, + } + cli := fake.NewClientBuilder().WithScheme(sch).Build() + r := &VinylCacheReconciler{Client: cli, Scheme: sch} + require.NoError(t, r.reconcileStatefulSet(context.Background(), vc)) + + ss := &appsv1.StatefulSet{} + require.NoError(t, cli.Get(context.Background(), + types.NamespacedName{Name: vc.Name, Namespace: vc.Namespace}, ss)) + + // User volume present in pod spec. + var foundVolume bool + for _, v := range ss.Spec.Template.Spec.Volumes { + if v.Name == "cache-ssd" { + foundVolume = true + require.NotNil(t, v.EmptyDir) + require.NotNil(t, v.EmptyDir.SizeLimit) + assert.Equal(t, "100Mi", v.EmptyDir.SizeLimit.String()) + } + } + assert.True(t, foundVolume, "user volume 'cache-ssd' must be appended to pod volumes") + + // User mount present on the varnish container. + var varnish *corev1.Container + for i := range ss.Spec.Template.Spec.Containers { + if ss.Spec.Template.Spec.Containers[i].Name == "varnish" { + varnish = &ss.Spec.Template.Spec.Containers[i] + } + } + require.NotNil(t, varnish) + var foundMount bool + for _, m := range varnish.VolumeMounts { + if m.Name == "cache-ssd" { + foundMount = true + assert.Equal(t, "/var/lib/varnish-cache", m.MountPath) + } + } + assert.True(t, foundMount, "user volumeMount must be appended to varnish container") + + // Reserved volumes still present. + reserved := []string{"agent-token", "varnish-secret", "varnish-workdir", "varnish-tmp", "bootstrap-vcl"} + for _, r := range reserved { + var found bool + for _, v := range ss.Spec.Template.Spec.Volumes { + if v.Name == r { + found = true + } + } + assert.True(t, found, "reserved volume %q must remain present", r) + } +} + +func TestReconcileStatefulSet_VolumeClaimTemplatesPassthrough(t *testing.T) { + sch := newScheme(t) + storageClass := "hcloud-volumes" + vc := &v1alpha1.VinylCache{ + ObjectMeta: metav1.ObjectMeta{Name: "my-cache", Namespace: "app"}, + Spec: v1alpha1.VinylCacheSpec{ + Replicas: 2, + Image: "varnish:7.6", + Backends: []v1alpha1.BackendSpec{{ + Name: "app", ServiceRef: v1alpha1.ServiceRef{Name: "svc"}, + }}, + VolumeClaimTemplates: []corev1.PersistentVolumeClaim{{ + ObjectMeta: metav1.ObjectMeta{Name: "cache-ssd"}, + Spec: corev1.PersistentVolumeClaimSpec{ + AccessModes: []corev1.PersistentVolumeAccessMode{corev1.ReadWriteOnce}, + StorageClassName: &storageClass, + Resources: corev1.VolumeResourceRequirements{ + Requests: corev1.ResourceList{ + corev1.ResourceStorage: resource.MustParse("80Gi"), + }, + }, + }, + }}, + Pod: v1alpha1.PodSpec{ + VolumeMounts: []corev1.VolumeMount{ + {Name: "cache-ssd", MountPath: "/var/lib/varnish-cache"}, + }, + }, + }, + } + cli := fake.NewClientBuilder().WithScheme(sch).Build() + r := &VinylCacheReconciler{Client: cli, Scheme: sch} + require.NoError(t, r.reconcileStatefulSet(context.Background(), vc)) + + ss := &appsv1.StatefulSet{} + require.NoError(t, cli.Get(context.Background(), + types.NamespacedName{Name: vc.Name, Namespace: vc.Namespace}, ss)) + + require.Len(t, ss.Spec.VolumeClaimTemplates, 1) + pvc := ss.Spec.VolumeClaimTemplates[0] + assert.Equal(t, "cache-ssd", pvc.Name) + require.NotNil(t, pvc.Spec.StorageClassName) + assert.Equal(t, "hcloud-volumes", *pvc.Spec.StorageClassName) + assert.Equal(t, "80Gi", pvc.Spec.Resources.Requests.Storage().String()) +} + +func TestReconcileStatefulSet_NoUserVolumes_DefaultsUnchanged(t *testing.T) { + sch := newScheme(t) + vc := &v1alpha1.VinylCache{ + ObjectMeta: metav1.ObjectMeta{Name: "my-cache", Namespace: "app"}, + Spec: v1alpha1.VinylCacheSpec{ + Replicas: 1, + Image: "varnish:7.6", + Backends: []v1alpha1.BackendSpec{{ + Name: "app", ServiceRef: v1alpha1.ServiceRef{Name: "svc"}, + }}, + }, + } + cli := fake.NewClientBuilder().WithScheme(sch).Build() + r := &VinylCacheReconciler{Client: cli, Scheme: sch} + require.NoError(t, r.reconcileStatefulSet(context.Background(), vc)) + + ss := &appsv1.StatefulSet{} + require.NoError(t, cli.Get(context.Background(), + types.NamespacedName{Name: vc.Name, Namespace: vc.Namespace}, ss)) + + assert.Empty(t, ss.Spec.VolumeClaimTemplates, + "no user claim templates -> VolumeClaimTemplates stays empty") + assert.Len(t, ss.Spec.Template.Spec.Volumes, 5, + "no user volumes -> only the 5 operator-managed volumes remain") +} +``` + +Add any missing imports (likely `"k8s.io/apimachinery/pkg/api/resource"` and `appsv1 "k8s.io/api/apps/v1"`). The `newScheme` helper is in `endpoints_test.go`; reuse it. + +- [ ] **Step 2: Run tests to confirm they fail** + +```bash +go test ./internal/controller/ -run TestReconcileStatefulSet_ -v -count=1 +``` + +Expected: `TestReconcileStatefulSet_UserVolumesAndMountsAppended` and `TestReconcileStatefulSet_VolumeClaimTemplatesPassthrough` FAIL (user volumes absent from output; claim templates absent). `TestReconcileStatefulSet_NoUserVolumes_DefaultsUnchanged` may PASS already. + +- [ ] **Step 3: Wire `PodSpec.Volumes` + `PodSpec.VolumeMounts` into the container build** + +Open `internal/controller/statefulset.go`. Locate the `varnishContainer` literal where `VolumeMounts` is set (currently lines ~85-111). + +Immediately **after** the `varnishContainer` variable is fully constructed (and **before** the proxy-protocol port append block), add: + +```go + // Append user-declared volume mounts to the varnish container. + if len(vc.Spec.Pod.VolumeMounts) > 0 { + varnishContainer.VolumeMounts = append(varnishContainer.VolumeMounts, vc.Spec.Pod.VolumeMounts...) + } +``` + +Find the `volumes := []corev1.Volume{ ... }` literal (currently lines ~188-229). Immediately **after** that block (and **before** the `uid := int64(65532)` line), add: + +```go + // Append user-declared pod volumes after the operator-managed defaults. + if len(vc.Spec.Pod.Volumes) > 0 { + volumes = append(volumes, vc.Spec.Pod.Volumes...) + } +``` + +- [ ] **Step 4: Wire `VolumeClaimTemplates` onto the StatefulSet spec** + +Locate the `StatefulSet` construction (search for `appsv1.StatefulSet{` or the `Spec.VolumeClaimTemplates` absence — the existing code never touches that field). Find the StatefulSet's `Spec:` block: + +```go + ss.Spec = appsv1.StatefulSetSpec{ + // ... existing fields: ServiceName, Replicas, Selector, Template, PodManagementPolicy ... + } +``` + +(The exact literal name and location depend on how the reconciler writes the spec — it uses `CreateOrUpdate`. Find the mutate function that sets `ss.Spec.Replicas`, `ss.Spec.Template`, etc. Add the claim templates alongside.) + +Add the following line right after the `ss.Spec.Template = ...` (or wherever the spec is assembled, alongside the other Spec fields): + +```go + ss.Spec.VolumeClaimTemplates = vc.Spec.VolumeClaimTemplates +``` + +If the spec is built via a struct literal rather than field-by-field assignment, add the field there instead. + +- [ ] **Step 5: Re-run tests — they must pass** + +```bash +go test ./internal/controller/ -run TestReconcileStatefulSet_ -v -count=1 +``` + +Expected: all three new tests PASS, plus any pre-existing StatefulSet tests still green. + +- [ ] **Step 6: Full package run** + +```bash +go test ./internal/controller/ -count=1 -timeout 3m +``` + +Expected: `ok github.com/bluedynamics/cloud-vinyl/internal/controller`. + +- [ ] **Step 7: Commit** + +```bash +git add internal/controller/statefulset.go internal/controller/statefulset_test.go +git commit -m "feat(controller): pass user volumes/mounts/claim-templates to StatefulSet + +spec.pod.volumes and spec.pod.volumeMounts are now appended to the +operator-managed defaults when building the varnish container. +spec.volumeClaimTemplates are passed verbatim onto the StatefulSet +spec. Reserved names / paths are still accepted here; the admission +webhook (next commit) enforces the constraints. + +Refs #43" +``` + +--- + +### Task 3: Webhook — reject reserved names, reserved mount paths, duplicates, and storage-path collisions + +**Files:** +- Modify: `internal/webhook/vinylcache_validator.go` +- Modify: `internal/webhook/vinylcache_validator_test.go` + +- [ ] **Step 1: Write failing tests** + +Append to `internal/webhook/vinylcache_validator_test.go`: + +```go +func TestValidate_PodVolumeName_ReservedIsRejected(t *testing.T) { + vc := validBaseVinylCache() + vc.Spec.Pod.Volumes = []corev1.Volume{{ + Name: "varnish-workdir", // reserved + VolumeSource: corev1.VolumeSource{EmptyDir: &corev1.EmptyDirVolumeSource{}}, + }} + _, err := webhook.ValidateVinylCache(vc) + require.Error(t, err) + assert.Contains(t, err.Error(), "varnish-workdir") + assert.Contains(t, err.Error(), "reserved") +} + +func TestValidate_VolumeClaimTemplateName_ReservedIsRejected(t *testing.T) { + vc := validBaseVinylCache() + vc.Spec.VolumeClaimTemplates = []corev1.PersistentVolumeClaim{{ + ObjectMeta: metav1.ObjectMeta{Name: "bootstrap-vcl"}, // reserved + }} + _, err := webhook.ValidateVinylCache(vc) + require.Error(t, err) + assert.Contains(t, err.Error(), "bootstrap-vcl") +} + +func TestValidate_VolumeNameDuplicate_AcrossVolumesAndClaims_Rejected(t *testing.T) { + vc := validBaseVinylCache() + vc.Spec.Pod.Volumes = []corev1.Volume{{ + Name: "cache-ssd", + VolumeSource: corev1.VolumeSource{EmptyDir: &corev1.EmptyDirVolumeSource{}}, + }} + vc.Spec.VolumeClaimTemplates = []corev1.PersistentVolumeClaim{{ + ObjectMeta: metav1.ObjectMeta{Name: "cache-ssd"}, + }} + _, err := webhook.ValidateVinylCache(vc) + require.Error(t, err) + assert.Contains(t, err.Error(), "cache-ssd") + assert.Contains(t, err.Error(), "duplicate") +} + +func TestValidate_VolumeMountPath_ReservedIsRejected(t *testing.T) { + vc := validBaseVinylCache() + vc.Spec.Pod.Volumes = []corev1.Volume{{ + Name: "my-ssd", + VolumeSource: corev1.VolumeSource{EmptyDir: &corev1.EmptyDirVolumeSource{}}, + }} + vc.Spec.Pod.VolumeMounts = []corev1.VolumeMount{ + {Name: "my-ssd", MountPath: "/var/lib/varnish"}, // reserved + } + _, err := webhook.ValidateVinylCache(vc) + require.Error(t, err) + assert.Contains(t, err.Error(), "/var/lib/varnish") +} + +func TestValidate_VolumeMountName_Unresolvable_Rejected(t *testing.T) { + vc := validBaseVinylCache() + vc.Spec.Pod.VolumeMounts = []corev1.VolumeMount{ + {Name: "nonexistent", MountPath: "/data"}, + } + _, err := webhook.ValidateVinylCache(vc) + require.Error(t, err) + assert.Contains(t, err.Error(), "nonexistent") + assert.Contains(t, err.Error(), "not declared") +} + +func TestValidate_StoragePath_UnderReservedMount_Rejected(t *testing.T) { + vc := validBaseVinylCache() + vc.Spec.Storage = []v1alpha1.StorageSpec{{ + Name: "disk", + Type: "file", + Path: "/var/lib/varnish/spill.bin", // under reserved /var/lib/varnish + Size: resource.MustParse("10Gi"), + }} + _, err := webhook.ValidateVinylCache(vc) + require.Error(t, err) + assert.Contains(t, err.Error(), "/var/lib/varnish") + assert.Contains(t, err.Error(), "storage") +} + +func TestValidate_StoragePath_UnderUserMount_Accepted(t *testing.T) { + vc := validBaseVinylCache() + vc.Spec.Pod.Volumes = []corev1.Volume{{ + Name: "cache-ssd", + VolumeSource: corev1.VolumeSource{EmptyDir: &corev1.EmptyDirVolumeSource{}}, + }} + vc.Spec.Pod.VolumeMounts = []corev1.VolumeMount{ + {Name: "cache-ssd", MountPath: "/var/lib/varnish-cache"}, + } + vc.Spec.Storage = []v1alpha1.StorageSpec{{ + Name: "disk", + Type: "file", + Path: "/var/lib/varnish-cache/spill.bin", + Size: resource.MustParse("10Gi"), + }} + _, err := webhook.ValidateVinylCache(vc) + require.NoError(t, err) +} +``` + +The existing test file likely does not have a `validBaseVinylCache()` helper. If the defaulter test file has `vcWithBackend()` or similar, reuse it. Otherwise, add at the top of the validator test file: + +```go +func validBaseVinylCache() *v1alpha1.VinylCache { + return &v1alpha1.VinylCache{ + ObjectMeta: metav1.ObjectMeta{Name: "vc", Namespace: "ns"}, + Spec: v1alpha1.VinylCacheSpec{ + Replicas: 1, + Image: "varnish:7.6", + Backends: []v1alpha1.BackendSpec{ + {Name: "app", ServiceRef: v1alpha1.ServiceRef{Name: "svc"}}, + }, + }, + } +} +``` + +Add required imports to the test file (`corev1`, `metav1`, `resource`). + +- [ ] **Step 2: Run tests to confirm they fail** + +```bash +go test ./internal/webhook/ -v -count=1 -run TestValidate_PodVolume\|TestValidate_VolumeClaim\|TestValidate_VolumeName\|TestValidate_VolumeMountPath\|TestValidate_VolumeMountName\|TestValidate_StoragePath +``` + +Expected: all 7 new tests FAIL (no validation logic exists yet). + +- [ ] **Step 3: Implement the validation** + +Open `internal/webhook/vinylcache_validator.go`. At the top of the file (below the existing `forbiddenStorageTypes` map), add: + +```go +// reservedVolumeNames collide with operator-managed volumes on every pod. +// Users cannot reuse these names in spec.pod.volumes or +// spec.volumeClaimTemplates. +var reservedVolumeNames = map[string]bool{ + "agent-token": true, + "varnish-secret": true, + "varnish-workdir": true, + "varnish-tmp": true, + "bootstrap-vcl": true, +} + +// reservedMountPaths are owned by the operator. spec.pod.volumeMounts +// must not mount into these, and spec.storage[].path must not place +// files under them. +var reservedMountPaths = []string{ + "/run/vinyl", + "/etc/varnish/secret", + "/etc/varnish/default.vcl", + "/var/lib/varnish", + "/tmp", +} + +// pathIsReserved reports whether p equals a reserved mount path or sits +// under one (with a trailing slash boundary to avoid false positives +// like "/var/lib/varnish-cache" hitting "/var/lib/varnish"). +func pathIsReserved(p string) bool { + for _, r := range reservedMountPaths { + if p == r { + return true + } + if strings.HasPrefix(p, r+"/") { + return true + } + } + return false +} +``` + +Then in `ValidateVinylCache`, after the existing `allowedSources` CIDR validation block (immediately before the `if len(errs) > 0` tail), insert: + +```go + // Collect all user-declared volume names (pod.volumes + volumeClaimTemplates). + declared := make(map[string]bool, len(vc.Spec.Pod.Volumes)+len(vc.Spec.VolumeClaimTemplates)) + + for _, v := range vc.Spec.Pod.Volumes { + if reservedVolumeNames[v.Name] { + errs = append(errs, fmt.Sprintf( + "spec.pod.volumes[%q]: name is reserved by the operator", v.Name)) + continue + } + if declared[v.Name] { + errs = append(errs, fmt.Sprintf( + "spec.pod.volumes[%q]: duplicate volume name", v.Name)) + continue + } + declared[v.Name] = true + } + + for _, c := range vc.Spec.VolumeClaimTemplates { + if reservedVolumeNames[c.Name] { + errs = append(errs, fmt.Sprintf( + "spec.volumeClaimTemplates[%q]: name is reserved by the operator", c.Name)) + continue + } + if declared[c.Name] { + errs = append(errs, fmt.Sprintf( + "spec.volumeClaimTemplates[%q]: duplicate — name already used in spec.pod.volumes or another claim template", c.Name)) + continue + } + declared[c.Name] = true + } + + // Validate mount paths + that each mount resolves to a declared volume. + for _, m := range vc.Spec.Pod.VolumeMounts { + if pathIsReserved(m.MountPath) { + errs = append(errs, fmt.Sprintf( + "spec.pod.volumeMounts[%q]: mountPath %q is reserved by the operator", + m.Name, m.MountPath)) + } + if !declared[m.Name] && !reservedVolumeNames[m.Name] { + errs = append(errs, fmt.Sprintf( + "spec.pod.volumeMounts[%q]: volume is not declared in spec.pod.volumes or spec.volumeClaimTemplates", + m.Name)) + } + } + + // Validate spec.storage[].path does not write into a reserved mount. + for _, s := range vc.Spec.Storage { + if s.Type == "file" && pathIsReserved(s.Path) { + errs = append(errs, fmt.Sprintf( + "spec.storage[%q].path %q is reserved by the operator; mount your own volume and place the cache file there", + s.Name, s.Path)) + } + } +``` + +- [ ] **Step 4: Re-run tests — they must pass** + +```bash +go test ./internal/webhook/ -count=1 -run TestValidate_PodVolume\|TestValidate_VolumeClaim\|TestValidate_VolumeName\|TestValidate_VolumeMountPath\|TestValidate_VolumeMountName\|TestValidate_StoragePath +``` + +Expected: 7/7 PASS. + +- [ ] **Step 5: Run full webhook package — no regressions** + +```bash +go test ./internal/webhook/ -count=1 +``` + +Expected: `ok github.com/bluedynamics/cloud-vinyl/internal/webhook`. + +- [ ] **Step 6: Commit** + +```bash +git add internal/webhook/vinylcache_validator.go internal/webhook/vinylcache_validator_test.go +git commit -m "feat(webhook): validate user volumes/mounts/claim-templates + +Reject: +- reserved volume names (agent-token, varnish-secret, varnish-workdir, + varnish-tmp, bootstrap-vcl) in spec.pod.volumes and + spec.volumeClaimTemplates. +- duplicate names across spec.pod.volumes and spec.volumeClaimTemplates. +- spec.pod.volumeMounts with reserved mount paths (/run/vinyl, + /etc/varnish/secret, /etc/varnish/default.vcl, /var/lib/varnish, /tmp) + or with a name that does not resolve to any declared volume. +- spec.storage[type=file].path that writes into a reserved operator mount. + +Refs #43" +``` + +--- + +### Task 4: E2E chainsaw test — PVC-backed file storage + +**Files:** +- Create: `e2e/fixtures/vinylcaches/ssd-backed-storage.yaml` +- Create: `e2e/tests/volumes-and-pvc/chainsaw-test.yaml` + +- [ ] **Step 1: Create the fixture** + +Write `e2e/fixtures/vinylcaches/ssd-backed-storage.yaml`: + +```yaml +apiVersion: vinyl.bluedynamics.eu/v1alpha1 +kind: VinylCache +metadata: + name: ssd-cache +spec: + replicas: 1 + image: varnish:7.6 + backends: + - name: app + port: 80 + serviceRef: + name: echo-backend + storage: + - name: disk + type: file + path: /var/lib/varnish-cache/spill.bin + size: 100Mi + pod: + volumes: + - name: cache-ssd + emptyDir: + sizeLimit: 200Mi + - name: another-vol + emptyDir: {} + volumeMounts: + - name: cache-ssd + mountPath: /var/lib/varnish-cache + - name: another-vol + mountPath: /var/cache/extra +``` + +(Using `emptyDir` rather than a real PVC for E2E because Kind may not have a StorageClass. The path-passthrough behaviour is identical.) + +- [ ] **Step 2: Create the chainsaw test** + +Write `e2e/tests/volumes-and-pvc/chainsaw-test.yaml`: + +```yaml +apiVersion: chainsaw.kyverno.io/v1alpha1 +kind: Test +metadata: + name: volumes-and-pvc +spec: + description: | + Verify spec.pod.volumes and spec.pod.volumeMounts are passed through + to the generated StatefulSet and the VinylCache reaches Ready phase + with a user-declared EmptyDir mounted under a path consumed by + spec.storage[].path. + timeouts: + apply: 10s + assert: 180s + delete: 60s + cleanup: 60s + exec: 30s + steps: + - name: deploy-backend + try: + - apply: + file: ../../fixtures/backends/echo-service.yaml + - assert: + resource: + apiVersion: apps/v1 + kind: Deployment + metadata: + name: echo-backend + status: + readyReplicas: 1 + + - name: deploy-cache-with-ssd-volume + try: + - apply: + file: ../../fixtures/vinylcaches/ssd-backed-storage.yaml + - assert: + resource: + apiVersion: vinyl.bluedynamics.eu/v1alpha1 + kind: VinylCache + metadata: + name: ssd-cache + status: + phase: Ready + + - name: verify-statefulset-has-user-volumes + try: + - assert: + resource: + apiVersion: apps/v1 + kind: StatefulSet + metadata: + name: ssd-cache + spec: + template: + spec: + (volumes[?name=='cache-ssd']): + - name: cache-ssd + emptyDir: + sizeLimit: 200Mi + (containers[?name=='varnish'].volumeMounts[?name=='cache-ssd']): + - - name: cache-ssd + mountPath: /var/lib/varnish-cache + + - name: cleanup + try: + - delete: + file: ../../fixtures/vinylcaches/ssd-backed-storage.yaml + - delete: + file: ../../fixtures/backends/echo-service.yaml +``` + +- [ ] **Step 3: Quick syntax lint** + +```bash +kubectl apply --dry-run=client --validate=false -f e2e/fixtures/vinylcaches/ssd-backed-storage.yaml +``` + +Expected: no syntax errors. (A full chainsaw run requires a Kind cluster; don't invoke it locally.) + +- [ ] **Step 4: Commit** + +```bash +git add e2e/fixtures/vinylcaches/ssd-backed-storage.yaml e2e/tests/volumes-and-pvc/chainsaw-test.yaml +git commit -m "test(e2e): exercise spec.pod.volumes + spec.storage interaction + +Creates a VinylCache with a user EmptyDir volume mounted at a path that +spec.storage[type=file].path writes into. Asserts the generated +StatefulSet contains the user volume + mount, and the VinylCache reaches +Ready phase under this configuration. + +Does not exercise volumeClaimTemplates (Kind has no default SSD +StorageClass in CI) — unit tests cover the passthrough. + +Refs #43" +``` + +--- + +### Task 5: Documentation — how-to + reference + +**Files:** +- Create: `docs/sources/how-to/ssd-backed-storage.md` +- Modify: `docs/sources/how-to/index.md` +- Modify: `docs/sources/reference/vinylcache-spec.md` + +- [ ] **Step 1: Create the how-to** + +Write `docs/sources/how-to/ssd-backed-storage.md`: + +````markdown +# Back spec.storage[].type=file with a user-provisioned volume + +By default, `spec.storage[].type=file` lands the cache spill file in the operator's `/var/lib/varnish` EmptyDir. That works for small working sets on nodes with SSD-backed ephemeral storage, but has limits: no persistence across pod restart, no `sizeLimit`, no choice of StorageClass, no isolation from node ephemeral use (logs, image layers). + +This guide shows how to back the spill file with (1) an EmptyDir with an explicit size limit, or (2) a StorageClass-provisioned PVC per pod. + +## Option 1 — EmptyDir with sizeLimit (simplest) + +Useful when you want to cap cache disk use and isolate it from node ephemeral capacity, without per-pod persistence. + +```yaml +apiVersion: vinyl.bluedynamics.eu/v1alpha1 +kind: VinylCache +metadata: + name: my-cache +spec: + replicas: 2 + image: varnish:7.6 + backends: + - name: app + serviceRef: + name: app-service + port: 8080 + storage: + - name: mem + type: malloc + size: 1Gi + - name: disk + type: file + path: /var/lib/varnish-cache/spill.bin + size: 50Gi + pod: + volumes: + - name: cache-scratch + emptyDir: + sizeLimit: 60Gi + volumeMounts: + - name: cache-scratch + mountPath: /var/lib/varnish-cache +``` + +The file lives on node ephemeral storage, but capped at 60 GiB regardless of how much the node has. + +## Option 2 — PVC per pod via `volumeClaimTemplates` + +Useful for persistence across pod restarts (faster warmup after a roll), or for isolating cache I/O onto a dedicated SSD StorageClass (`hcloud-volumes`, `gp3`, a CSI-driver-provisioned NVMe, etc.): + +```yaml +apiVersion: vinyl.bluedynamics.eu/v1alpha1 +kind: VinylCache +metadata: + name: my-cache +spec: + replicas: 2 + image: varnish:7.6 + backends: + - name: app + serviceRef: + name: app-service + port: 8080 + storage: + - name: mem + type: malloc + size: 1Gi + - name: disk + type: file + path: /var/lib/varnish-cache/spill.bin + size: 80Gi + volumeClaimTemplates: + - metadata: + name: cache-ssd + spec: + accessModes: [ReadWriteOnce] + storageClassName: hcloud-volumes + resources: + requests: + storage: 100Gi + pod: + volumeMounts: + - name: cache-ssd + mountPath: /var/lib/varnish-cache +``` + +The StatefulSet creates one PVC per replica — `cache-ssd-my-cache-0`, `cache-ssd-my-cache-1`, etc. They persist across pod deletion (StatefulSet semantics) so a rolling restart doesn't throw away the warmed cache. + +Make sure `spec.storage[].size` is well under the PVC size (Varnish needs filesystem overhead — allow ~20%). + +## Reserved names and paths + +These names cannot be used for your volumes (they collide with operator-managed volumes): + +- `agent-token`, `varnish-secret`, `varnish-workdir`, `varnish-tmp`, `bootstrap-vcl` + +These mount paths are reserved by the operator: + +- `/run/vinyl`, `/etc/varnish/secret`, `/etc/varnish/default.vcl`, `/var/lib/varnish`, `/tmp` + +`spec.storage[].path` cannot live under a reserved mount — you must declare your own `pod.volumeMounts` entry that covers the path. + +The admission webhook rejects violations with a clear message. +```` + +- [ ] **Step 2: Add the new page to the how-to index** + +In `docs/sources/how-to/index.md`, add `ssd-backed-storage` to the toctree (alphabetical if the file uses it, otherwise immediately after `create-cache`). + +- [ ] **Step 3: Extend the spec reference** + +In `docs/sources/reference/vinylcache-spec.md`, locate the `pod` section (it currently documents `annotations`, `labels`, `nodeSelector`, `tolerations`, `affinity`, `priorityClassName`). Append the two new fields: + +```markdown +| `volumes` | list | `[]` | Additional pod volumes appended to operator-managed defaults. Reserved names rejected by webhook. See [SSD-backed storage how-to](../how-to/ssd-backed-storage.md). | +| `volumeMounts` | list | `[]` | Additional mounts on the varnish container. Each `name` must reference a `spec.pod.volumes` entry or a `spec.volumeClaimTemplates` claim name. Reserved mount paths rejected by webhook. | +``` + +In the top-level spec table, add: + +```markdown +| `volumeClaimTemplates` | list | `[]` | StatefulSet-native per-replica PVC templates. Reference the claim `name` from `spec.pod.volumeMounts`. | +``` + +- [ ] **Step 4: Build the docs** + +```bash +cd docs && make docs +``` + +Expected: `build succeeded.` No Sphinx warnings. + +- [ ] **Step 5: Commit** + +```bash +git add docs/sources/how-to/ssd-backed-storage.md docs/sources/how-to/index.md docs/sources/reference/vinylcache-spec.md +git commit -m "docs: how-to for SSD-backed spec.storage via pod volumes / PVC + +New how-to covers EmptyDir-with-sizeLimit and StatefulSet +volumeClaimTemplates (per-pod PVC) as ways to back +spec.storage[type=file].path. Reference table gains entries for +spec.pod.volumes, spec.pod.volumeMounts, and spec.volumeClaimTemplates. + +Refs #43" +``` + +--- + +### Task 6: End-to-end verification + PR + +**Files:** none; commands only. + +- [ ] **Step 1: Full test suite** + +```bash +go test ./... -count=1 -timeout 5m +``` + +Expected: + +``` +ok github.com/bluedynamics/cloud-vinyl/internal/agent +ok github.com/bluedynamics/cloud-vinyl/internal/controller +ok github.com/bluedynamics/cloud-vinyl/internal/generator +ok github.com/bluedynamics/cloud-vinyl/internal/monitoring +ok github.com/bluedynamics/cloud-vinyl/internal/proxy +ok github.com/bluedynamics/cloud-vinyl/internal/webhook +ok github.com/bluedynamics/cloud-vinyl/internal/webhook/v1alpha1 +``` + +- [ ] **Step 2: Helm chart validation** + +```bash +helm lint charts/cloud-vinyl +helm unittest charts/cloud-vinyl +``` + +Expected: chart lints clean, unit tests pass. Confirms the Helm-chart CRD sync from Task 1 Step 4 didn't break anything. + +- [ ] **Step 3: Push branch and open PR** + +```bash +git push -u origin feat/pod-volumes-and-pvc +gh pr create --title "feat: spec.pod.volumes + spec.volumeClaimTemplates for SSD-backed storage (#43)" --body "$(cat <<'BODY' +## Summary + +Adds three optional CRD fields that let users back \`spec.storage[type=file].path\` with a user-provisioned volume instead of the fixed operator EmptyDir: + +- \`spec.pod.volumes []corev1.Volume\` — appended to operator-managed pod volumes. +- \`spec.pod.volumeMounts []corev1.VolumeMount\` — appended to the varnish container. +- \`spec.volumeClaimTemplates []corev1.PersistentVolumeClaim\` — passed verbatim onto the StatefulSet spec, so each replica gets its own PVC. + +## Validation + +Admission webhook rejects: +- Reserved volume names (\`agent-token\`, \`varnish-secret\`, \`varnish-workdir\`, \`varnish-tmp\`, \`bootstrap-vcl\`) in \`spec.pod.volumes\` or \`spec.volumeClaimTemplates\`. +- Duplicate names across \`spec.pod.volumes\` and \`spec.volumeClaimTemplates\`. +- \`spec.pod.volumeMounts\` entries with reserved paths or names that don't resolve to a declared volume. +- \`spec.storage[type=file].path\` pointing under a reserved operator mount (\`/var/lib/varnish\`, \`/tmp\`, \`/run/vinyl\`, \`/etc/varnish/*\`). + +## Tests + +- Unit (controller): volume/mount passthrough, PVC template passthrough, no-op path when user doesn't set any of the fields. +- Unit (webhook): 7 cases covering reserved names, reserved mount paths, duplicates, unresolvable mount refs, storage-path collisions (both rejection and the accept-when-covered path). +- E2E chainsaw: creates a VinylCache with a sized EmptyDir backing the spill path; verifies the StatefulSet has the user volume + mount and Phase reaches Ready. + +## Docs + +New how-to: \`docs/sources/how-to/ssd-backed-storage.md\` covers EmptyDir-with-sizeLimit and PVC-per-pod via \`volumeClaimTemplates\`. Spec reference gains entries for the three fields. + +## Out of scope + +- Multi-tier eviction, cache warming, snapshotting. +- Automating \`charts/cloud-vinyl/crds/vinylcache.yaml\` sync (tracked in #34). +- The \`s0\` storage-name collision with the stock image entrypoint (tracked in #44). + +Closes #43 + +🤖 Generated with [Claude Code](https://claude.com/claude-code) +BODY +)" +``` + +Expected: PR URL printed. + +--- + +## Release hook-in + +No version bump is cut here. After merge, bundle with other feature work under the next feature release (likely `v0.5.0`, since this adds new CRD surface — kubebuilder enum/defaults are not changed, so strictly additive; could also ship as `v0.4.3` if no other breaking-ish items queue up first). From 16687288a483c812f08e789dc9adc07b53712b5f Mon Sep 17 00:00:00 2001 From: "Jens W. Klein" Date: Tue, 21 Apr 2026 00:25:01 +0200 Subject: [PATCH 2/9] feat(api): add spec.pod.{volumes,volumeMounts} + spec.volumeClaimTemplates Three new optional fields that let users back spec.storage[].path with a PVC, a StorageClass-provisioned SSD, or an EmptyDir with sizeLimit instead of the operator's fixed varnish-workdir EmptyDir. Generator + controller wiring land in follow-up commits; this change only extends the type + regenerates manifests. Refs #43 --- api/v1alpha1/vinylcache_types.go | 27 + api/v1alpha1/zz_generated.deepcopy.go | 21 + charts/cloud-vinyl/crds/vinylcache.yaml | 2395 +++++++++++++++++ .../vinyl.bluedynamics.eu_vinylcaches.yaml | 2395 +++++++++++++++++ 4 files changed, 4838 insertions(+) diff --git a/api/v1alpha1/vinylcache_types.go b/api/v1alpha1/vinylcache_types.go index e455309..270a256 100644 --- a/api/v1alpha1/vinylcache_types.go +++ b/api/v1alpha1/vinylcache_types.go @@ -101,6 +101,15 @@ type VinylCacheSpec struct { // +optional Pod PodSpec `json:"pod,omitempty"` + // volumeClaimTemplates are appended verbatim to the generated StatefulSet's + // spec.volumeClaimTemplates. Each template yields one PVC per replica + // (named --) that persists across pod restarts + // for that replica. Useful for per-replica SSD-backed file storage. + // Reference the claim name from spec.pod.volumeMounts; reference the + // resulting mountPath from spec.storage[].path. + // +optional + VolumeClaimTemplates []corev1.PersistentVolumeClaim `json:"volumeClaimTemplates,omitempty"` + // monitoring configures Prometheus metrics and alerting rules. // +optional Monitoring MonitoringSpec `json:"monitoring,omitempty"` @@ -520,6 +529,24 @@ type PodSpec struct { // priorityClassName is the name of the PriorityClass for Varnish pods. // +optional PriorityClass string `json:"priorityClassName,omitempty"` + + // volumes are additional pod-level volumes appended to the operator-managed + // defaults (agent-token, varnish-secret, varnish-workdir, varnish-tmp, + // bootstrap-vcl). Use to back spec.storage[].path with a PVC, an EmptyDir + // with sizeLimit, or any VolumeSource supported by Kubernetes. Reserved + // names collide with operator-managed volumes and are rejected by the + // admission webhook. Volume names must also be unique across volumes and + // volumeClaimTemplates. + // +optional + Volumes []corev1.Volume `json:"volumes,omitempty"` + + // volumeMounts are additional mounts appended to the varnish container. + // Each entry must reference a name present in spec.pod.volumes or + // spec.volumeClaimTemplates. Reserved mount paths (/run/vinyl, + // /etc/varnish/secret, /var/lib/varnish, /tmp, /etc/varnish/default.vcl) + // are rejected by the admission webhook. + // +optional + VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty"` } // MonitoringSpec configures Prometheus monitoring for the Varnish cluster. diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index be5a1ae..c415245 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -345,6 +345,20 @@ func (in *PodSpec) DeepCopyInto(out *PodSpec) { *out = new(v1.Affinity) (*in).DeepCopyInto(*out) } + if in.Volumes != nil { + in, out := &in.Volumes, &out.Volumes + *out = make([]v1.Volume, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.VolumeMounts != nil { + in, out := &in.VolumeMounts, &out.VolumeMounts + *out = make([]v1.VolumeMount, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodSpec. @@ -636,6 +650,13 @@ func (in *VinylCacheSpec) DeepCopyInto(out *VinylCacheSpec) { out.Debounce = in.Debounce out.Retry = in.Retry in.Pod.DeepCopyInto(&out.Pod) + if in.VolumeClaimTemplates != nil { + in, out := &in.VolumeClaimTemplates, &out.VolumeClaimTemplates + *out = make([]v1.PersistentVolumeClaim, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } in.Monitoring.DeepCopyInto(&out.Monitoring) in.Resources.DeepCopyInto(&out.Resources) } diff --git a/charts/cloud-vinyl/crds/vinylcache.yaml b/charts/cloud-vinyl/crds/vinylcache.yaml index 0329b54..263a457 100644 --- a/charts/cloud-vinyl/crds/vinylcache.yaml +++ b/charts/cloud-vinyl/crds/vinylcache.yaml @@ -1408,6 +1408,1991 @@ spec: type: string type: object type: array + volumeMounts: + description: |- + volumeMounts are additional mounts appended to the varnish container. + Each entry must reference a name present in spec.pod.volumes or + spec.volumeClaimTemplates. Reserved mount paths (/run/vinyl, + /etc/varnish/secret, /var/lib/varnish, /tmp, /etc/varnish/default.vcl) + are rejected by the admission webhook. + items: + description: VolumeMount describes a mounting of a Volume within + a container. + properties: + mountPath: + description: |- + Path within the container at which the volume should be mounted. Must + not contain ':'. + type: string + mountPropagation: + description: |- + mountPropagation determines how mounts are propagated from the host + to container and the other way around. + When not set, MountPropagationNone is used. + This field is beta in 1.10. + When RecursiveReadOnly is set to IfPossible or to Enabled, MountPropagation must be None or unspecified + (which defaults to None). + type: string + name: + description: This must match the Name of a Volume. + type: string + readOnly: + description: |- + Mounted read-only if true, read-write otherwise (false or unspecified). + Defaults to false. + type: boolean + recursiveReadOnly: + description: |- + RecursiveReadOnly specifies whether read-only mounts should be handled + recursively. + + If ReadOnly is false, this field has no meaning and must be unspecified. + + If ReadOnly is true, and this field is set to Disabled, the mount is not made + recursively read-only. If this field is set to IfPossible, the mount is made + recursively read-only, if it is supported by the container runtime. If this + field is set to Enabled, the mount is made recursively read-only if it is + supported by the container runtime, otherwise the pod will not be started and + an error will be generated to indicate the reason. + + If this field is set to IfPossible or Enabled, MountPropagation must be set to + None (or be unspecified, which defaults to None). + + If this field is not specified, it is treated as an equivalent of Disabled. + type: string + subPath: + description: |- + Path within the volume from which the container's volume should be mounted. + Defaults to "" (volume's root). + type: string + subPathExpr: + description: |- + Expanded path within the volume from which the container's volume should be mounted. + Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. + Defaults to "" (volume's root). + SubPathExpr and SubPath are mutually exclusive. + type: string + required: + - mountPath + - name + type: object + type: array + volumes: + description: |- + volumes are additional pod-level volumes appended to the operator-managed + defaults (agent-token, varnish-secret, varnish-workdir, varnish-tmp, + bootstrap-vcl). Use to back spec.storage[].path with a PVC, an EmptyDir + with sizeLimit, or any VolumeSource supported by Kubernetes. Reserved + names collide with operator-managed volumes and are rejected by the + admission webhook. Volume names must also be unique across volumes and + volumeClaimTemplates. + items: + description: Volume represents a named volume in a pod that + may be accessed by any container in the pod. + properties: + awsElasticBlockStore: + description: |- + awsElasticBlockStore represents an AWS Disk resource that is attached to a + kubelet's host machine and then exposed to the pod. + Deprecated: AWSElasticBlockStore is deprecated. All operations for the in-tree + awsElasticBlockStore type are redirected to the ebs.csi.aws.com CSI driver. + More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore + properties: + fsType: + description: |- + fsType is the filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore + type: string + partition: + description: |- + partition is the partition in the volume that you want to mount. + If omitted, the default is to mount by volume name. + Examples: For volume /dev/sda1, you specify the partition as "1". + Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty). + format: int32 + type: integer + readOnly: + description: |- + readOnly value true will force the readOnly setting in VolumeMounts. + More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore + type: boolean + volumeID: + description: |- + volumeID is unique ID of the persistent disk resource in AWS (Amazon EBS volume). + More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore + type: string + required: + - volumeID + type: object + azureDisk: + description: |- + azureDisk represents an Azure Data Disk mount on the host and bind mount to the pod. + Deprecated: AzureDisk is deprecated. All operations for the in-tree azureDisk type + are redirected to the disk.csi.azure.com CSI driver. + properties: + cachingMode: + description: 'cachingMode is the Host Caching mode: + None, Read Only, Read Write.' + type: string + diskName: + description: diskName is the Name of the data disk in + the blob storage + type: string + diskURI: + description: diskURI is the URI of data disk in the + blob storage + type: string + fsType: + default: ext4 + description: |- + fsType is Filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + type: string + kind: + description: 'kind expected values are Shared: multiple + blob disks per storage account Dedicated: single + blob disk per storage account Managed: azure managed + data disk (only in managed availability set). defaults + to shared' + type: string + readOnly: + default: false + description: |- + readOnly Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + type: boolean + required: + - diskName + - diskURI + type: object + azureFile: + description: |- + azureFile represents an Azure File Service mount on the host and bind mount to the pod. + Deprecated: AzureFile is deprecated. All operations for the in-tree azureFile type + are redirected to the file.csi.azure.com CSI driver. + properties: + readOnly: + description: |- + readOnly defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + type: boolean + secretName: + description: secretName is the name of secret that + contains Azure Storage Account Name and Key + type: string + shareName: + description: shareName is the azure share Name + type: string + required: + - secretName + - shareName + type: object + cephfs: + description: |- + cephFS represents a Ceph FS mount on the host that shares a pod's lifetime. + Deprecated: CephFS is deprecated and the in-tree cephfs type is no longer supported. + properties: + monitors: + description: |- + monitors is Required: Monitors is a collection of Ceph monitors + More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it + items: + type: string + type: array + x-kubernetes-list-type: atomic + path: + description: 'path is Optional: Used as the mounted + root, rather than the full Ceph tree, default is /' + type: string + readOnly: + description: |- + readOnly is Optional: Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it + type: boolean + secretFile: + description: |- + secretFile is Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret + More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it + type: string + secretRef: + description: |- + secretRef is Optional: SecretRef is reference to the authentication secret for User, default is empty. + More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it + properties: + name: + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + type: object + x-kubernetes-map-type: atomic + user: + description: |- + user is optional: User is the rados user name, default is admin + More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it + type: string + required: + - monitors + type: object + cinder: + description: |- + cinder represents a cinder volume attached and mounted on kubelets host machine. + Deprecated: Cinder is deprecated. All operations for the in-tree cinder type + are redirected to the cinder.csi.openstack.org CSI driver. + More info: https://examples.k8s.io/mysql-cinder-pd/README.md + properties: + fsType: + description: |- + fsType is the filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + More info: https://examples.k8s.io/mysql-cinder-pd/README.md + type: string + readOnly: + description: |- + readOnly defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + More info: https://examples.k8s.io/mysql-cinder-pd/README.md + type: boolean + secretRef: + description: |- + secretRef is optional: points to a secret object containing parameters used to connect + to OpenStack. + properties: + name: + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + type: object + x-kubernetes-map-type: atomic + volumeID: + description: |- + volumeID used to identify the volume in cinder. + More info: https://examples.k8s.io/mysql-cinder-pd/README.md + type: string + required: + - volumeID + type: object + configMap: + description: configMap represents a configMap that should + populate this volume + properties: + defaultMode: + description: |- + defaultMode is optional: mode bits used to set permissions on created files by default. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. + format: int32 + type: integer + items: + description: |- + items if unspecified, each key-value pair in the Data field of the referenced + ConfigMap will be projected into the volume as a file whose name is the + key and content is the value. If specified, the listed keys will be + projected into the specified paths, and unlisted keys will not be + present. If a key is specified which is not present in the ConfigMap, + the volume setup will error unless it is marked optional. Paths must be + relative and may not contain the '..' path or start with '..'. + items: + description: Maps a string key to a path within a + volume. + properties: + key: + description: key is the key to project. + type: string + mode: + description: |- + mode is Optional: mode bits used to set permissions on this file. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + If not specified, the volume defaultMode will be used. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. + format: int32 + type: integer + path: + description: |- + path is the relative path of the file to map the key to. + May not be an absolute path. + May not contain the path element '..'. + May not start with the string '..'. + type: string + required: + - key + - path + type: object + type: array + x-kubernetes-list-type: atomic + name: + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + optional: + description: optional specify whether the ConfigMap + or its keys must be defined + type: boolean + type: object + x-kubernetes-map-type: atomic + csi: + description: csi (Container Storage Interface) represents + ephemeral storage that is handled by certain external + CSI drivers. + properties: + driver: + description: |- + driver is the name of the CSI driver that handles this volume. + Consult with your admin for the correct name as registered in the cluster. + type: string + fsType: + description: |- + fsType to mount. Ex. "ext4", "xfs", "ntfs". + If not provided, the empty value is passed to the associated CSI driver + which will determine the default filesystem to apply. + type: string + nodePublishSecretRef: + description: |- + nodePublishSecretRef is a reference to the secret object containing + sensitive information to pass to the CSI driver to complete the CSI + NodePublishVolume and NodeUnpublishVolume calls. + This field is optional, and may be empty if no secret is required. If the + secret object contains more than one secret, all secret references are passed. + properties: + name: + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + type: object + x-kubernetes-map-type: atomic + readOnly: + description: |- + readOnly specifies a read-only configuration for the volume. + Defaults to false (read/write). + type: boolean + volumeAttributes: + additionalProperties: + type: string + description: |- + volumeAttributes stores driver-specific properties that are passed to the CSI + driver. Consult your driver's documentation for supported values. + type: object + required: + - driver + type: object + downwardAPI: + description: downwardAPI represents downward API about the + pod that should populate this volume + properties: + defaultMode: + description: |- + Optional: mode bits to use on created files by default. Must be a + Optional: mode bits used to set permissions on created files by default. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. + format: int32 + type: integer + items: + description: Items is a list of downward API volume + file + items: + description: DownwardAPIVolumeFile represents information + to create the file containing the pod field + properties: + fieldRef: + description: 'Required: Selects a field of the + pod: only annotations, labels, name, namespace + and uid are supported.' + properties: + apiVersion: + description: Version of the schema the FieldPath + is written in terms of, defaults to "v1". + type: string + fieldPath: + description: Path of the field to select in + the specified API version. + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + mode: + description: |- + Optional: mode bits used to set permissions on this file, must be an octal value + between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + If not specified, the volume defaultMode will be used. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. + format: int32 + type: integer + path: + description: 'Required: Path is the relative + path name of the file to be created. Must not + be absolute or contain the ''..'' path. Must + be utf-8 encoded. The first item of the relative + path must not start with ''..''' + type: string + resourceFieldRef: + description: |- + Selects a resource of the container: only resources limits and requests + (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported. + properties: + containerName: + description: 'Container name: required for + volumes, optional for env vars' + type: string + divisor: + anyOf: + - type: integer + - type: string + description: Specifies the output format of + the exposed resources, defaults to "1" + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + description: 'Required: resource to select' + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + required: + - path + type: object + type: array + x-kubernetes-list-type: atomic + type: object + emptyDir: + description: |- + emptyDir represents a temporary directory that shares a pod's lifetime. + More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir + properties: + medium: + description: |- + medium represents what type of storage medium should back this directory. + The default is "" which means to use the node's default medium. + Must be an empty string (default) or Memory. + More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir + type: string + sizeLimit: + anyOf: + - type: integer + - type: string + description: |- + sizeLimit is the total amount of local storage required for this EmptyDir volume. + The size limit is also applicable for memory medium. + The maximum usage on memory medium EmptyDir would be the minimum value between + the SizeLimit specified here and the sum of memory limits of all containers in a pod. + The default is nil which means that the limit is undefined. + More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + ephemeral: + description: |- + ephemeral represents a volume that is handled by a cluster storage driver. + The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts, + and deleted when the pod is removed. + + Use this if: + a) the volume is only needed while the pod runs, + b) features of normal volumes like restoring from snapshot or capacity + tracking are needed, + c) the storage driver is specified through a storage class, and + d) the storage driver supports dynamic volume provisioning through + a PersistentVolumeClaim (see EphemeralVolumeSource for more + information on the connection between this volume type + and PersistentVolumeClaim). + + Use PersistentVolumeClaim or one of the vendor-specific + APIs for volumes that persist for longer than the lifecycle + of an individual pod. + + Use CSI for light-weight local ephemeral volumes if the CSI driver is meant to + be used that way - see the documentation of the driver for + more information. + + A pod can use both types of ephemeral volumes and + persistent volumes at the same time. + properties: + volumeClaimTemplate: + description: |- + Will be used to create a stand-alone PVC to provision the volume. + The pod in which this EphemeralVolumeSource is embedded will be the + owner of the PVC, i.e. the PVC will be deleted together with the + pod. The name of the PVC will be `-` where + `` is the name from the `PodSpec.Volumes` array + entry. Pod validation will reject the pod if the concatenated name + is not valid for a PVC (for example, too long). + + An existing PVC with that name that is not owned by the pod + will *not* be used for the pod to avoid using an unrelated + volume by mistake. Starting the pod is then blocked until + the unrelated PVC is removed. If such a pre-created PVC is + meant to be used by the pod, the PVC has to updated with an + owner reference to the pod once the pod exists. Normally + this should not be necessary, but it may be useful when + manually reconstructing a broken cluster. + + This field is read-only and no changes will be made by Kubernetes + to the PVC after it has been created. + + Required, must not be nil. + properties: + metadata: + description: |- + May contain labels and annotations that will be copied into the PVC + when creating it. No other fields are allowed and will be rejected during + validation. + type: object + spec: + description: |- + The specification for the PersistentVolumeClaim. The entire content is + copied unchanged into the PVC that gets created from this + template. The same fields as in a PersistentVolumeClaim + are also valid here. + properties: + accessModes: + description: |- + accessModes contains the desired access modes the volume should have. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1 + items: + type: string + type: array + x-kubernetes-list-type: atomic + dataSource: + description: |- + dataSource field can be used to specify either: + * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) + * An existing PVC (PersistentVolumeClaim) + If the provisioner or an external controller can support the specified data source, + it will create a new volume based on the contents of the specified data source. + When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef, + and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified. + If the namespace is specified, then dataSourceRef will not be copied to dataSource. + properties: + apiGroup: + description: |- + APIGroup is the group for the resource being referenced. + If APIGroup is not specified, the specified Kind must be in the core API group. + For any other third-party types, APIGroup is required. + type: string + kind: + description: Kind is the type of resource + being referenced + type: string + name: + description: Name is the name of resource + being referenced + type: string + required: + - kind + - name + type: object + x-kubernetes-map-type: atomic + dataSourceRef: + description: |- + dataSourceRef specifies the object from which to populate the volume with data, if a non-empty + volume is desired. This may be any object from a non-empty API group (non + core object) or a PersistentVolumeClaim object. + When this field is specified, volume binding will only succeed if the type of + the specified object matches some installed volume populator or dynamic + provisioner. + This field will replace the functionality of the dataSource field and as such + if both fields are non-empty, they must have the same value. For backwards + compatibility, when namespace isn't specified in dataSourceRef, + both fields (dataSource and dataSourceRef) will be set to the same + value automatically if one of them is empty and the other is non-empty. + When namespace is specified in dataSourceRef, + dataSource isn't set to the same value and must be empty. + There are three important differences between dataSource and dataSourceRef: + * While dataSource only allows two specific types of objects, dataSourceRef + allows any non-core object, as well as PersistentVolumeClaim objects. + * While dataSource ignores disallowed values (dropping them), dataSourceRef + preserves all values, and generates an error if a disallowed value is + specified. + * While dataSource only allows local objects, dataSourceRef allows objects + in any namespaces. + (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled. + (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled. + properties: + apiGroup: + description: |- + APIGroup is the group for the resource being referenced. + If APIGroup is not specified, the specified Kind must be in the core API group. + For any other third-party types, APIGroup is required. + type: string + kind: + description: Kind is the type of resource + being referenced + type: string + name: + description: Name is the name of resource + being referenced + type: string + namespace: + description: |- + Namespace is the namespace of resource being referenced + Note that when a namespace is specified, a gateway.networking.k8s.io/ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details. + (Alpha) This field requires the CrossNamespaceVolumeDataSource feature gate to be enabled. + type: string + required: + - kind + - name + type: object + resources: + description: |- + resources represents the minimum resources the volume should have. + Users are allowed to specify resource requirements + that are lower than previous value but must still be higher than capacity recorded in the + status field of the claim. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: |- + Limits describes the maximum amount of compute resources allowed. + More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: |- + Requests describes the minimum amount of compute resources required. + If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, + otherwise to an implementation-defined value. Requests cannot exceed Limits. + More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + type: object + type: object + selector: + description: selector is a label query over + volumes to consider for binding. + properties: + matchExpressions: + description: matchExpressions is a list + of label selector requirements. The requirements + are ANDed. + items: + description: |- + A label selector requirement is a selector that contains values, a key, and an operator that + relates the key and values. + properties: + key: + description: key is the label key + that the selector applies to. + type: string + operator: + description: |- + operator represents a key's relationship to a set of values. + Valid operators are In, NotIn, Exists and DoesNotExist. + type: string + values: + description: |- + values is an array of string values. If the operator is In or NotIn, + the values array must be non-empty. If the operator is Exists or DoesNotExist, + the values array must be empty. This array is replaced during a strategic + merge patch. + items: + type: string + type: array + x-kubernetes-list-type: atomic + required: + - key + - operator + type: object + type: array + x-kubernetes-list-type: atomic + matchLabels: + additionalProperties: + type: string + description: |- + matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, whose key field is "key", the + operator is "In", and the values array contains only "value". The requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + storageClassName: + description: |- + storageClassName is the name of the StorageClass required by the claim. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1 + type: string + volumeAttributesClassName: + description: |- + volumeAttributesClassName may be used to set the VolumeAttributesClass used by this claim. + If specified, the CSI driver will create or update the volume with the attributes defined + in the corresponding VolumeAttributesClass. This has a different purpose than storageClassName, + it can be changed after the claim is created. An empty string or nil value indicates that no + VolumeAttributesClass will be applied to the claim. If the claim enters an Infeasible error state, + this field can be reset to its previous value (including nil) to cancel the modification. + If the resource referred to by volumeAttributesClass does not exist, this PersistentVolumeClaim will be + set to a Pending state, as reflected by the modifyVolumeStatus field, until such as a resource + exists. + More info: https://kubernetes.io/docs/concepts/storage/volume-attributes-classes/ + type: string + volumeMode: + description: |- + volumeMode defines what type of volume is required by the claim. + Value of Filesystem is implied when not included in claim spec. + type: string + volumeName: + description: volumeName is the binding reference + to the PersistentVolume backing this claim. + type: string + type: object + required: + - spec + type: object + type: object + fc: + description: fc represents a Fibre Channel resource that + is attached to a kubelet's host machine and then exposed + to the pod. + properties: + fsType: + description: |- + fsType is the filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + type: string + lun: + description: 'lun is Optional: FC target lun number' + format: int32 + type: integer + readOnly: + description: |- + readOnly is Optional: Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + type: boolean + targetWWNs: + description: 'targetWWNs is Optional: FC target worldwide + names (WWNs)' + items: + type: string + type: array + x-kubernetes-list-type: atomic + wwids: + description: |- + wwids Optional: FC volume world wide identifiers (wwids) + Either wwids or combination of targetWWNs and lun must be set, but not both simultaneously. + items: + type: string + type: array + x-kubernetes-list-type: atomic + type: object + flexVolume: + description: |- + flexVolume represents a generic volume resource that is + provisioned/attached using an exec based plugin. + Deprecated: FlexVolume is deprecated. Consider using a CSIDriver instead. + properties: + driver: + description: driver is the name of the driver to use + for this volume. + type: string + fsType: + description: |- + fsType is the filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". The default filesystem depends on FlexVolume script. + type: string + options: + additionalProperties: + type: string + description: 'options is Optional: this field holds + extra command options if any.' + type: object + readOnly: + description: |- + readOnly is Optional: defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + type: boolean + secretRef: + description: |- + secretRef is Optional: secretRef is reference to the secret object containing + sensitive information to pass to the plugin scripts. This may be + empty if no secret object is specified. If the secret object + contains more than one secret, all secrets are passed to the plugin + scripts. + properties: + name: + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + type: object + x-kubernetes-map-type: atomic + required: + - driver + type: object + flocker: + description: |- + flocker represents a Flocker volume attached to a kubelet's host machine. This depends on the Flocker control service being running. + Deprecated: Flocker is deprecated and the in-tree flocker type is no longer supported. + properties: + datasetName: + description: |- + datasetName is Name of the dataset stored as metadata -> name on the dataset for Flocker + should be considered as deprecated + type: string + datasetUUID: + description: datasetUUID is the UUID of the dataset. + This is unique identifier of a Flocker dataset + type: string + type: object + gcePersistentDisk: + description: |- + gcePersistentDisk represents a GCE Disk resource that is attached to a + kubelet's host machine and then exposed to the pod. + Deprecated: GCEPersistentDisk is deprecated. All operations for the in-tree + gcePersistentDisk type are redirected to the pd.csi.storage.gke.io CSI driver. + More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk + properties: + fsType: + description: |- + fsType is filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk + type: string + partition: + description: |- + partition is the partition in the volume that you want to mount. + If omitted, the default is to mount by volume name. + Examples: For volume /dev/sda1, you specify the partition as "1". + Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty). + More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk + format: int32 + type: integer + pdName: + description: |- + pdName is unique name of the PD resource in GCE. Used to identify the disk in GCE. + More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk + type: string + readOnly: + description: |- + readOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk + type: boolean + required: + - pdName + type: object + gitRepo: + description: |- + gitRepo represents a git repository at a particular revision. + Deprecated: GitRepo is deprecated. To provision a container with a git repo, mount an + EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir + into the Pod's container. + properties: + directory: + description: |- + directory is the target directory name. + Must not contain or start with '..'. If '.' is supplied, the volume directory will be the + git repository. Otherwise, if specified, the volume will contain the git repository in + the subdirectory with the given name. + type: string + repository: + description: repository is the URL + type: string + revision: + description: revision is the commit hash for the specified + revision. + type: string + required: + - repository + type: object + glusterfs: + description: |- + glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime. + Deprecated: Glusterfs is deprecated and the in-tree glusterfs type is no longer supported. + properties: + endpoints: + description: endpoints is the endpoint name that details + Glusterfs topology. + type: string + path: + description: |- + path is the Glusterfs volume path. + More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod + type: string + readOnly: + description: |- + readOnly here will force the Glusterfs volume to be mounted with read-only permissions. + Defaults to false. + More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod + type: boolean + required: + - endpoints + - path + type: object + hostPath: + description: |- + hostPath represents a pre-existing file or directory on the host + machine that is directly exposed to the container. This is generally + used for system agents or other privileged things that are allowed + to see the host machine. Most containers will NOT need this. + More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath + properties: + path: + description: |- + path of the directory on the host. + If the path is a symlink, it will follow the link to the real path. + More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath + type: string + type: + description: |- + type for HostPath Volume + Defaults to "" + More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath + type: string + required: + - path + type: object + image: + description: |- + image represents an OCI object (a container image or artifact) pulled and mounted on the kubelet's host machine. + The volume is resolved at pod startup depending on which PullPolicy value is provided: + + - Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails. + - Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present. + - IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails. + + The volume gets re-resolved if the pod gets deleted and recreated, which means that new remote content will become available on pod recreation. + A failure to resolve or pull the image during pod startup will block containers from starting and may add significant latency. Failures will be retried using normal volume backoff and will be reported on the pod reason and message. + The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field. + The OCI object gets mounted in a single directory (spec.containers[*].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images. + The volume will be mounted read-only (ro) and non-executable files (noexec). + Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath) before 1.33. + The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type. + properties: + pullPolicy: + description: |- + Policy for pulling OCI objects. Possible values are: + Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails. + Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present. + IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails. + Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. + type: string + reference: + description: |- + Required: Image or artifact reference to be used. + Behaves in the same way as pod.spec.containers[*].image. + Pull secrets will be assembled in the same way as for the container image by looking up node credentials, SA image pull secrets, and pod spec image pull secrets. + More info: https://kubernetes.io/docs/concepts/containers/images + This field is optional to allow higher level config management to default or override + container images in workload controllers like Deployments and StatefulSets. + type: string + type: object + iscsi: + description: |- + iscsi represents an ISCSI Disk resource that is attached to a + kubelet's host machine and then exposed to the pod. + More info: https://kubernetes.io/docs/concepts/storage/volumes/#iscsi + properties: + chapAuthDiscovery: + description: chapAuthDiscovery defines whether support + iSCSI Discovery CHAP authentication + type: boolean + chapAuthSession: + description: chapAuthSession defines whether support + iSCSI Session CHAP authentication + type: boolean + fsType: + description: |- + fsType is the filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi + type: string + initiatorName: + description: |- + initiatorName is the custom iSCSI Initiator Name. + If initiatorName is specified with iscsiInterface simultaneously, new iSCSI interface + : will be created for the connection. + type: string + iqn: + description: iqn is the target iSCSI Qualified Name. + type: string + iscsiInterface: + default: default + description: |- + iscsiInterface is the interface Name that uses an iSCSI transport. + Defaults to 'default' (tcp). + type: string + lun: + description: lun represents iSCSI Target Lun number. + format: int32 + type: integer + portals: + description: |- + portals is the iSCSI Target Portal List. The portal is either an IP or ip_addr:port if the port + is other than default (typically TCP ports 860 and 3260). + items: + type: string + type: array + x-kubernetes-list-type: atomic + readOnly: + description: |- + readOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: boolean + secretRef: + description: secretRef is the CHAP Secret for iSCSI + target and initiator authentication + properties: + name: + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + type: object + x-kubernetes-map-type: atomic + targetPortal: + description: |- + targetPortal is iSCSI Target Portal. The Portal is either an IP or ip_addr:port if the port + is other than default (typically TCP ports 860 and 3260). + type: string + required: + - iqn + - lun + - targetPortal + type: object + name: + description: |- + name of the volume. + Must be a DNS_LABEL and unique within the pod. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + nfs: + description: |- + nfs represents an NFS mount on the host that shares a pod's lifetime + More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs + properties: + path: + description: |- + path that is exported by the NFS server. + More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs + type: string + readOnly: + description: |- + readOnly here will force the NFS export to be mounted with read-only permissions. + Defaults to false. + More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs + type: boolean + server: + description: |- + server is the hostname or IP address of the NFS server. + More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs + type: string + required: + - path + - server + type: object + persistentVolumeClaim: + description: |- + persistentVolumeClaimVolumeSource represents a reference to a + PersistentVolumeClaim in the same namespace. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims + properties: + claimName: + description: |- + claimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims + type: string + readOnly: + description: |- + readOnly Will force the ReadOnly setting in VolumeMounts. + Default false. + type: boolean + required: + - claimName + type: object + photonPersistentDisk: + description: |- + photonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine. + Deprecated: PhotonPersistentDisk is deprecated and the in-tree photonPersistentDisk type is no longer supported. + properties: + fsType: + description: |- + fsType is the filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + type: string + pdID: + description: pdID is the ID that identifies Photon Controller + persistent disk + type: string + required: + - pdID + type: object + portworxVolume: + description: |- + portworxVolume represents a portworx volume attached and mounted on kubelets host machine. + Deprecated: PortworxVolume is deprecated. All operations for the in-tree portworxVolume type + are redirected to the pxd.portworx.com CSI driver when the CSIMigrationPortworx feature-gate + is on. + properties: + fsType: + description: |- + fSType represents the filesystem type to mount + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs". Implicitly inferred to be "ext4" if unspecified. + type: string + readOnly: + description: |- + readOnly defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + type: boolean + volumeID: + description: volumeID uniquely identifies a Portworx + volume + type: string + required: + - volumeID + type: object + projected: + description: projected items for all in one resources secrets, + configmaps, and downward API + properties: + defaultMode: + description: |- + defaultMode are the mode bits used to set permissions on created files by default. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. + format: int32 + type: integer + sources: + description: |- + sources is the list of volume projections. Each entry in this list + handles one source. + items: + description: |- + Projection that may be projected along with other supported volume types. + Exactly one of these fields must be set. + properties: + clusterTrustBundle: + description: |- + ClusterTrustBundle allows a pod to access the `.spec.trustBundle` field + of ClusterTrustBundle objects in an auto-updating file. + + Alpha, gated by the ClusterTrustBundleProjection feature gate. + + ClusterTrustBundle objects can either be selected by name, or by the + combination of signer name and a label selector. + + Kubelet performs aggressive normalization of the PEM contents written + into the pod filesystem. Esoteric PEM features such as inter-block + comments and block headers are stripped. Certificates are deduplicated. + The ordering of certificates within the file is arbitrary, and Kubelet + may change the order over time. + properties: + labelSelector: + description: |- + Select all ClusterTrustBundles that match this label selector. Only has + effect if signerName is set. Mutually-exclusive with name. If unset, + interpreted as "match nothing". If set but empty, interpreted as "match + everything". + properties: + matchExpressions: + description: matchExpressions is a list + of label selector requirements. The + requirements are ANDed. + items: + description: |- + A label selector requirement is a selector that contains values, a key, and an operator that + relates the key and values. + properties: + key: + description: key is the label key + that the selector applies to. + type: string + operator: + description: |- + operator represents a key's relationship to a set of values. + Valid operators are In, NotIn, Exists and DoesNotExist. + type: string + values: + description: |- + values is an array of string values. If the operator is In or NotIn, + the values array must be non-empty. If the operator is Exists or DoesNotExist, + the values array must be empty. This array is replaced during a strategic + merge patch. + items: + type: string + type: array + x-kubernetes-list-type: atomic + required: + - key + - operator + type: object + type: array + x-kubernetes-list-type: atomic + matchLabels: + additionalProperties: + type: string + description: |- + matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, whose key field is "key", the + operator is "In", and the values array contains only "value". The requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + name: + description: |- + Select a single ClusterTrustBundle by object name. Mutually-exclusive + with signerName and labelSelector. + type: string + optional: + description: |- + If true, don't block pod startup if the referenced ClusterTrustBundle(s) + aren't available. If using name, then the named ClusterTrustBundle is + allowed not to exist. If using signerName, then the combination of + signerName and labelSelector is allowed to match zero + ClusterTrustBundles. + type: boolean + path: + description: Relative path from the volume + root to write the bundle. + type: string + signerName: + description: |- + Select all ClusterTrustBundles that match this signer name. + Mutually-exclusive with name. The contents of all selected + ClusterTrustBundles will be unified and deduplicated. + type: string + required: + - path + type: object + configMap: + description: configMap information about the configMap + data to project + properties: + items: + description: |- + items if unspecified, each key-value pair in the Data field of the referenced + ConfigMap will be projected into the volume as a file whose name is the + key and content is the value. If specified, the listed keys will be + projected into the specified paths, and unlisted keys will not be + present. If a key is specified which is not present in the ConfigMap, + the volume setup will error unless it is marked optional. Paths must be + relative and may not contain the '..' path or start with '..'. + items: + description: Maps a string key to a path + within a volume. + properties: + key: + description: key is the key to project. + type: string + mode: + description: |- + mode is Optional: mode bits used to set permissions on this file. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + If not specified, the volume defaultMode will be used. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. + format: int32 + type: integer + path: + description: |- + path is the relative path of the file to map the key to. + May not be an absolute path. + May not contain the path element '..'. + May not start with the string '..'. + type: string + required: + - key + - path + type: object + type: array + x-kubernetes-list-type: atomic + name: + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + optional: + description: optional specify whether the + ConfigMap or its keys must be defined + type: boolean + type: object + x-kubernetes-map-type: atomic + downwardAPI: + description: downwardAPI information about the + downwardAPI data to project + properties: + items: + description: Items is a list of DownwardAPIVolume + file + items: + description: DownwardAPIVolumeFile represents + information to create the file containing + the pod field + properties: + fieldRef: + description: 'Required: Selects a field + of the pod: only annotations, labels, + name, namespace and uid are supported.' + properties: + apiVersion: + description: Version of the schema + the FieldPath is written in terms + of, defaults to "v1". + type: string + fieldPath: + description: Path of the field to + select in the specified API version. + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + mode: + description: |- + Optional: mode bits used to set permissions on this file, must be an octal value + between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + If not specified, the volume defaultMode will be used. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. + format: int32 + type: integer + path: + description: 'Required: Path is the + relative path name of the file to + be created. Must not be absolute or + contain the ''..'' path. Must be utf-8 + encoded. The first item of the relative + path must not start with ''..''' + type: string + resourceFieldRef: + description: |- + Selects a resource of the container: only resources limits and requests + (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported. + properties: + containerName: + description: 'Container name: required + for volumes, optional for env + vars' + type: string + divisor: + anyOf: + - type: integer + - type: string + description: Specifies the output + format of the exposed resources, + defaults to "1" + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + description: 'Required: resource + to select' + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + required: + - path + type: object + type: array + x-kubernetes-list-type: atomic + type: object + podCertificate: + description: |- + Projects an auto-rotating credential bundle (private key and certificate + chain) that the pod can use either as a TLS client or server. + + Kubelet generates a private key and uses it to send a + PodCertificateRequest to the named signer. Once the signer approves the + request and issues a certificate chain, Kubelet writes the key and + certificate chain to the pod filesystem. The pod does not start until + certificates have been issued for each podCertificate projected volume + source in its spec. + + Kubelet will begin trying to rotate the certificate at the time indicated + by the signer using the PodCertificateRequest.Status.BeginRefreshAt + timestamp. + + Kubelet can write a single file, indicated by the credentialBundlePath + field, or separate files, indicated by the keyPath and + certificateChainPath fields. + + The credential bundle is a single file in PEM format. The first PEM + entry is the private key (in PKCS#8 format), and the remaining PEM + entries are the certificate chain issued by the signer (typically, + signers will return their certificate chain in leaf-to-root order). + + Prefer using the credential bundle format, since your application code + can read it atomically. If you use keyPath and certificateChainPath, + your application must make two separate file reads. If these coincide + with a certificate rotation, it is possible that the private key and leaf + certificate you read may not correspond to each other. Your application + will need to check for this condition, and re-read until they are + consistent. + + The named signer controls chooses the format of the certificate it + issues; consult the signer implementation's documentation to learn how to + use the certificates it issues. + properties: + certificateChainPath: + description: |- + Write the certificate chain at this path in the projected volume. + + Most applications should use credentialBundlePath. When using keyPath + and certificateChainPath, your application needs to check that the key + and leaf certificate are consistent, because it is possible to read the + files mid-rotation. + type: string + credentialBundlePath: + description: |- + Write the credential bundle at this path in the projected volume. + + The credential bundle is a single file that contains multiple PEM blocks. + The first PEM block is a PRIVATE KEY block, containing a PKCS#8 private + key. + + The remaining blocks are CERTIFICATE blocks, containing the issued + certificate chain from the signer (leaf and any intermediates). + + Using credentialBundlePath lets your Pod's application code make a single + atomic read that retrieves a consistent key and certificate chain. If you + project them to separate files, your application code will need to + additionally check that the leaf certificate was issued to the key. + type: string + keyPath: + description: |- + Write the key at this path in the projected volume. + + Most applications should use credentialBundlePath. When using keyPath + and certificateChainPath, your application needs to check that the key + and leaf certificate are consistent, because it is possible to read the + files mid-rotation. + type: string + keyType: + description: |- + The type of keypair Kubelet will generate for the pod. + + Valid values are "RSA3072", "RSA4096", "ECDSAP256", "ECDSAP384", + "ECDSAP521", and "ED25519". + type: string + maxExpirationSeconds: + description: |- + maxExpirationSeconds is the maximum lifetime permitted for the + certificate. + + Kubelet copies this value verbatim into the PodCertificateRequests it + generates for this projection. + + If omitted, kube-apiserver will set it to 86400(24 hours). kube-apiserver + will reject values shorter than 3600 (1 hour). The maximum allowable + value is 7862400 (91 days). + + The signer implementation is then free to issue a certificate with any + lifetime *shorter* than MaxExpirationSeconds, but no shorter than 3600 + seconds (1 hour). This constraint is enforced by kube-apiserver. + `kubernetes.io` signers will never issue certificates with a lifetime + longer than 24 hours. + format: int32 + type: integer + signerName: + description: Kubelet's generated CSRs will + be addressed to this signer. + type: string + userAnnotations: + additionalProperties: + type: string + description: |- + userAnnotations allow pod authors to pass additional information to + the signer implementation. Kubernetes does not restrict or validate this + metadata in any way. + + These values are copied verbatim into the `spec.unverifiedUserAnnotations` field of + the PodCertificateRequest objects that Kubelet creates. + + Entries are subject to the same validation as object metadata annotations, + with the addition that all keys must be domain-prefixed. No restrictions + are placed on values, except an overall size limitation on the entire field. + + Signers should document the keys and values they support. Signers should + deny requests that contain keys they do not recognize. + type: object + required: + - keyType + - signerName + type: object + secret: + description: secret information about the secret + data to project + properties: + items: + description: |- + items if unspecified, each key-value pair in the Data field of the referenced + Secret will be projected into the volume as a file whose name is the + key and content is the value. If specified, the listed keys will be + projected into the specified paths, and unlisted keys will not be + present. If a key is specified which is not present in the Secret, + the volume setup will error unless it is marked optional. Paths must be + relative and may not contain the '..' path or start with '..'. + items: + description: Maps a string key to a path + within a volume. + properties: + key: + description: key is the key to project. + type: string + mode: + description: |- + mode is Optional: mode bits used to set permissions on this file. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + If not specified, the volume defaultMode will be used. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. + format: int32 + type: integer + path: + description: |- + path is the relative path of the file to map the key to. + May not be an absolute path. + May not contain the path element '..'. + May not start with the string '..'. + type: string + required: + - key + - path + type: object + type: array + x-kubernetes-list-type: atomic + name: + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + optional: + description: optional field specify whether + the Secret or its key must be defined + type: boolean + type: object + x-kubernetes-map-type: atomic + serviceAccountToken: + description: serviceAccountToken is information + about the serviceAccountToken data to project + properties: + audience: + description: |- + audience is the intended audience of the token. A recipient of a token + must identify itself with an identifier specified in the audience of the + token, and otherwise should reject the token. The audience defaults to the + identifier of the apiserver. + type: string + expirationSeconds: + description: |- + expirationSeconds is the requested duration of validity of the service + account token. As the token approaches expiration, the kubelet volume + plugin will proactively rotate the service account token. The kubelet will + start trying to rotate the token if the token is older than 80 percent of + its time to live or if the token is older than 24 hours.Defaults to 1 hour + and must be at least 10 minutes. + format: int64 + type: integer + path: + description: |- + path is the path relative to the mount point of the file to project the + token into. + type: string + required: + - path + type: object + type: object + type: array + x-kubernetes-list-type: atomic + type: object + quobyte: + description: |- + quobyte represents a Quobyte mount on the host that shares a pod's lifetime. + Deprecated: Quobyte is deprecated and the in-tree quobyte type is no longer supported. + properties: + group: + description: |- + group to map volume access to + Default is no group + type: string + readOnly: + description: |- + readOnly here will force the Quobyte volume to be mounted with read-only permissions. + Defaults to false. + type: boolean + registry: + description: |- + registry represents a single or multiple Quobyte Registry services + specified as a string as host:port pair (multiple entries are separated with commas) + which acts as the central registry for volumes + type: string + tenant: + description: |- + tenant owning the given Quobyte volume in the Backend + Used with dynamically provisioned Quobyte volumes, value is set by the plugin + type: string + user: + description: |- + user to map volume access to + Defaults to serivceaccount user + type: string + volume: + description: volume is a string that references an already + created Quobyte volume by name. + type: string + required: + - registry + - volume + type: object + rbd: + description: |- + rbd represents a Rados Block Device mount on the host that shares a pod's lifetime. + Deprecated: RBD is deprecated and the in-tree rbd type is no longer supported. + properties: + fsType: + description: |- + fsType is the filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd + type: string + image: + description: |- + image is the rados image name. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it + type: string + keyring: + default: /etc/ceph/keyring + description: |- + keyring is the path to key ring for RBDUser. + Default is /etc/ceph/keyring. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it + type: string + monitors: + description: |- + monitors is a collection of Ceph monitors. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it + items: + type: string + type: array + x-kubernetes-list-type: atomic + pool: + default: rbd + description: |- + pool is the rados pool name. + Default is rbd. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it + type: string + readOnly: + description: |- + readOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it + type: boolean + secretRef: + description: |- + secretRef is name of the authentication secret for RBDUser. If provided + overrides keyring. + Default is nil. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it + properties: + name: + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + type: object + x-kubernetes-map-type: atomic + user: + default: admin + description: |- + user is the rados user name. + Default is admin. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it + type: string + required: + - image + - monitors + type: object + scaleIO: + description: |- + scaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes. + Deprecated: ScaleIO is deprecated and the in-tree scaleIO type is no longer supported. + properties: + fsType: + default: xfs + description: |- + fsType is the filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". + Default is "xfs". + type: string + gateway: + description: gateway is the host address of the ScaleIO + API Gateway. + type: string + protectionDomain: + description: protectionDomain is the name of the ScaleIO + Protection Domain for the configured storage. + type: string + readOnly: + description: |- + readOnly Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + type: boolean + secretRef: + description: |- + secretRef references to the secret for ScaleIO user and other + sensitive information. If this is not provided, Login operation will fail. + properties: + name: + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + type: object + x-kubernetes-map-type: atomic + sslEnabled: + description: sslEnabled Flag enable/disable SSL communication + with Gateway, default false + type: boolean + storageMode: + default: ThinProvisioned + description: |- + storageMode indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned. + Default is ThinProvisioned. + type: string + storagePool: + description: storagePool is the ScaleIO Storage Pool + associated with the protection domain. + type: string + system: + description: system is the name of the storage system + as configured in ScaleIO. + type: string + volumeName: + description: |- + volumeName is the name of a volume already created in the ScaleIO system + that is associated with this volume source. + type: string + required: + - gateway + - secretRef + - system + type: object + secret: + description: |- + secret represents a secret that should populate this volume. + More info: https://kubernetes.io/docs/concepts/storage/volumes#secret + properties: + defaultMode: + description: |- + defaultMode is Optional: mode bits used to set permissions on created files by default. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values + for mode bits. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. + format: int32 + type: integer + items: + description: |- + items If unspecified, each key-value pair in the Data field of the referenced + Secret will be projected into the volume as a file whose name is the + key and content is the value. If specified, the listed keys will be + projected into the specified paths, and unlisted keys will not be + present. If a key is specified which is not present in the Secret, + the volume setup will error unless it is marked optional. Paths must be + relative and may not contain the '..' path or start with '..'. + items: + description: Maps a string key to a path within a + volume. + properties: + key: + description: key is the key to project. + type: string + mode: + description: |- + mode is Optional: mode bits used to set permissions on this file. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + If not specified, the volume defaultMode will be used. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. + format: int32 + type: integer + path: + description: |- + path is the relative path of the file to map the key to. + May not be an absolute path. + May not contain the path element '..'. + May not start with the string '..'. + type: string + required: + - key + - path + type: object + type: array + x-kubernetes-list-type: atomic + optional: + description: optional field specify whether the Secret + or its keys must be defined + type: boolean + secretName: + description: |- + secretName is the name of the secret in the pod's namespace to use. + More info: https://kubernetes.io/docs/concepts/storage/volumes#secret + type: string + type: object + storageos: + description: |- + storageOS represents a StorageOS volume attached and mounted on Kubernetes nodes. + Deprecated: StorageOS is deprecated and the in-tree storageos type is no longer supported. + properties: + fsType: + description: |- + fsType is the filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + type: string + readOnly: + description: |- + readOnly defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + type: boolean + secretRef: + description: |- + secretRef specifies the secret to use for obtaining the StorageOS API + credentials. If not specified, default values will be attempted. + properties: + name: + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + type: object + x-kubernetes-map-type: atomic + volumeName: + description: |- + volumeName is the human-readable name of the StorageOS volume. Volume + names are only unique within a namespace. + type: string + volumeNamespace: + description: |- + volumeNamespace specifies the scope of the volume within StorageOS. If no + namespace is specified then the Pod's namespace will be used. This allows the + Kubernetes name scoping to be mirrored within StorageOS for tighter integration. + Set VolumeName to any name to override the default behaviour. + Set to "default" if you are not using namespaces within StorageOS. + Namespaces that do not pre-exist within StorageOS will be created. + type: string + type: object + vsphereVolume: + description: |- + vsphereVolume represents a vSphere volume attached and mounted on kubelets host machine. + Deprecated: VsphereVolume is deprecated. All operations for the in-tree vsphereVolume type + are redirected to the csi.vsphere.vmware.com CSI driver. + properties: + fsType: + description: |- + fsType is filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + type: string + storagePolicyID: + description: storagePolicyID is the storage Policy Based + Management (SPBM) profile ID associated with the StoragePolicyName. + type: string + storagePolicyName: + description: storagePolicyName is the storage Policy + Based Management (SPBM) profile name. + type: string + volumePath: + description: volumePath is the path that identifies + vSphere volume vmdk + type: string + required: + - volumePath + type: object + required: + - name + type: object + type: array type: object proxyProtocol: description: proxyProtocol enables PROXY protocol on a dedicated port @@ -1635,6 +3620,416 @@ spec: type: string type: object type: object + volumeClaimTemplates: + description: |- + volumeClaimTemplates are appended verbatim to the generated StatefulSet's + spec.volumeClaimTemplates. Each template yields one PVC per replica + (named --) that persists across pod restarts + for that replica. Useful for per-replica SSD-backed file storage. + Reference the claim name from spec.pod.volumeMounts; reference the + resulting mountPath from spec.storage[].path. + items: + description: PersistentVolumeClaim is a user's request for and claim + to a persistent volume + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + description: |- + Standard object's metadata. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + type: object + spec: + description: |- + spec defines the desired characteristics of a volume requested by a pod author. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims + properties: + accessModes: + description: |- + accessModes contains the desired access modes the volume should have. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1 + items: + type: string + type: array + x-kubernetes-list-type: atomic + dataSource: + description: |- + dataSource field can be used to specify either: + * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) + * An existing PVC (PersistentVolumeClaim) + If the provisioner or an external controller can support the specified data source, + it will create a new volume based on the contents of the specified data source. + When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef, + and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified. + If the namespace is specified, then dataSourceRef will not be copied to dataSource. + properties: + apiGroup: + description: |- + APIGroup is the group for the resource being referenced. + If APIGroup is not specified, the specified Kind must be in the core API group. + For any other third-party types, APIGroup is required. + type: string + kind: + description: Kind is the type of resource being referenced + type: string + name: + description: Name is the name of resource being referenced + type: string + required: + - kind + - name + type: object + x-kubernetes-map-type: atomic + dataSourceRef: + description: |- + dataSourceRef specifies the object from which to populate the volume with data, if a non-empty + volume is desired. This may be any object from a non-empty API group (non + core object) or a PersistentVolumeClaim object. + When this field is specified, volume binding will only succeed if the type of + the specified object matches some installed volume populator or dynamic + provisioner. + This field will replace the functionality of the dataSource field and as such + if both fields are non-empty, they must have the same value. For backwards + compatibility, when namespace isn't specified in dataSourceRef, + both fields (dataSource and dataSourceRef) will be set to the same + value automatically if one of them is empty and the other is non-empty. + When namespace is specified in dataSourceRef, + dataSource isn't set to the same value and must be empty. + There are three important differences between dataSource and dataSourceRef: + * While dataSource only allows two specific types of objects, dataSourceRef + allows any non-core object, as well as PersistentVolumeClaim objects. + * While dataSource ignores disallowed values (dropping them), dataSourceRef + preserves all values, and generates an error if a disallowed value is + specified. + * While dataSource only allows local objects, dataSourceRef allows objects + in any namespaces. + (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled. + (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled. + properties: + apiGroup: + description: |- + APIGroup is the group for the resource being referenced. + If APIGroup is not specified, the specified Kind must be in the core API group. + For any other third-party types, APIGroup is required. + type: string + kind: + description: Kind is the type of resource being referenced + type: string + name: + description: Name is the name of resource being referenced + type: string + namespace: + description: |- + Namespace is the namespace of resource being referenced + Note that when a namespace is specified, a gateway.networking.k8s.io/ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details. + (Alpha) This field requires the CrossNamespaceVolumeDataSource feature gate to be enabled. + type: string + required: + - kind + - name + type: object + resources: + description: |- + resources represents the minimum resources the volume should have. + Users are allowed to specify resource requirements + that are lower than previous value but must still be higher than capacity recorded in the + status field of the claim. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: |- + Limits describes the maximum amount of compute resources allowed. + More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: |- + Requests describes the minimum amount of compute resources required. + If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, + otherwise to an implementation-defined value. Requests cannot exceed Limits. + More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + type: object + type: object + selector: + description: selector is a label query over volumes to consider + for binding. + properties: + matchExpressions: + description: matchExpressions is a list of label selector + requirements. The requirements are ANDed. + items: + description: |- + A label selector requirement is a selector that contains values, a key, and an operator that + relates the key and values. + properties: + key: + description: key is the label key that the selector + applies to. + type: string + operator: + description: |- + operator represents a key's relationship to a set of values. + Valid operators are In, NotIn, Exists and DoesNotExist. + type: string + values: + description: |- + values is an array of string values. If the operator is In or NotIn, + the values array must be non-empty. If the operator is Exists or DoesNotExist, + the values array must be empty. This array is replaced during a strategic + merge patch. + items: + type: string + type: array + x-kubernetes-list-type: atomic + required: + - key + - operator + type: object + type: array + x-kubernetes-list-type: atomic + matchLabels: + additionalProperties: + type: string + description: |- + matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, whose key field is "key", the + operator is "In", and the values array contains only "value". The requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + storageClassName: + description: |- + storageClassName is the name of the StorageClass required by the claim. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1 + type: string + volumeAttributesClassName: + description: |- + volumeAttributesClassName may be used to set the VolumeAttributesClass used by this claim. + If specified, the CSI driver will create or update the volume with the attributes defined + in the corresponding VolumeAttributesClass. This has a different purpose than storageClassName, + it can be changed after the claim is created. An empty string or nil value indicates that no + VolumeAttributesClass will be applied to the claim. If the claim enters an Infeasible error state, + this field can be reset to its previous value (including nil) to cancel the modification. + If the resource referred to by volumeAttributesClass does not exist, this PersistentVolumeClaim will be + set to a Pending state, as reflected by the modifyVolumeStatus field, until such as a resource + exists. + More info: https://kubernetes.io/docs/concepts/storage/volume-attributes-classes/ + type: string + volumeMode: + description: |- + volumeMode defines what type of volume is required by the claim. + Value of Filesystem is implied when not included in claim spec. + type: string + volumeName: + description: volumeName is the binding reference to the + PersistentVolume backing this claim. + type: string + type: object + status: + description: |- + status represents the current information/status of a persistent volume claim. + Read-only. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims + properties: + accessModes: + description: |- + accessModes contains the actual access modes the volume backing the PVC has. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1 + items: + type: string + type: array + x-kubernetes-list-type: atomic + allocatedResourceStatuses: + additionalProperties: + description: |- + When a controller receives persistentvolume claim update with ClaimResourceStatus for a resource + that it does not recognizes, then it should ignore that update and let other controllers + handle it. + type: string + description: "allocatedResourceStatuses stores status of + resource being resized for the given PVC.\nKey names follow + standard Kubernetes label syntax. Valid values are either:\n\t* + Un-prefixed keys:\n\t\t- storage - the capacity of the + volume.\n\t* Custom resources must use implementation-defined + prefixed names such as \"example.com/my-custom-resource\"\nApart + from above values - keys that are unprefixed or have kubernetes.io + prefix are considered\nreserved and hence may not be used.\n\nClaimResourceStatus + can be in any of following states:\n\t- ControllerResizeInProgress:\n\t\tState + set when resize controller starts resizing the volume + in control-plane.\n\t- ControllerResizeFailed:\n\t\tState + set when resize has failed in resize controller with a + terminal error.\n\t- NodeResizePending:\n\t\tState set + when resize controller has finished resizing the volume + but further resizing of\n\t\tvolume is needed on the node.\n\t- + NodeResizeInProgress:\n\t\tState set when kubelet starts + resizing the volume.\n\t- NodeResizeFailed:\n\t\tState + set when resizing has failed in kubelet with a terminal + error. Transient errors don't set\n\t\tNodeResizeFailed.\nFor + example: if expanding a PVC for more capacity - this field + can be one of the following states:\n\t- pvc.status.allocatedResourceStatus['storage'] + = \"ControllerResizeInProgress\"\n - pvc.status.allocatedResourceStatus['storage'] + = \"ControllerResizeFailed\"\n - pvc.status.allocatedResourceStatus['storage'] + = \"NodeResizePending\"\n - pvc.status.allocatedResourceStatus['storage'] + = \"NodeResizeInProgress\"\n - pvc.status.allocatedResourceStatus['storage'] + = \"NodeResizeFailed\"\nWhen this field is not set, it + means that no resize operation is in progress for the + given PVC.\n\nA controller that receives PVC update with + previously unknown resourceName or ClaimResourceStatus\nshould + ignore the update for the purpose it was designed. For + example - a controller that\nonly is responsible for resizing + capacity of the volume, should ignore PVC updates that + change other valid\nresources associated with PVC." + type: object + x-kubernetes-map-type: granular + allocatedResources: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: "allocatedResources tracks the resources allocated + to a PVC including its capacity.\nKey names follow standard + Kubernetes label syntax. Valid values are either:\n\t* + Un-prefixed keys:\n\t\t- storage - the capacity of the + volume.\n\t* Custom resources must use implementation-defined + prefixed names such as \"example.com/my-custom-resource\"\nApart + from above values - keys that are unprefixed or have kubernetes.io + prefix are considered\nreserved and hence may not be used.\n\nCapacity + reported here may be larger than the actual capacity when + a volume expansion operation\nis requested.\nFor storage + quota, the larger value from allocatedResources and PVC.spec.resources + is used.\nIf allocatedResources is not set, PVC.spec.resources + alone is used for quota calculation.\nIf a volume expansion + capacity request is lowered, allocatedResources is only\nlowered + if there are no expansion operations in progress and if + the actual volume capacity\nis equal or lower than the + requested capacity.\n\nA controller that receives PVC + update with previously unknown resourceName\nshould ignore + the update for the purpose it was designed. For example + - a controller that\nonly is responsible for resizing + capacity of the volume, should ignore PVC updates that + change other valid\nresources associated with PVC." + type: object + capacity: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: capacity represents the actual resources of + the underlying volume. + type: object + conditions: + description: |- + conditions is the current Condition of persistent volume claim. If underlying persistent volume is being + resized then the Condition will be set to 'Resizing'. + items: + description: PersistentVolumeClaimCondition contains details + about state of pvc + properties: + lastProbeTime: + description: lastProbeTime is the time we probed the + condition. + format: date-time + type: string + lastTransitionTime: + description: lastTransitionTime is the time the condition + transitioned from one status to another. + format: date-time + type: string + message: + description: message is the human-readable message + indicating details about last transition. + type: string + reason: + description: |- + reason is a unique, this should be a short, machine understandable string that gives the reason + for condition's last transition. If it reports "Resizing" that means the underlying + persistent volume is being resized. + type: string + status: + description: |- + Status is the status of the condition. + Can be True, False, Unknown. + More info: https://kubernetes.io/docs/reference/kubernetes-api/config-and-storage-resources/persistent-volume-claim-v1/#:~:text=state%20of%20pvc-,conditions.status,-(string)%2C%20required + type: string + type: + description: |- + Type is the type of the condition. + More info: https://kubernetes.io/docs/reference/kubernetes-api/config-and-storage-resources/persistent-volume-claim-v1/#:~:text=set%20to%20%27ResizeStarted%27.-,PersistentVolumeClaimCondition,-contains%20details%20about + type: string + required: + - status + - type + type: object + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + currentVolumeAttributesClassName: + description: |- + currentVolumeAttributesClassName is the current name of the VolumeAttributesClass the PVC is using. + When unset, there is no VolumeAttributeClass applied to this PersistentVolumeClaim + type: string + modifyVolumeStatus: + description: |- + ModifyVolumeStatus represents the status object of ControllerModifyVolume operation. + When this is unset, there is no ModifyVolume operation being attempted. + properties: + status: + description: "status is the status of the ControllerModifyVolume + operation. It can be in any of following states:\n + - Pending\n Pending indicates that the PersistentVolumeClaim + cannot be modified due to unmet requirements, such + as\n the specified VolumeAttributesClass not existing.\n + - InProgress\n InProgress indicates that the volume + is being modified.\n - Infeasible\n Infeasible indicates + that the request has been rejected as invalid by the + CSI driver. To\n\t resolve the error, a valid VolumeAttributesClass + needs to be specified.\nNote: New statuses can be + added in the future. Consumers should check for unknown + statuses and fail appropriately." + type: string + targetVolumeAttributesClassName: + description: targetVolumeAttributesClassName is the + name of the VolumeAttributesClass the PVC currently + being reconciled + type: string + required: + - status + type: object + phase: + description: phase represents the current phase of PersistentVolumeClaim. + type: string + type: object + type: object + type: array required: - backends - image diff --git a/config/crd/bases/vinyl.bluedynamics.eu_vinylcaches.yaml b/config/crd/bases/vinyl.bluedynamics.eu_vinylcaches.yaml index 0329b54..263a457 100644 --- a/config/crd/bases/vinyl.bluedynamics.eu_vinylcaches.yaml +++ b/config/crd/bases/vinyl.bluedynamics.eu_vinylcaches.yaml @@ -1408,6 +1408,1991 @@ spec: type: string type: object type: array + volumeMounts: + description: |- + volumeMounts are additional mounts appended to the varnish container. + Each entry must reference a name present in spec.pod.volumes or + spec.volumeClaimTemplates. Reserved mount paths (/run/vinyl, + /etc/varnish/secret, /var/lib/varnish, /tmp, /etc/varnish/default.vcl) + are rejected by the admission webhook. + items: + description: VolumeMount describes a mounting of a Volume within + a container. + properties: + mountPath: + description: |- + Path within the container at which the volume should be mounted. Must + not contain ':'. + type: string + mountPropagation: + description: |- + mountPropagation determines how mounts are propagated from the host + to container and the other way around. + When not set, MountPropagationNone is used. + This field is beta in 1.10. + When RecursiveReadOnly is set to IfPossible or to Enabled, MountPropagation must be None or unspecified + (which defaults to None). + type: string + name: + description: This must match the Name of a Volume. + type: string + readOnly: + description: |- + Mounted read-only if true, read-write otherwise (false or unspecified). + Defaults to false. + type: boolean + recursiveReadOnly: + description: |- + RecursiveReadOnly specifies whether read-only mounts should be handled + recursively. + + If ReadOnly is false, this field has no meaning and must be unspecified. + + If ReadOnly is true, and this field is set to Disabled, the mount is not made + recursively read-only. If this field is set to IfPossible, the mount is made + recursively read-only, if it is supported by the container runtime. If this + field is set to Enabled, the mount is made recursively read-only if it is + supported by the container runtime, otherwise the pod will not be started and + an error will be generated to indicate the reason. + + If this field is set to IfPossible or Enabled, MountPropagation must be set to + None (or be unspecified, which defaults to None). + + If this field is not specified, it is treated as an equivalent of Disabled. + type: string + subPath: + description: |- + Path within the volume from which the container's volume should be mounted. + Defaults to "" (volume's root). + type: string + subPathExpr: + description: |- + Expanded path within the volume from which the container's volume should be mounted. + Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. + Defaults to "" (volume's root). + SubPathExpr and SubPath are mutually exclusive. + type: string + required: + - mountPath + - name + type: object + type: array + volumes: + description: |- + volumes are additional pod-level volumes appended to the operator-managed + defaults (agent-token, varnish-secret, varnish-workdir, varnish-tmp, + bootstrap-vcl). Use to back spec.storage[].path with a PVC, an EmptyDir + with sizeLimit, or any VolumeSource supported by Kubernetes. Reserved + names collide with operator-managed volumes and are rejected by the + admission webhook. Volume names must also be unique across volumes and + volumeClaimTemplates. + items: + description: Volume represents a named volume in a pod that + may be accessed by any container in the pod. + properties: + awsElasticBlockStore: + description: |- + awsElasticBlockStore represents an AWS Disk resource that is attached to a + kubelet's host machine and then exposed to the pod. + Deprecated: AWSElasticBlockStore is deprecated. All operations for the in-tree + awsElasticBlockStore type are redirected to the ebs.csi.aws.com CSI driver. + More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore + properties: + fsType: + description: |- + fsType is the filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore + type: string + partition: + description: |- + partition is the partition in the volume that you want to mount. + If omitted, the default is to mount by volume name. + Examples: For volume /dev/sda1, you specify the partition as "1". + Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty). + format: int32 + type: integer + readOnly: + description: |- + readOnly value true will force the readOnly setting in VolumeMounts. + More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore + type: boolean + volumeID: + description: |- + volumeID is unique ID of the persistent disk resource in AWS (Amazon EBS volume). + More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore + type: string + required: + - volumeID + type: object + azureDisk: + description: |- + azureDisk represents an Azure Data Disk mount on the host and bind mount to the pod. + Deprecated: AzureDisk is deprecated. All operations for the in-tree azureDisk type + are redirected to the disk.csi.azure.com CSI driver. + properties: + cachingMode: + description: 'cachingMode is the Host Caching mode: + None, Read Only, Read Write.' + type: string + diskName: + description: diskName is the Name of the data disk in + the blob storage + type: string + diskURI: + description: diskURI is the URI of data disk in the + blob storage + type: string + fsType: + default: ext4 + description: |- + fsType is Filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + type: string + kind: + description: 'kind expected values are Shared: multiple + blob disks per storage account Dedicated: single + blob disk per storage account Managed: azure managed + data disk (only in managed availability set). defaults + to shared' + type: string + readOnly: + default: false + description: |- + readOnly Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + type: boolean + required: + - diskName + - diskURI + type: object + azureFile: + description: |- + azureFile represents an Azure File Service mount on the host and bind mount to the pod. + Deprecated: AzureFile is deprecated. All operations for the in-tree azureFile type + are redirected to the file.csi.azure.com CSI driver. + properties: + readOnly: + description: |- + readOnly defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + type: boolean + secretName: + description: secretName is the name of secret that + contains Azure Storage Account Name and Key + type: string + shareName: + description: shareName is the azure share Name + type: string + required: + - secretName + - shareName + type: object + cephfs: + description: |- + cephFS represents a Ceph FS mount on the host that shares a pod's lifetime. + Deprecated: CephFS is deprecated and the in-tree cephfs type is no longer supported. + properties: + monitors: + description: |- + monitors is Required: Monitors is a collection of Ceph monitors + More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it + items: + type: string + type: array + x-kubernetes-list-type: atomic + path: + description: 'path is Optional: Used as the mounted + root, rather than the full Ceph tree, default is /' + type: string + readOnly: + description: |- + readOnly is Optional: Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it + type: boolean + secretFile: + description: |- + secretFile is Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret + More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it + type: string + secretRef: + description: |- + secretRef is Optional: SecretRef is reference to the authentication secret for User, default is empty. + More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it + properties: + name: + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + type: object + x-kubernetes-map-type: atomic + user: + description: |- + user is optional: User is the rados user name, default is admin + More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it + type: string + required: + - monitors + type: object + cinder: + description: |- + cinder represents a cinder volume attached and mounted on kubelets host machine. + Deprecated: Cinder is deprecated. All operations for the in-tree cinder type + are redirected to the cinder.csi.openstack.org CSI driver. + More info: https://examples.k8s.io/mysql-cinder-pd/README.md + properties: + fsType: + description: |- + fsType is the filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + More info: https://examples.k8s.io/mysql-cinder-pd/README.md + type: string + readOnly: + description: |- + readOnly defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + More info: https://examples.k8s.io/mysql-cinder-pd/README.md + type: boolean + secretRef: + description: |- + secretRef is optional: points to a secret object containing parameters used to connect + to OpenStack. + properties: + name: + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + type: object + x-kubernetes-map-type: atomic + volumeID: + description: |- + volumeID used to identify the volume in cinder. + More info: https://examples.k8s.io/mysql-cinder-pd/README.md + type: string + required: + - volumeID + type: object + configMap: + description: configMap represents a configMap that should + populate this volume + properties: + defaultMode: + description: |- + defaultMode is optional: mode bits used to set permissions on created files by default. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. + format: int32 + type: integer + items: + description: |- + items if unspecified, each key-value pair in the Data field of the referenced + ConfigMap will be projected into the volume as a file whose name is the + key and content is the value. If specified, the listed keys will be + projected into the specified paths, and unlisted keys will not be + present. If a key is specified which is not present in the ConfigMap, + the volume setup will error unless it is marked optional. Paths must be + relative and may not contain the '..' path or start with '..'. + items: + description: Maps a string key to a path within a + volume. + properties: + key: + description: key is the key to project. + type: string + mode: + description: |- + mode is Optional: mode bits used to set permissions on this file. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + If not specified, the volume defaultMode will be used. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. + format: int32 + type: integer + path: + description: |- + path is the relative path of the file to map the key to. + May not be an absolute path. + May not contain the path element '..'. + May not start with the string '..'. + type: string + required: + - key + - path + type: object + type: array + x-kubernetes-list-type: atomic + name: + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + optional: + description: optional specify whether the ConfigMap + or its keys must be defined + type: boolean + type: object + x-kubernetes-map-type: atomic + csi: + description: csi (Container Storage Interface) represents + ephemeral storage that is handled by certain external + CSI drivers. + properties: + driver: + description: |- + driver is the name of the CSI driver that handles this volume. + Consult with your admin for the correct name as registered in the cluster. + type: string + fsType: + description: |- + fsType to mount. Ex. "ext4", "xfs", "ntfs". + If not provided, the empty value is passed to the associated CSI driver + which will determine the default filesystem to apply. + type: string + nodePublishSecretRef: + description: |- + nodePublishSecretRef is a reference to the secret object containing + sensitive information to pass to the CSI driver to complete the CSI + NodePublishVolume and NodeUnpublishVolume calls. + This field is optional, and may be empty if no secret is required. If the + secret object contains more than one secret, all secret references are passed. + properties: + name: + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + type: object + x-kubernetes-map-type: atomic + readOnly: + description: |- + readOnly specifies a read-only configuration for the volume. + Defaults to false (read/write). + type: boolean + volumeAttributes: + additionalProperties: + type: string + description: |- + volumeAttributes stores driver-specific properties that are passed to the CSI + driver. Consult your driver's documentation for supported values. + type: object + required: + - driver + type: object + downwardAPI: + description: downwardAPI represents downward API about the + pod that should populate this volume + properties: + defaultMode: + description: |- + Optional: mode bits to use on created files by default. Must be a + Optional: mode bits used to set permissions on created files by default. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. + format: int32 + type: integer + items: + description: Items is a list of downward API volume + file + items: + description: DownwardAPIVolumeFile represents information + to create the file containing the pod field + properties: + fieldRef: + description: 'Required: Selects a field of the + pod: only annotations, labels, name, namespace + and uid are supported.' + properties: + apiVersion: + description: Version of the schema the FieldPath + is written in terms of, defaults to "v1". + type: string + fieldPath: + description: Path of the field to select in + the specified API version. + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + mode: + description: |- + Optional: mode bits used to set permissions on this file, must be an octal value + between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + If not specified, the volume defaultMode will be used. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. + format: int32 + type: integer + path: + description: 'Required: Path is the relative + path name of the file to be created. Must not + be absolute or contain the ''..'' path. Must + be utf-8 encoded. The first item of the relative + path must not start with ''..''' + type: string + resourceFieldRef: + description: |- + Selects a resource of the container: only resources limits and requests + (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported. + properties: + containerName: + description: 'Container name: required for + volumes, optional for env vars' + type: string + divisor: + anyOf: + - type: integer + - type: string + description: Specifies the output format of + the exposed resources, defaults to "1" + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + description: 'Required: resource to select' + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + required: + - path + type: object + type: array + x-kubernetes-list-type: atomic + type: object + emptyDir: + description: |- + emptyDir represents a temporary directory that shares a pod's lifetime. + More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir + properties: + medium: + description: |- + medium represents what type of storage medium should back this directory. + The default is "" which means to use the node's default medium. + Must be an empty string (default) or Memory. + More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir + type: string + sizeLimit: + anyOf: + - type: integer + - type: string + description: |- + sizeLimit is the total amount of local storage required for this EmptyDir volume. + The size limit is also applicable for memory medium. + The maximum usage on memory medium EmptyDir would be the minimum value between + the SizeLimit specified here and the sum of memory limits of all containers in a pod. + The default is nil which means that the limit is undefined. + More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + ephemeral: + description: |- + ephemeral represents a volume that is handled by a cluster storage driver. + The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts, + and deleted when the pod is removed. + + Use this if: + a) the volume is only needed while the pod runs, + b) features of normal volumes like restoring from snapshot or capacity + tracking are needed, + c) the storage driver is specified through a storage class, and + d) the storage driver supports dynamic volume provisioning through + a PersistentVolumeClaim (see EphemeralVolumeSource for more + information on the connection between this volume type + and PersistentVolumeClaim). + + Use PersistentVolumeClaim or one of the vendor-specific + APIs for volumes that persist for longer than the lifecycle + of an individual pod. + + Use CSI for light-weight local ephemeral volumes if the CSI driver is meant to + be used that way - see the documentation of the driver for + more information. + + A pod can use both types of ephemeral volumes and + persistent volumes at the same time. + properties: + volumeClaimTemplate: + description: |- + Will be used to create a stand-alone PVC to provision the volume. + The pod in which this EphemeralVolumeSource is embedded will be the + owner of the PVC, i.e. the PVC will be deleted together with the + pod. The name of the PVC will be `-` where + `` is the name from the `PodSpec.Volumes` array + entry. Pod validation will reject the pod if the concatenated name + is not valid for a PVC (for example, too long). + + An existing PVC with that name that is not owned by the pod + will *not* be used for the pod to avoid using an unrelated + volume by mistake. Starting the pod is then blocked until + the unrelated PVC is removed. If such a pre-created PVC is + meant to be used by the pod, the PVC has to updated with an + owner reference to the pod once the pod exists. Normally + this should not be necessary, but it may be useful when + manually reconstructing a broken cluster. + + This field is read-only and no changes will be made by Kubernetes + to the PVC after it has been created. + + Required, must not be nil. + properties: + metadata: + description: |- + May contain labels and annotations that will be copied into the PVC + when creating it. No other fields are allowed and will be rejected during + validation. + type: object + spec: + description: |- + The specification for the PersistentVolumeClaim. The entire content is + copied unchanged into the PVC that gets created from this + template. The same fields as in a PersistentVolumeClaim + are also valid here. + properties: + accessModes: + description: |- + accessModes contains the desired access modes the volume should have. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1 + items: + type: string + type: array + x-kubernetes-list-type: atomic + dataSource: + description: |- + dataSource field can be used to specify either: + * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) + * An existing PVC (PersistentVolumeClaim) + If the provisioner or an external controller can support the specified data source, + it will create a new volume based on the contents of the specified data source. + When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef, + and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified. + If the namespace is specified, then dataSourceRef will not be copied to dataSource. + properties: + apiGroup: + description: |- + APIGroup is the group for the resource being referenced. + If APIGroup is not specified, the specified Kind must be in the core API group. + For any other third-party types, APIGroup is required. + type: string + kind: + description: Kind is the type of resource + being referenced + type: string + name: + description: Name is the name of resource + being referenced + type: string + required: + - kind + - name + type: object + x-kubernetes-map-type: atomic + dataSourceRef: + description: |- + dataSourceRef specifies the object from which to populate the volume with data, if a non-empty + volume is desired. This may be any object from a non-empty API group (non + core object) or a PersistentVolumeClaim object. + When this field is specified, volume binding will only succeed if the type of + the specified object matches some installed volume populator or dynamic + provisioner. + This field will replace the functionality of the dataSource field and as such + if both fields are non-empty, they must have the same value. For backwards + compatibility, when namespace isn't specified in dataSourceRef, + both fields (dataSource and dataSourceRef) will be set to the same + value automatically if one of them is empty and the other is non-empty. + When namespace is specified in dataSourceRef, + dataSource isn't set to the same value and must be empty. + There are three important differences between dataSource and dataSourceRef: + * While dataSource only allows two specific types of objects, dataSourceRef + allows any non-core object, as well as PersistentVolumeClaim objects. + * While dataSource ignores disallowed values (dropping them), dataSourceRef + preserves all values, and generates an error if a disallowed value is + specified. + * While dataSource only allows local objects, dataSourceRef allows objects + in any namespaces. + (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled. + (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled. + properties: + apiGroup: + description: |- + APIGroup is the group for the resource being referenced. + If APIGroup is not specified, the specified Kind must be in the core API group. + For any other third-party types, APIGroup is required. + type: string + kind: + description: Kind is the type of resource + being referenced + type: string + name: + description: Name is the name of resource + being referenced + type: string + namespace: + description: |- + Namespace is the namespace of resource being referenced + Note that when a namespace is specified, a gateway.networking.k8s.io/ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details. + (Alpha) This field requires the CrossNamespaceVolumeDataSource feature gate to be enabled. + type: string + required: + - kind + - name + type: object + resources: + description: |- + resources represents the minimum resources the volume should have. + Users are allowed to specify resource requirements + that are lower than previous value but must still be higher than capacity recorded in the + status field of the claim. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: |- + Limits describes the maximum amount of compute resources allowed. + More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: |- + Requests describes the minimum amount of compute resources required. + If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, + otherwise to an implementation-defined value. Requests cannot exceed Limits. + More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + type: object + type: object + selector: + description: selector is a label query over + volumes to consider for binding. + properties: + matchExpressions: + description: matchExpressions is a list + of label selector requirements. The requirements + are ANDed. + items: + description: |- + A label selector requirement is a selector that contains values, a key, and an operator that + relates the key and values. + properties: + key: + description: key is the label key + that the selector applies to. + type: string + operator: + description: |- + operator represents a key's relationship to a set of values. + Valid operators are In, NotIn, Exists and DoesNotExist. + type: string + values: + description: |- + values is an array of string values. If the operator is In or NotIn, + the values array must be non-empty. If the operator is Exists or DoesNotExist, + the values array must be empty. This array is replaced during a strategic + merge patch. + items: + type: string + type: array + x-kubernetes-list-type: atomic + required: + - key + - operator + type: object + type: array + x-kubernetes-list-type: atomic + matchLabels: + additionalProperties: + type: string + description: |- + matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, whose key field is "key", the + operator is "In", and the values array contains only "value". The requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + storageClassName: + description: |- + storageClassName is the name of the StorageClass required by the claim. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1 + type: string + volumeAttributesClassName: + description: |- + volumeAttributesClassName may be used to set the VolumeAttributesClass used by this claim. + If specified, the CSI driver will create or update the volume with the attributes defined + in the corresponding VolumeAttributesClass. This has a different purpose than storageClassName, + it can be changed after the claim is created. An empty string or nil value indicates that no + VolumeAttributesClass will be applied to the claim. If the claim enters an Infeasible error state, + this field can be reset to its previous value (including nil) to cancel the modification. + If the resource referred to by volumeAttributesClass does not exist, this PersistentVolumeClaim will be + set to a Pending state, as reflected by the modifyVolumeStatus field, until such as a resource + exists. + More info: https://kubernetes.io/docs/concepts/storage/volume-attributes-classes/ + type: string + volumeMode: + description: |- + volumeMode defines what type of volume is required by the claim. + Value of Filesystem is implied when not included in claim spec. + type: string + volumeName: + description: volumeName is the binding reference + to the PersistentVolume backing this claim. + type: string + type: object + required: + - spec + type: object + type: object + fc: + description: fc represents a Fibre Channel resource that + is attached to a kubelet's host machine and then exposed + to the pod. + properties: + fsType: + description: |- + fsType is the filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + type: string + lun: + description: 'lun is Optional: FC target lun number' + format: int32 + type: integer + readOnly: + description: |- + readOnly is Optional: Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + type: boolean + targetWWNs: + description: 'targetWWNs is Optional: FC target worldwide + names (WWNs)' + items: + type: string + type: array + x-kubernetes-list-type: atomic + wwids: + description: |- + wwids Optional: FC volume world wide identifiers (wwids) + Either wwids or combination of targetWWNs and lun must be set, but not both simultaneously. + items: + type: string + type: array + x-kubernetes-list-type: atomic + type: object + flexVolume: + description: |- + flexVolume represents a generic volume resource that is + provisioned/attached using an exec based plugin. + Deprecated: FlexVolume is deprecated. Consider using a CSIDriver instead. + properties: + driver: + description: driver is the name of the driver to use + for this volume. + type: string + fsType: + description: |- + fsType is the filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". The default filesystem depends on FlexVolume script. + type: string + options: + additionalProperties: + type: string + description: 'options is Optional: this field holds + extra command options if any.' + type: object + readOnly: + description: |- + readOnly is Optional: defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + type: boolean + secretRef: + description: |- + secretRef is Optional: secretRef is reference to the secret object containing + sensitive information to pass to the plugin scripts. This may be + empty if no secret object is specified. If the secret object + contains more than one secret, all secrets are passed to the plugin + scripts. + properties: + name: + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + type: object + x-kubernetes-map-type: atomic + required: + - driver + type: object + flocker: + description: |- + flocker represents a Flocker volume attached to a kubelet's host machine. This depends on the Flocker control service being running. + Deprecated: Flocker is deprecated and the in-tree flocker type is no longer supported. + properties: + datasetName: + description: |- + datasetName is Name of the dataset stored as metadata -> name on the dataset for Flocker + should be considered as deprecated + type: string + datasetUUID: + description: datasetUUID is the UUID of the dataset. + This is unique identifier of a Flocker dataset + type: string + type: object + gcePersistentDisk: + description: |- + gcePersistentDisk represents a GCE Disk resource that is attached to a + kubelet's host machine and then exposed to the pod. + Deprecated: GCEPersistentDisk is deprecated. All operations for the in-tree + gcePersistentDisk type are redirected to the pd.csi.storage.gke.io CSI driver. + More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk + properties: + fsType: + description: |- + fsType is filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk + type: string + partition: + description: |- + partition is the partition in the volume that you want to mount. + If omitted, the default is to mount by volume name. + Examples: For volume /dev/sda1, you specify the partition as "1". + Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty). + More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk + format: int32 + type: integer + pdName: + description: |- + pdName is unique name of the PD resource in GCE. Used to identify the disk in GCE. + More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk + type: string + readOnly: + description: |- + readOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk + type: boolean + required: + - pdName + type: object + gitRepo: + description: |- + gitRepo represents a git repository at a particular revision. + Deprecated: GitRepo is deprecated. To provision a container with a git repo, mount an + EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir + into the Pod's container. + properties: + directory: + description: |- + directory is the target directory name. + Must not contain or start with '..'. If '.' is supplied, the volume directory will be the + git repository. Otherwise, if specified, the volume will contain the git repository in + the subdirectory with the given name. + type: string + repository: + description: repository is the URL + type: string + revision: + description: revision is the commit hash for the specified + revision. + type: string + required: + - repository + type: object + glusterfs: + description: |- + glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime. + Deprecated: Glusterfs is deprecated and the in-tree glusterfs type is no longer supported. + properties: + endpoints: + description: endpoints is the endpoint name that details + Glusterfs topology. + type: string + path: + description: |- + path is the Glusterfs volume path. + More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod + type: string + readOnly: + description: |- + readOnly here will force the Glusterfs volume to be mounted with read-only permissions. + Defaults to false. + More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod + type: boolean + required: + - endpoints + - path + type: object + hostPath: + description: |- + hostPath represents a pre-existing file or directory on the host + machine that is directly exposed to the container. This is generally + used for system agents or other privileged things that are allowed + to see the host machine. Most containers will NOT need this. + More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath + properties: + path: + description: |- + path of the directory on the host. + If the path is a symlink, it will follow the link to the real path. + More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath + type: string + type: + description: |- + type for HostPath Volume + Defaults to "" + More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath + type: string + required: + - path + type: object + image: + description: |- + image represents an OCI object (a container image or artifact) pulled and mounted on the kubelet's host machine. + The volume is resolved at pod startup depending on which PullPolicy value is provided: + + - Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails. + - Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present. + - IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails. + + The volume gets re-resolved if the pod gets deleted and recreated, which means that new remote content will become available on pod recreation. + A failure to resolve or pull the image during pod startup will block containers from starting and may add significant latency. Failures will be retried using normal volume backoff and will be reported on the pod reason and message. + The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field. + The OCI object gets mounted in a single directory (spec.containers[*].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images. + The volume will be mounted read-only (ro) and non-executable files (noexec). + Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath) before 1.33. + The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type. + properties: + pullPolicy: + description: |- + Policy for pulling OCI objects. Possible values are: + Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails. + Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present. + IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails. + Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. + type: string + reference: + description: |- + Required: Image or artifact reference to be used. + Behaves in the same way as pod.spec.containers[*].image. + Pull secrets will be assembled in the same way as for the container image by looking up node credentials, SA image pull secrets, and pod spec image pull secrets. + More info: https://kubernetes.io/docs/concepts/containers/images + This field is optional to allow higher level config management to default or override + container images in workload controllers like Deployments and StatefulSets. + type: string + type: object + iscsi: + description: |- + iscsi represents an ISCSI Disk resource that is attached to a + kubelet's host machine and then exposed to the pod. + More info: https://kubernetes.io/docs/concepts/storage/volumes/#iscsi + properties: + chapAuthDiscovery: + description: chapAuthDiscovery defines whether support + iSCSI Discovery CHAP authentication + type: boolean + chapAuthSession: + description: chapAuthSession defines whether support + iSCSI Session CHAP authentication + type: boolean + fsType: + description: |- + fsType is the filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi + type: string + initiatorName: + description: |- + initiatorName is the custom iSCSI Initiator Name. + If initiatorName is specified with iscsiInterface simultaneously, new iSCSI interface + : will be created for the connection. + type: string + iqn: + description: iqn is the target iSCSI Qualified Name. + type: string + iscsiInterface: + default: default + description: |- + iscsiInterface is the interface Name that uses an iSCSI transport. + Defaults to 'default' (tcp). + type: string + lun: + description: lun represents iSCSI Target Lun number. + format: int32 + type: integer + portals: + description: |- + portals is the iSCSI Target Portal List. The portal is either an IP or ip_addr:port if the port + is other than default (typically TCP ports 860 and 3260). + items: + type: string + type: array + x-kubernetes-list-type: atomic + readOnly: + description: |- + readOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: boolean + secretRef: + description: secretRef is the CHAP Secret for iSCSI + target and initiator authentication + properties: + name: + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + type: object + x-kubernetes-map-type: atomic + targetPortal: + description: |- + targetPortal is iSCSI Target Portal. The Portal is either an IP or ip_addr:port if the port + is other than default (typically TCP ports 860 and 3260). + type: string + required: + - iqn + - lun + - targetPortal + type: object + name: + description: |- + name of the volume. + Must be a DNS_LABEL and unique within the pod. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + nfs: + description: |- + nfs represents an NFS mount on the host that shares a pod's lifetime + More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs + properties: + path: + description: |- + path that is exported by the NFS server. + More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs + type: string + readOnly: + description: |- + readOnly here will force the NFS export to be mounted with read-only permissions. + Defaults to false. + More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs + type: boolean + server: + description: |- + server is the hostname or IP address of the NFS server. + More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs + type: string + required: + - path + - server + type: object + persistentVolumeClaim: + description: |- + persistentVolumeClaimVolumeSource represents a reference to a + PersistentVolumeClaim in the same namespace. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims + properties: + claimName: + description: |- + claimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims + type: string + readOnly: + description: |- + readOnly Will force the ReadOnly setting in VolumeMounts. + Default false. + type: boolean + required: + - claimName + type: object + photonPersistentDisk: + description: |- + photonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine. + Deprecated: PhotonPersistentDisk is deprecated and the in-tree photonPersistentDisk type is no longer supported. + properties: + fsType: + description: |- + fsType is the filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + type: string + pdID: + description: pdID is the ID that identifies Photon Controller + persistent disk + type: string + required: + - pdID + type: object + portworxVolume: + description: |- + portworxVolume represents a portworx volume attached and mounted on kubelets host machine. + Deprecated: PortworxVolume is deprecated. All operations for the in-tree portworxVolume type + are redirected to the pxd.portworx.com CSI driver when the CSIMigrationPortworx feature-gate + is on. + properties: + fsType: + description: |- + fSType represents the filesystem type to mount + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs". Implicitly inferred to be "ext4" if unspecified. + type: string + readOnly: + description: |- + readOnly defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + type: boolean + volumeID: + description: volumeID uniquely identifies a Portworx + volume + type: string + required: + - volumeID + type: object + projected: + description: projected items for all in one resources secrets, + configmaps, and downward API + properties: + defaultMode: + description: |- + defaultMode are the mode bits used to set permissions on created files by default. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. + format: int32 + type: integer + sources: + description: |- + sources is the list of volume projections. Each entry in this list + handles one source. + items: + description: |- + Projection that may be projected along with other supported volume types. + Exactly one of these fields must be set. + properties: + clusterTrustBundle: + description: |- + ClusterTrustBundle allows a pod to access the `.spec.trustBundle` field + of ClusterTrustBundle objects in an auto-updating file. + + Alpha, gated by the ClusterTrustBundleProjection feature gate. + + ClusterTrustBundle objects can either be selected by name, or by the + combination of signer name and a label selector. + + Kubelet performs aggressive normalization of the PEM contents written + into the pod filesystem. Esoteric PEM features such as inter-block + comments and block headers are stripped. Certificates are deduplicated. + The ordering of certificates within the file is arbitrary, and Kubelet + may change the order over time. + properties: + labelSelector: + description: |- + Select all ClusterTrustBundles that match this label selector. Only has + effect if signerName is set. Mutually-exclusive with name. If unset, + interpreted as "match nothing". If set but empty, interpreted as "match + everything". + properties: + matchExpressions: + description: matchExpressions is a list + of label selector requirements. The + requirements are ANDed. + items: + description: |- + A label selector requirement is a selector that contains values, a key, and an operator that + relates the key and values. + properties: + key: + description: key is the label key + that the selector applies to. + type: string + operator: + description: |- + operator represents a key's relationship to a set of values. + Valid operators are In, NotIn, Exists and DoesNotExist. + type: string + values: + description: |- + values is an array of string values. If the operator is In or NotIn, + the values array must be non-empty. If the operator is Exists or DoesNotExist, + the values array must be empty. This array is replaced during a strategic + merge patch. + items: + type: string + type: array + x-kubernetes-list-type: atomic + required: + - key + - operator + type: object + type: array + x-kubernetes-list-type: atomic + matchLabels: + additionalProperties: + type: string + description: |- + matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, whose key field is "key", the + operator is "In", and the values array contains only "value". The requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + name: + description: |- + Select a single ClusterTrustBundle by object name. Mutually-exclusive + with signerName and labelSelector. + type: string + optional: + description: |- + If true, don't block pod startup if the referenced ClusterTrustBundle(s) + aren't available. If using name, then the named ClusterTrustBundle is + allowed not to exist. If using signerName, then the combination of + signerName and labelSelector is allowed to match zero + ClusterTrustBundles. + type: boolean + path: + description: Relative path from the volume + root to write the bundle. + type: string + signerName: + description: |- + Select all ClusterTrustBundles that match this signer name. + Mutually-exclusive with name. The contents of all selected + ClusterTrustBundles will be unified and deduplicated. + type: string + required: + - path + type: object + configMap: + description: configMap information about the configMap + data to project + properties: + items: + description: |- + items if unspecified, each key-value pair in the Data field of the referenced + ConfigMap will be projected into the volume as a file whose name is the + key and content is the value. If specified, the listed keys will be + projected into the specified paths, and unlisted keys will not be + present. If a key is specified which is not present in the ConfigMap, + the volume setup will error unless it is marked optional. Paths must be + relative and may not contain the '..' path or start with '..'. + items: + description: Maps a string key to a path + within a volume. + properties: + key: + description: key is the key to project. + type: string + mode: + description: |- + mode is Optional: mode bits used to set permissions on this file. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + If not specified, the volume defaultMode will be used. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. + format: int32 + type: integer + path: + description: |- + path is the relative path of the file to map the key to. + May not be an absolute path. + May not contain the path element '..'. + May not start with the string '..'. + type: string + required: + - key + - path + type: object + type: array + x-kubernetes-list-type: atomic + name: + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + optional: + description: optional specify whether the + ConfigMap or its keys must be defined + type: boolean + type: object + x-kubernetes-map-type: atomic + downwardAPI: + description: downwardAPI information about the + downwardAPI data to project + properties: + items: + description: Items is a list of DownwardAPIVolume + file + items: + description: DownwardAPIVolumeFile represents + information to create the file containing + the pod field + properties: + fieldRef: + description: 'Required: Selects a field + of the pod: only annotations, labels, + name, namespace and uid are supported.' + properties: + apiVersion: + description: Version of the schema + the FieldPath is written in terms + of, defaults to "v1". + type: string + fieldPath: + description: Path of the field to + select in the specified API version. + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + mode: + description: |- + Optional: mode bits used to set permissions on this file, must be an octal value + between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + If not specified, the volume defaultMode will be used. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. + format: int32 + type: integer + path: + description: 'Required: Path is the + relative path name of the file to + be created. Must not be absolute or + contain the ''..'' path. Must be utf-8 + encoded. The first item of the relative + path must not start with ''..''' + type: string + resourceFieldRef: + description: |- + Selects a resource of the container: only resources limits and requests + (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported. + properties: + containerName: + description: 'Container name: required + for volumes, optional for env + vars' + type: string + divisor: + anyOf: + - type: integer + - type: string + description: Specifies the output + format of the exposed resources, + defaults to "1" + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + description: 'Required: resource + to select' + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + required: + - path + type: object + type: array + x-kubernetes-list-type: atomic + type: object + podCertificate: + description: |- + Projects an auto-rotating credential bundle (private key and certificate + chain) that the pod can use either as a TLS client or server. + + Kubelet generates a private key and uses it to send a + PodCertificateRequest to the named signer. Once the signer approves the + request and issues a certificate chain, Kubelet writes the key and + certificate chain to the pod filesystem. The pod does not start until + certificates have been issued for each podCertificate projected volume + source in its spec. + + Kubelet will begin trying to rotate the certificate at the time indicated + by the signer using the PodCertificateRequest.Status.BeginRefreshAt + timestamp. + + Kubelet can write a single file, indicated by the credentialBundlePath + field, or separate files, indicated by the keyPath and + certificateChainPath fields. + + The credential bundle is a single file in PEM format. The first PEM + entry is the private key (in PKCS#8 format), and the remaining PEM + entries are the certificate chain issued by the signer (typically, + signers will return their certificate chain in leaf-to-root order). + + Prefer using the credential bundle format, since your application code + can read it atomically. If you use keyPath and certificateChainPath, + your application must make two separate file reads. If these coincide + with a certificate rotation, it is possible that the private key and leaf + certificate you read may not correspond to each other. Your application + will need to check for this condition, and re-read until they are + consistent. + + The named signer controls chooses the format of the certificate it + issues; consult the signer implementation's documentation to learn how to + use the certificates it issues. + properties: + certificateChainPath: + description: |- + Write the certificate chain at this path in the projected volume. + + Most applications should use credentialBundlePath. When using keyPath + and certificateChainPath, your application needs to check that the key + and leaf certificate are consistent, because it is possible to read the + files mid-rotation. + type: string + credentialBundlePath: + description: |- + Write the credential bundle at this path in the projected volume. + + The credential bundle is a single file that contains multiple PEM blocks. + The first PEM block is a PRIVATE KEY block, containing a PKCS#8 private + key. + + The remaining blocks are CERTIFICATE blocks, containing the issued + certificate chain from the signer (leaf and any intermediates). + + Using credentialBundlePath lets your Pod's application code make a single + atomic read that retrieves a consistent key and certificate chain. If you + project them to separate files, your application code will need to + additionally check that the leaf certificate was issued to the key. + type: string + keyPath: + description: |- + Write the key at this path in the projected volume. + + Most applications should use credentialBundlePath. When using keyPath + and certificateChainPath, your application needs to check that the key + and leaf certificate are consistent, because it is possible to read the + files mid-rotation. + type: string + keyType: + description: |- + The type of keypair Kubelet will generate for the pod. + + Valid values are "RSA3072", "RSA4096", "ECDSAP256", "ECDSAP384", + "ECDSAP521", and "ED25519". + type: string + maxExpirationSeconds: + description: |- + maxExpirationSeconds is the maximum lifetime permitted for the + certificate. + + Kubelet copies this value verbatim into the PodCertificateRequests it + generates for this projection. + + If omitted, kube-apiserver will set it to 86400(24 hours). kube-apiserver + will reject values shorter than 3600 (1 hour). The maximum allowable + value is 7862400 (91 days). + + The signer implementation is then free to issue a certificate with any + lifetime *shorter* than MaxExpirationSeconds, but no shorter than 3600 + seconds (1 hour). This constraint is enforced by kube-apiserver. + `kubernetes.io` signers will never issue certificates with a lifetime + longer than 24 hours. + format: int32 + type: integer + signerName: + description: Kubelet's generated CSRs will + be addressed to this signer. + type: string + userAnnotations: + additionalProperties: + type: string + description: |- + userAnnotations allow pod authors to pass additional information to + the signer implementation. Kubernetes does not restrict or validate this + metadata in any way. + + These values are copied verbatim into the `spec.unverifiedUserAnnotations` field of + the PodCertificateRequest objects that Kubelet creates. + + Entries are subject to the same validation as object metadata annotations, + with the addition that all keys must be domain-prefixed. No restrictions + are placed on values, except an overall size limitation on the entire field. + + Signers should document the keys and values they support. Signers should + deny requests that contain keys they do not recognize. + type: object + required: + - keyType + - signerName + type: object + secret: + description: secret information about the secret + data to project + properties: + items: + description: |- + items if unspecified, each key-value pair in the Data field of the referenced + Secret will be projected into the volume as a file whose name is the + key and content is the value. If specified, the listed keys will be + projected into the specified paths, and unlisted keys will not be + present. If a key is specified which is not present in the Secret, + the volume setup will error unless it is marked optional. Paths must be + relative and may not contain the '..' path or start with '..'. + items: + description: Maps a string key to a path + within a volume. + properties: + key: + description: key is the key to project. + type: string + mode: + description: |- + mode is Optional: mode bits used to set permissions on this file. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + If not specified, the volume defaultMode will be used. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. + format: int32 + type: integer + path: + description: |- + path is the relative path of the file to map the key to. + May not be an absolute path. + May not contain the path element '..'. + May not start with the string '..'. + type: string + required: + - key + - path + type: object + type: array + x-kubernetes-list-type: atomic + name: + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + optional: + description: optional field specify whether + the Secret or its key must be defined + type: boolean + type: object + x-kubernetes-map-type: atomic + serviceAccountToken: + description: serviceAccountToken is information + about the serviceAccountToken data to project + properties: + audience: + description: |- + audience is the intended audience of the token. A recipient of a token + must identify itself with an identifier specified in the audience of the + token, and otherwise should reject the token. The audience defaults to the + identifier of the apiserver. + type: string + expirationSeconds: + description: |- + expirationSeconds is the requested duration of validity of the service + account token. As the token approaches expiration, the kubelet volume + plugin will proactively rotate the service account token. The kubelet will + start trying to rotate the token if the token is older than 80 percent of + its time to live or if the token is older than 24 hours.Defaults to 1 hour + and must be at least 10 minutes. + format: int64 + type: integer + path: + description: |- + path is the path relative to the mount point of the file to project the + token into. + type: string + required: + - path + type: object + type: object + type: array + x-kubernetes-list-type: atomic + type: object + quobyte: + description: |- + quobyte represents a Quobyte mount on the host that shares a pod's lifetime. + Deprecated: Quobyte is deprecated and the in-tree quobyte type is no longer supported. + properties: + group: + description: |- + group to map volume access to + Default is no group + type: string + readOnly: + description: |- + readOnly here will force the Quobyte volume to be mounted with read-only permissions. + Defaults to false. + type: boolean + registry: + description: |- + registry represents a single or multiple Quobyte Registry services + specified as a string as host:port pair (multiple entries are separated with commas) + which acts as the central registry for volumes + type: string + tenant: + description: |- + tenant owning the given Quobyte volume in the Backend + Used with dynamically provisioned Quobyte volumes, value is set by the plugin + type: string + user: + description: |- + user to map volume access to + Defaults to serivceaccount user + type: string + volume: + description: volume is a string that references an already + created Quobyte volume by name. + type: string + required: + - registry + - volume + type: object + rbd: + description: |- + rbd represents a Rados Block Device mount on the host that shares a pod's lifetime. + Deprecated: RBD is deprecated and the in-tree rbd type is no longer supported. + properties: + fsType: + description: |- + fsType is the filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd + type: string + image: + description: |- + image is the rados image name. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it + type: string + keyring: + default: /etc/ceph/keyring + description: |- + keyring is the path to key ring for RBDUser. + Default is /etc/ceph/keyring. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it + type: string + monitors: + description: |- + monitors is a collection of Ceph monitors. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it + items: + type: string + type: array + x-kubernetes-list-type: atomic + pool: + default: rbd + description: |- + pool is the rados pool name. + Default is rbd. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it + type: string + readOnly: + description: |- + readOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it + type: boolean + secretRef: + description: |- + secretRef is name of the authentication secret for RBDUser. If provided + overrides keyring. + Default is nil. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it + properties: + name: + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + type: object + x-kubernetes-map-type: atomic + user: + default: admin + description: |- + user is the rados user name. + Default is admin. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it + type: string + required: + - image + - monitors + type: object + scaleIO: + description: |- + scaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes. + Deprecated: ScaleIO is deprecated and the in-tree scaleIO type is no longer supported. + properties: + fsType: + default: xfs + description: |- + fsType is the filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". + Default is "xfs". + type: string + gateway: + description: gateway is the host address of the ScaleIO + API Gateway. + type: string + protectionDomain: + description: protectionDomain is the name of the ScaleIO + Protection Domain for the configured storage. + type: string + readOnly: + description: |- + readOnly Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + type: boolean + secretRef: + description: |- + secretRef references to the secret for ScaleIO user and other + sensitive information. If this is not provided, Login operation will fail. + properties: + name: + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + type: object + x-kubernetes-map-type: atomic + sslEnabled: + description: sslEnabled Flag enable/disable SSL communication + with Gateway, default false + type: boolean + storageMode: + default: ThinProvisioned + description: |- + storageMode indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned. + Default is ThinProvisioned. + type: string + storagePool: + description: storagePool is the ScaleIO Storage Pool + associated with the protection domain. + type: string + system: + description: system is the name of the storage system + as configured in ScaleIO. + type: string + volumeName: + description: |- + volumeName is the name of a volume already created in the ScaleIO system + that is associated with this volume source. + type: string + required: + - gateway + - secretRef + - system + type: object + secret: + description: |- + secret represents a secret that should populate this volume. + More info: https://kubernetes.io/docs/concepts/storage/volumes#secret + properties: + defaultMode: + description: |- + defaultMode is Optional: mode bits used to set permissions on created files by default. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values + for mode bits. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. + format: int32 + type: integer + items: + description: |- + items If unspecified, each key-value pair in the Data field of the referenced + Secret will be projected into the volume as a file whose name is the + key and content is the value. If specified, the listed keys will be + projected into the specified paths, and unlisted keys will not be + present. If a key is specified which is not present in the Secret, + the volume setup will error unless it is marked optional. Paths must be + relative and may not contain the '..' path or start with '..'. + items: + description: Maps a string key to a path within a + volume. + properties: + key: + description: key is the key to project. + type: string + mode: + description: |- + mode is Optional: mode bits used to set permissions on this file. + Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. + YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. + If not specified, the volume defaultMode will be used. + This might be in conflict with other options that affect the file + mode, like fsGroup, and the result can be other mode bits set. + format: int32 + type: integer + path: + description: |- + path is the relative path of the file to map the key to. + May not be an absolute path. + May not contain the path element '..'. + May not start with the string '..'. + type: string + required: + - key + - path + type: object + type: array + x-kubernetes-list-type: atomic + optional: + description: optional field specify whether the Secret + or its keys must be defined + type: boolean + secretName: + description: |- + secretName is the name of the secret in the pod's namespace to use. + More info: https://kubernetes.io/docs/concepts/storage/volumes#secret + type: string + type: object + storageos: + description: |- + storageOS represents a StorageOS volume attached and mounted on Kubernetes nodes. + Deprecated: StorageOS is deprecated and the in-tree storageos type is no longer supported. + properties: + fsType: + description: |- + fsType is the filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + type: string + readOnly: + description: |- + readOnly defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + type: boolean + secretRef: + description: |- + secretRef specifies the secret to use for obtaining the StorageOS API + credentials. If not specified, default values will be attempted. + properties: + name: + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + type: object + x-kubernetes-map-type: atomic + volumeName: + description: |- + volumeName is the human-readable name of the StorageOS volume. Volume + names are only unique within a namespace. + type: string + volumeNamespace: + description: |- + volumeNamespace specifies the scope of the volume within StorageOS. If no + namespace is specified then the Pod's namespace will be used. This allows the + Kubernetes name scoping to be mirrored within StorageOS for tighter integration. + Set VolumeName to any name to override the default behaviour. + Set to "default" if you are not using namespaces within StorageOS. + Namespaces that do not pre-exist within StorageOS will be created. + type: string + type: object + vsphereVolume: + description: |- + vsphereVolume represents a vSphere volume attached and mounted on kubelets host machine. + Deprecated: VsphereVolume is deprecated. All operations for the in-tree vsphereVolume type + are redirected to the csi.vsphere.vmware.com CSI driver. + properties: + fsType: + description: |- + fsType is filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + type: string + storagePolicyID: + description: storagePolicyID is the storage Policy Based + Management (SPBM) profile ID associated with the StoragePolicyName. + type: string + storagePolicyName: + description: storagePolicyName is the storage Policy + Based Management (SPBM) profile name. + type: string + volumePath: + description: volumePath is the path that identifies + vSphere volume vmdk + type: string + required: + - volumePath + type: object + required: + - name + type: object + type: array type: object proxyProtocol: description: proxyProtocol enables PROXY protocol on a dedicated port @@ -1635,6 +3620,416 @@ spec: type: string type: object type: object + volumeClaimTemplates: + description: |- + volumeClaimTemplates are appended verbatim to the generated StatefulSet's + spec.volumeClaimTemplates. Each template yields one PVC per replica + (named --) that persists across pod restarts + for that replica. Useful for per-replica SSD-backed file storage. + Reference the claim name from spec.pod.volumeMounts; reference the + resulting mountPath from spec.storage[].path. + items: + description: PersistentVolumeClaim is a user's request for and claim + to a persistent volume + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + description: |- + Standard object's metadata. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + type: object + spec: + description: |- + spec defines the desired characteristics of a volume requested by a pod author. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims + properties: + accessModes: + description: |- + accessModes contains the desired access modes the volume should have. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1 + items: + type: string + type: array + x-kubernetes-list-type: atomic + dataSource: + description: |- + dataSource field can be used to specify either: + * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) + * An existing PVC (PersistentVolumeClaim) + If the provisioner or an external controller can support the specified data source, + it will create a new volume based on the contents of the specified data source. + When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef, + and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified. + If the namespace is specified, then dataSourceRef will not be copied to dataSource. + properties: + apiGroup: + description: |- + APIGroup is the group for the resource being referenced. + If APIGroup is not specified, the specified Kind must be in the core API group. + For any other third-party types, APIGroup is required. + type: string + kind: + description: Kind is the type of resource being referenced + type: string + name: + description: Name is the name of resource being referenced + type: string + required: + - kind + - name + type: object + x-kubernetes-map-type: atomic + dataSourceRef: + description: |- + dataSourceRef specifies the object from which to populate the volume with data, if a non-empty + volume is desired. This may be any object from a non-empty API group (non + core object) or a PersistentVolumeClaim object. + When this field is specified, volume binding will only succeed if the type of + the specified object matches some installed volume populator or dynamic + provisioner. + This field will replace the functionality of the dataSource field and as such + if both fields are non-empty, they must have the same value. For backwards + compatibility, when namespace isn't specified in dataSourceRef, + both fields (dataSource and dataSourceRef) will be set to the same + value automatically if one of them is empty and the other is non-empty. + When namespace is specified in dataSourceRef, + dataSource isn't set to the same value and must be empty. + There are three important differences between dataSource and dataSourceRef: + * While dataSource only allows two specific types of objects, dataSourceRef + allows any non-core object, as well as PersistentVolumeClaim objects. + * While dataSource ignores disallowed values (dropping them), dataSourceRef + preserves all values, and generates an error if a disallowed value is + specified. + * While dataSource only allows local objects, dataSourceRef allows objects + in any namespaces. + (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled. + (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled. + properties: + apiGroup: + description: |- + APIGroup is the group for the resource being referenced. + If APIGroup is not specified, the specified Kind must be in the core API group. + For any other third-party types, APIGroup is required. + type: string + kind: + description: Kind is the type of resource being referenced + type: string + name: + description: Name is the name of resource being referenced + type: string + namespace: + description: |- + Namespace is the namespace of resource being referenced + Note that when a namespace is specified, a gateway.networking.k8s.io/ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details. + (Alpha) This field requires the CrossNamespaceVolumeDataSource feature gate to be enabled. + type: string + required: + - kind + - name + type: object + resources: + description: |- + resources represents the minimum resources the volume should have. + Users are allowed to specify resource requirements + that are lower than previous value but must still be higher than capacity recorded in the + status field of the claim. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: |- + Limits describes the maximum amount of compute resources allowed. + More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: |- + Requests describes the minimum amount of compute resources required. + If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, + otherwise to an implementation-defined value. Requests cannot exceed Limits. + More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + type: object + type: object + selector: + description: selector is a label query over volumes to consider + for binding. + properties: + matchExpressions: + description: matchExpressions is a list of label selector + requirements. The requirements are ANDed. + items: + description: |- + A label selector requirement is a selector that contains values, a key, and an operator that + relates the key and values. + properties: + key: + description: key is the label key that the selector + applies to. + type: string + operator: + description: |- + operator represents a key's relationship to a set of values. + Valid operators are In, NotIn, Exists and DoesNotExist. + type: string + values: + description: |- + values is an array of string values. If the operator is In or NotIn, + the values array must be non-empty. If the operator is Exists or DoesNotExist, + the values array must be empty. This array is replaced during a strategic + merge patch. + items: + type: string + type: array + x-kubernetes-list-type: atomic + required: + - key + - operator + type: object + type: array + x-kubernetes-list-type: atomic + matchLabels: + additionalProperties: + type: string + description: |- + matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, whose key field is "key", the + operator is "In", and the values array contains only "value". The requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + storageClassName: + description: |- + storageClassName is the name of the StorageClass required by the claim. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1 + type: string + volumeAttributesClassName: + description: |- + volumeAttributesClassName may be used to set the VolumeAttributesClass used by this claim. + If specified, the CSI driver will create or update the volume with the attributes defined + in the corresponding VolumeAttributesClass. This has a different purpose than storageClassName, + it can be changed after the claim is created. An empty string or nil value indicates that no + VolumeAttributesClass will be applied to the claim. If the claim enters an Infeasible error state, + this field can be reset to its previous value (including nil) to cancel the modification. + If the resource referred to by volumeAttributesClass does not exist, this PersistentVolumeClaim will be + set to a Pending state, as reflected by the modifyVolumeStatus field, until such as a resource + exists. + More info: https://kubernetes.io/docs/concepts/storage/volume-attributes-classes/ + type: string + volumeMode: + description: |- + volumeMode defines what type of volume is required by the claim. + Value of Filesystem is implied when not included in claim spec. + type: string + volumeName: + description: volumeName is the binding reference to the + PersistentVolume backing this claim. + type: string + type: object + status: + description: |- + status represents the current information/status of a persistent volume claim. + Read-only. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims + properties: + accessModes: + description: |- + accessModes contains the actual access modes the volume backing the PVC has. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1 + items: + type: string + type: array + x-kubernetes-list-type: atomic + allocatedResourceStatuses: + additionalProperties: + description: |- + When a controller receives persistentvolume claim update with ClaimResourceStatus for a resource + that it does not recognizes, then it should ignore that update and let other controllers + handle it. + type: string + description: "allocatedResourceStatuses stores status of + resource being resized for the given PVC.\nKey names follow + standard Kubernetes label syntax. Valid values are either:\n\t* + Un-prefixed keys:\n\t\t- storage - the capacity of the + volume.\n\t* Custom resources must use implementation-defined + prefixed names such as \"example.com/my-custom-resource\"\nApart + from above values - keys that are unprefixed or have kubernetes.io + prefix are considered\nreserved and hence may not be used.\n\nClaimResourceStatus + can be in any of following states:\n\t- ControllerResizeInProgress:\n\t\tState + set when resize controller starts resizing the volume + in control-plane.\n\t- ControllerResizeFailed:\n\t\tState + set when resize has failed in resize controller with a + terminal error.\n\t- NodeResizePending:\n\t\tState set + when resize controller has finished resizing the volume + but further resizing of\n\t\tvolume is needed on the node.\n\t- + NodeResizeInProgress:\n\t\tState set when kubelet starts + resizing the volume.\n\t- NodeResizeFailed:\n\t\tState + set when resizing has failed in kubelet with a terminal + error. Transient errors don't set\n\t\tNodeResizeFailed.\nFor + example: if expanding a PVC for more capacity - this field + can be one of the following states:\n\t- pvc.status.allocatedResourceStatus['storage'] + = \"ControllerResizeInProgress\"\n - pvc.status.allocatedResourceStatus['storage'] + = \"ControllerResizeFailed\"\n - pvc.status.allocatedResourceStatus['storage'] + = \"NodeResizePending\"\n - pvc.status.allocatedResourceStatus['storage'] + = \"NodeResizeInProgress\"\n - pvc.status.allocatedResourceStatus['storage'] + = \"NodeResizeFailed\"\nWhen this field is not set, it + means that no resize operation is in progress for the + given PVC.\n\nA controller that receives PVC update with + previously unknown resourceName or ClaimResourceStatus\nshould + ignore the update for the purpose it was designed. For + example - a controller that\nonly is responsible for resizing + capacity of the volume, should ignore PVC updates that + change other valid\nresources associated with PVC." + type: object + x-kubernetes-map-type: granular + allocatedResources: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: "allocatedResources tracks the resources allocated + to a PVC including its capacity.\nKey names follow standard + Kubernetes label syntax. Valid values are either:\n\t* + Un-prefixed keys:\n\t\t- storage - the capacity of the + volume.\n\t* Custom resources must use implementation-defined + prefixed names such as \"example.com/my-custom-resource\"\nApart + from above values - keys that are unprefixed or have kubernetes.io + prefix are considered\nreserved and hence may not be used.\n\nCapacity + reported here may be larger than the actual capacity when + a volume expansion operation\nis requested.\nFor storage + quota, the larger value from allocatedResources and PVC.spec.resources + is used.\nIf allocatedResources is not set, PVC.spec.resources + alone is used for quota calculation.\nIf a volume expansion + capacity request is lowered, allocatedResources is only\nlowered + if there are no expansion operations in progress and if + the actual volume capacity\nis equal or lower than the + requested capacity.\n\nA controller that receives PVC + update with previously unknown resourceName\nshould ignore + the update for the purpose it was designed. For example + - a controller that\nonly is responsible for resizing + capacity of the volume, should ignore PVC updates that + change other valid\nresources associated with PVC." + type: object + capacity: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: capacity represents the actual resources of + the underlying volume. + type: object + conditions: + description: |- + conditions is the current Condition of persistent volume claim. If underlying persistent volume is being + resized then the Condition will be set to 'Resizing'. + items: + description: PersistentVolumeClaimCondition contains details + about state of pvc + properties: + lastProbeTime: + description: lastProbeTime is the time we probed the + condition. + format: date-time + type: string + lastTransitionTime: + description: lastTransitionTime is the time the condition + transitioned from one status to another. + format: date-time + type: string + message: + description: message is the human-readable message + indicating details about last transition. + type: string + reason: + description: |- + reason is a unique, this should be a short, machine understandable string that gives the reason + for condition's last transition. If it reports "Resizing" that means the underlying + persistent volume is being resized. + type: string + status: + description: |- + Status is the status of the condition. + Can be True, False, Unknown. + More info: https://kubernetes.io/docs/reference/kubernetes-api/config-and-storage-resources/persistent-volume-claim-v1/#:~:text=state%20of%20pvc-,conditions.status,-(string)%2C%20required + type: string + type: + description: |- + Type is the type of the condition. + More info: https://kubernetes.io/docs/reference/kubernetes-api/config-and-storage-resources/persistent-volume-claim-v1/#:~:text=set%20to%20%27ResizeStarted%27.-,PersistentVolumeClaimCondition,-contains%20details%20about + type: string + required: + - status + - type + type: object + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + currentVolumeAttributesClassName: + description: |- + currentVolumeAttributesClassName is the current name of the VolumeAttributesClass the PVC is using. + When unset, there is no VolumeAttributeClass applied to this PersistentVolumeClaim + type: string + modifyVolumeStatus: + description: |- + ModifyVolumeStatus represents the status object of ControllerModifyVolume operation. + When this is unset, there is no ModifyVolume operation being attempted. + properties: + status: + description: "status is the status of the ControllerModifyVolume + operation. It can be in any of following states:\n + - Pending\n Pending indicates that the PersistentVolumeClaim + cannot be modified due to unmet requirements, such + as\n the specified VolumeAttributesClass not existing.\n + - InProgress\n InProgress indicates that the volume + is being modified.\n - Infeasible\n Infeasible indicates + that the request has been rejected as invalid by the + CSI driver. To\n\t resolve the error, a valid VolumeAttributesClass + needs to be specified.\nNote: New statuses can be + added in the future. Consumers should check for unknown + statuses and fail appropriately." + type: string + targetVolumeAttributesClassName: + description: targetVolumeAttributesClassName is the + name of the VolumeAttributesClass the PVC currently + being reconciled + type: string + required: + - status + type: object + phase: + description: phase represents the current phase of PersistentVolumeClaim. + type: string + type: object + type: object + type: array required: - backends - image From 65dca1fc5091ce04565ea38b905ec94e78a68b19 Mon Sep 17 00:00:00 2001 From: "Jens W. Klein" Date: Tue, 21 Apr 2026 00:29:59 +0200 Subject: [PATCH 3/9] feat(controller): pass user volumes/mounts/claim-templates to StatefulSet spec.pod.volumes and spec.pod.volumeMounts are now appended to the operator-managed defaults when building the varnish container. spec.volumeClaimTemplates are passed verbatim onto the StatefulSet spec. Reserved names / paths are still accepted here; the admission webhook (next commit) enforces the constraints. Refs #43 --- internal/controller/endpoints_test.go | 2 + internal/controller/statefulset.go | 11 ++ internal/controller/statefulset_test.go | 157 ++++++++++++++++++++++++ 3 files changed, 170 insertions(+) diff --git a/internal/controller/endpoints_test.go b/internal/controller/endpoints_test.go index f830799..6a241fe 100644 --- a/internal/controller/endpoints_test.go +++ b/internal/controller/endpoints_test.go @@ -6,6 +6,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" discoveryv1 "k8s.io/api/discovery/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -23,6 +24,7 @@ func newScheme(t *testing.T) *runtime.Scheme { t.Helper() s := runtime.NewScheme() require.NoError(t, corev1.AddToScheme(s)) + require.NoError(t, appsv1.AddToScheme(s)) require.NoError(t, discoveryv1.AddToScheme(s)) require.NoError(t, v1alpha1.AddToScheme(s)) return s diff --git a/internal/controller/statefulset.go b/internal/controller/statefulset.go index 27fa638..f81dd3f 100644 --- a/internal/controller/statefulset.go +++ b/internal/controller/statefulset.go @@ -124,6 +124,11 @@ func (r *VinylCacheReconciler) reconcileStatefulSet(ctx context.Context, vc *v1a Resources: vc.Spec.Resources, } + // Append user-declared volume mounts to the varnish container. + if len(vc.Spec.Pod.VolumeMounts) > 0 { + varnishContainer.VolumeMounts = append(varnishContainer.VolumeMounts, vc.Spec.Pod.VolumeMounts...) + } + // Add proxy protocol port if enabled. if vc.Spec.ProxyProtocol.Enabled { ppPort := int32(8081) @@ -228,6 +233,11 @@ func (r *VinylCacheReconciler) reconcileStatefulSet(ctx context.Context, vc *v1a }, } + // Append user-declared pod volumes after the operator-managed defaults. + if len(vc.Spec.Pod.Volumes) > 0 { + volumes = append(volumes, vc.Spec.Pod.Volumes...) + } + uid := int64(65532) podSpec := corev1.PodSpec{ Containers: []corev1.Container{varnishContainer, agentContainer}, @@ -257,6 +267,7 @@ func (r *VinylCacheReconciler) reconcileStatefulSet(ctx context.Context, vc *v1a }, Spec: podSpec, }, + VolumeClaimTemplates: vc.Spec.VolumeClaimTemplates, } return nil diff --git a/internal/controller/statefulset_test.go b/internal/controller/statefulset_test.go index ff7c62e..9dbe5c4 100644 --- a/internal/controller/statefulset_test.go +++ b/internal/controller/statefulset_test.go @@ -1,10 +1,17 @@ package controller import ( + "context" "testing" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + appsv1 "k8s.io/api/apps/v1" + corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" + "sigs.k8s.io/controller-runtime/pkg/client/fake" v1alpha1 "github.com/bluedynamics/cloud-vinyl/api/v1alpha1" ) @@ -38,3 +45,153 @@ func TestStorageArgs_Empty(t *testing.T) { assert.Nil(t, storageArgs(nil)) assert.Nil(t, storageArgs([]v1alpha1.StorageSpec{})) } + +func TestReconcileStatefulSet_UserVolumesAndMountsAppended(t *testing.T) { + sch := newScheme(t) + quantity := resource.MustParse("100Mi") + vc := &v1alpha1.VinylCache{ + ObjectMeta: metav1.ObjectMeta{Name: "my-cache", Namespace: "app"}, + Spec: v1alpha1.VinylCacheSpec{ + Replicas: 1, + Image: "varnish:7.6", + Backends: []v1alpha1.BackendSpec{{ + Name: "app", ServiceRef: v1alpha1.ServiceRef{Name: "svc"}, + }}, + Pod: v1alpha1.PodSpec{ + Volumes: []corev1.Volume{ + { + Name: "cache-ssd", + VolumeSource: corev1.VolumeSource{ + EmptyDir: &corev1.EmptyDirVolumeSource{ + SizeLimit: &quantity, + }, + }, + }, + }, + VolumeMounts: []corev1.VolumeMount{ + {Name: "cache-ssd", MountPath: "/var/lib/varnish-cache"}, + }, + }, + }, + } + cli := fake.NewClientBuilder().WithScheme(sch).Build() + r := &VinylCacheReconciler{Client: cli, Scheme: sch} + require.NoError(t, r.reconcileStatefulSet(context.Background(), vc)) + + ss := &appsv1.StatefulSet{} + require.NoError(t, cli.Get(context.Background(), + types.NamespacedName{Name: vc.Name, Namespace: vc.Namespace}, ss)) + + // User volume present in pod spec. + var foundVolume bool + for _, v := range ss.Spec.Template.Spec.Volumes { + if v.Name == "cache-ssd" { + foundVolume = true + require.NotNil(t, v.EmptyDir) + require.NotNil(t, v.EmptyDir.SizeLimit) + assert.Equal(t, "100Mi", v.EmptyDir.SizeLimit.String()) + } + } + assert.True(t, foundVolume, "user volume 'cache-ssd' must be appended to pod volumes") + + // User mount present on the varnish container. + var varnish *corev1.Container + for i := range ss.Spec.Template.Spec.Containers { + if ss.Spec.Template.Spec.Containers[i].Name == "varnish" { + varnish = &ss.Spec.Template.Spec.Containers[i] + } + } + require.NotNil(t, varnish) + var foundMount bool + for _, m := range varnish.VolumeMounts { + if m.Name == "cache-ssd" { + foundMount = true + assert.Equal(t, "/var/lib/varnish-cache", m.MountPath) + } + } + assert.True(t, foundMount, "user volumeMount must be appended to varnish container") + + // Reserved volumes still present. + reserved := []string{"agent-token", "varnish-secret", "varnish-workdir", "varnish-tmp", "bootstrap-vcl"} + for _, rn := range reserved { + var found bool + for _, v := range ss.Spec.Template.Spec.Volumes { + if v.Name == rn { + found = true + } + } + assert.True(t, found, "reserved volume %q must remain present", rn) + } +} + +func TestReconcileStatefulSet_VolumeClaimTemplatesPassthrough(t *testing.T) { + sch := newScheme(t) + storageClass := "hcloud-volumes" + vc := &v1alpha1.VinylCache{ + ObjectMeta: metav1.ObjectMeta{Name: "my-cache", Namespace: "app"}, + Spec: v1alpha1.VinylCacheSpec{ + Replicas: 2, + Image: "varnish:7.6", + Backends: []v1alpha1.BackendSpec{{ + Name: "app", ServiceRef: v1alpha1.ServiceRef{Name: "svc"}, + }}, + VolumeClaimTemplates: []corev1.PersistentVolumeClaim{{ + ObjectMeta: metav1.ObjectMeta{Name: "cache-ssd"}, + Spec: corev1.PersistentVolumeClaimSpec{ + AccessModes: []corev1.PersistentVolumeAccessMode{corev1.ReadWriteOnce}, + StorageClassName: &storageClass, + Resources: corev1.VolumeResourceRequirements{ + Requests: corev1.ResourceList{ + corev1.ResourceStorage: resource.MustParse("80Gi"), + }, + }, + }, + }}, + Pod: v1alpha1.PodSpec{ + VolumeMounts: []corev1.VolumeMount{ + {Name: "cache-ssd", MountPath: "/var/lib/varnish-cache"}, + }, + }, + }, + } + cli := fake.NewClientBuilder().WithScheme(sch).Build() + r := &VinylCacheReconciler{Client: cli, Scheme: sch} + require.NoError(t, r.reconcileStatefulSet(context.Background(), vc)) + + ss := &appsv1.StatefulSet{} + require.NoError(t, cli.Get(context.Background(), + types.NamespacedName{Name: vc.Name, Namespace: vc.Namespace}, ss)) + + require.Len(t, ss.Spec.VolumeClaimTemplates, 1) + pvc := ss.Spec.VolumeClaimTemplates[0] + assert.Equal(t, "cache-ssd", pvc.Name) + require.NotNil(t, pvc.Spec.StorageClassName) + assert.Equal(t, "hcloud-volumes", *pvc.Spec.StorageClassName) + assert.Equal(t, "80Gi", pvc.Spec.Resources.Requests.Storage().String()) +} + +func TestReconcileStatefulSet_NoUserVolumes_DefaultsUnchanged(t *testing.T) { + sch := newScheme(t) + vc := &v1alpha1.VinylCache{ + ObjectMeta: metav1.ObjectMeta{Name: "my-cache", Namespace: "app"}, + Spec: v1alpha1.VinylCacheSpec{ + Replicas: 1, + Image: "varnish:7.6", + Backends: []v1alpha1.BackendSpec{{ + Name: "app", ServiceRef: v1alpha1.ServiceRef{Name: "svc"}, + }}, + }, + } + cli := fake.NewClientBuilder().WithScheme(sch).Build() + r := &VinylCacheReconciler{Client: cli, Scheme: sch} + require.NoError(t, r.reconcileStatefulSet(context.Background(), vc)) + + ss := &appsv1.StatefulSet{} + require.NoError(t, cli.Get(context.Background(), + types.NamespacedName{Name: vc.Name, Namespace: vc.Namespace}, ss)) + + assert.Empty(t, ss.Spec.VolumeClaimTemplates, + "no user claim templates -> VolumeClaimTemplates stays empty") + assert.Len(t, ss.Spec.Template.Spec.Volumes, 5, + "no user volumes -> only the 5 operator-managed volumes remain") +} From cc9418140d5a66160ad52c0bc51fe7206896c762 Mon Sep 17 00:00:00 2001 From: "Jens W. Klein" Date: Tue, 21 Apr 2026 00:35:07 +0200 Subject: [PATCH 4/9] feat(webhook): validate user volumes/mounts/claim-templates Reject: - reserved volume names (agent-token, varnish-secret, varnish-workdir, varnish-tmp, bootstrap-vcl) in spec.pod.volumes and spec.volumeClaimTemplates. - duplicate names across spec.pod.volumes and spec.volumeClaimTemplates. - spec.pod.volumeMounts with reserved mount paths (/run/vinyl, /etc/varnish/secret, /etc/varnish/default.vcl, /var/lib/varnish, /tmp) or with a name that does not resolve to any declared volume. - spec.storage[type=file].path that writes into a reserved operator mount. Refs #43 --- internal/webhook/vinylcache_validator.go | 91 ++++++++++++++ internal/webhook/vinylcache_validator_test.go | 116 ++++++++++++++++++ 2 files changed, 207 insertions(+) diff --git a/internal/webhook/vinylcache_validator.go b/internal/webhook/vinylcache_validator.go index 1edda27..6db607e 100644 --- a/internal/webhook/vinylcache_validator.go +++ b/internal/webhook/vinylcache_validator.go @@ -51,6 +51,43 @@ var forbiddenStorageTypes = map[string]bool{ "default": true, } +// reservedVolumeNames collide with operator-managed volumes on every pod. +// Users cannot reuse these names in spec.pod.volumes or +// spec.volumeClaimTemplates. +var reservedVolumeNames = map[string]bool{ + "agent-token": true, + "varnish-secret": true, + "varnish-workdir": true, + "varnish-tmp": true, + "bootstrap-vcl": true, +} + +// reservedMountPaths are owned by the operator. spec.pod.volumeMounts +// must not mount into these, and spec.storage[].path must not place +// files under them. +var reservedMountPaths = []string{ + "/run/vinyl", + "/etc/varnish/secret", + "/etc/varnish/default.vcl", + "/var/lib/varnish", + "/tmp", +} + +// pathIsReserved reports whether p equals a reserved mount path or sits +// under one (with a trailing slash boundary to avoid false positives +// like "/var/lib/varnish-cache" hitting "/var/lib/varnish"). +func pathIsReserved(p string) bool { + for _, r := range reservedMountPaths { + if p == r { + return true + } + if strings.HasPrefix(p, r+"/") { + return true + } + } + return false +} + // ValidateVinylCache performs semantic validation of a VinylCache resource that is not // expressible as CRD schema constraints. It is called by both ValidateCreate and ValidateUpdate. // @@ -99,6 +136,60 @@ func ValidateVinylCache(vc *vinylv1alpha1.VinylCache) (admission.Warnings, error } } + // Collect all user-declared volume names (pod.volumes + volumeClaimTemplates). + declared := make(map[string]bool, len(vc.Spec.Pod.Volumes)+len(vc.Spec.VolumeClaimTemplates)) + + for _, v := range vc.Spec.Pod.Volumes { + if reservedVolumeNames[v.Name] { + errs = append(errs, fmt.Sprintf( + "spec.pod.volumes[%q]: name is reserved by the operator", v.Name)) + continue + } + if declared[v.Name] { + errs = append(errs, fmt.Sprintf( + "spec.pod.volumes[%q]: duplicate volume name", v.Name)) + continue + } + declared[v.Name] = true + } + + for _, c := range vc.Spec.VolumeClaimTemplates { + if reservedVolumeNames[c.Name] { + errs = append(errs, fmt.Sprintf( + "spec.volumeClaimTemplates[%q]: name is reserved by the operator", c.Name)) + continue + } + if declared[c.Name] { + errs = append(errs, fmt.Sprintf( + "spec.volumeClaimTemplates[%q]: duplicate — name already used in spec.pod.volumes or another claim template", c.Name)) + continue + } + declared[c.Name] = true + } + + // Validate mount paths + that each mount resolves to a declared volume. + for _, m := range vc.Spec.Pod.VolumeMounts { + if pathIsReserved(m.MountPath) { + errs = append(errs, fmt.Sprintf( + "spec.pod.volumeMounts[%q]: mountPath %q is reserved by the operator", + m.Name, m.MountPath)) + } + if !declared[m.Name] && !reservedVolumeNames[m.Name] { + errs = append(errs, fmt.Sprintf( + "spec.pod.volumeMounts[%q]: volume is not declared in spec.pod.volumes or spec.volumeClaimTemplates", + m.Name)) + } + } + + // Validate spec.storage[].path does not write into a reserved mount. + for _, s := range vc.Spec.Storage { + if s.Type == "file" && pathIsReserved(s.Path) { + errs = append(errs, fmt.Sprintf( + "spec.storage[%q].path %q is reserved by the operator; mount your own volume and place the cache file there", + s.Name, s.Path)) + } + } + if len(errs) > 0 { return nil, fmt.Errorf("%s", strings.Join(errs, "; ")) } diff --git a/internal/webhook/vinylcache_validator_test.go b/internal/webhook/vinylcache_validator_test.go index 6df11b1..90bc3fa 100644 --- a/internal/webhook/vinylcache_validator_test.go +++ b/internal/webhook/vinylcache_validator_test.go @@ -21,6 +21,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + corev1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/resource" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" vinylv1alpha1 "github.com/bluedynamics/cloud-vinyl/api/v1alpha1" "github.com/bluedynamics/cloud-vinyl/internal/webhook" @@ -429,3 +432,116 @@ func TestValidate_ValidFullConfig_Passes(t *testing.T) { _, err := webhook.ValidateVinylCache(vc) assert.NoError(t, err) } + +// --- pod volumes, volumeMounts, volumeClaimTemplates, and storage path collisions --- + +// validBaseVinylCache returns a minimally valid VinylCache with ObjectMeta set, +// used by tests that exercise pod.volumes, pod.volumeMounts, volumeClaimTemplates, +// and storage-path collision validation. +func validBaseVinylCache() *vinylv1alpha1.VinylCache { + return &vinylv1alpha1.VinylCache{ + ObjectMeta: metav1.ObjectMeta{Name: "vc", Namespace: "ns"}, + Spec: vinylv1alpha1.VinylCacheSpec{ + Replicas: 1, + Image: "varnish:7.6", + Backends: []vinylv1alpha1.BackendSpec{ + {Name: "app", ServiceRef: vinylv1alpha1.ServiceRef{Name: "svc"}}, + }, + }, + } +} + +func TestValidate_PodVolumeName_ReservedIsRejected(t *testing.T) { + vc := validBaseVinylCache() + vc.Spec.Pod.Volumes = []corev1.Volume{{ + Name: "varnish-workdir", // reserved + VolumeSource: corev1.VolumeSource{EmptyDir: &corev1.EmptyDirVolumeSource{}}, + }} + _, err := webhook.ValidateVinylCache(vc) + require.Error(t, err) + assert.Contains(t, err.Error(), "varnish-workdir") + assert.Contains(t, err.Error(), "reserved") +} + +func TestValidate_VolumeClaimTemplateName_ReservedIsRejected(t *testing.T) { + vc := validBaseVinylCache() + vc.Spec.VolumeClaimTemplates = []corev1.PersistentVolumeClaim{{ + ObjectMeta: metav1.ObjectMeta{Name: "bootstrap-vcl"}, // reserved + }} + _, err := webhook.ValidateVinylCache(vc) + require.Error(t, err) + assert.Contains(t, err.Error(), "bootstrap-vcl") +} + +func TestValidate_VolumeNameDuplicate_AcrossVolumesAndClaims_Rejected(t *testing.T) { + vc := validBaseVinylCache() + vc.Spec.Pod.Volumes = []corev1.Volume{{ + Name: "cache-ssd", + VolumeSource: corev1.VolumeSource{EmptyDir: &corev1.EmptyDirVolumeSource{}}, + }} + vc.Spec.VolumeClaimTemplates = []corev1.PersistentVolumeClaim{{ + ObjectMeta: metav1.ObjectMeta{Name: "cache-ssd"}, + }} + _, err := webhook.ValidateVinylCache(vc) + require.Error(t, err) + assert.Contains(t, err.Error(), "cache-ssd") + assert.Contains(t, err.Error(), "duplicate") +} + +func TestValidate_VolumeMountPath_ReservedIsRejected(t *testing.T) { + vc := validBaseVinylCache() + vc.Spec.Pod.Volumes = []corev1.Volume{{ + Name: "my-ssd", + VolumeSource: corev1.VolumeSource{EmptyDir: &corev1.EmptyDirVolumeSource{}}, + }} + vc.Spec.Pod.VolumeMounts = []corev1.VolumeMount{ + {Name: "my-ssd", MountPath: "/var/lib/varnish"}, // reserved + } + _, err := webhook.ValidateVinylCache(vc) + require.Error(t, err) + assert.Contains(t, err.Error(), "/var/lib/varnish") +} + +func TestValidate_VolumeMountName_Unresolvable_Rejected(t *testing.T) { + vc := validBaseVinylCache() + vc.Spec.Pod.VolumeMounts = []corev1.VolumeMount{ + {Name: "nonexistent", MountPath: "/data"}, + } + _, err := webhook.ValidateVinylCache(vc) + require.Error(t, err) + assert.Contains(t, err.Error(), "nonexistent") + assert.Contains(t, err.Error(), "not declared") +} + +func TestValidate_StoragePath_UnderReservedMount_Rejected(t *testing.T) { + vc := validBaseVinylCache() + vc.Spec.Storage = []vinylv1alpha1.StorageSpec{{ + Name: "disk", + Type: "file", + Path: "/var/lib/varnish/spill.bin", // under reserved /var/lib/varnish + Size: resource.MustParse("10Gi"), + }} + _, err := webhook.ValidateVinylCache(vc) + require.Error(t, err) + assert.Contains(t, err.Error(), "/var/lib/varnish") + assert.Contains(t, err.Error(), "storage") +} + +func TestValidate_StoragePath_UnderUserMount_Accepted(t *testing.T) { + vc := validBaseVinylCache() + vc.Spec.Pod.Volumes = []corev1.Volume{{ + Name: "cache-ssd", + VolumeSource: corev1.VolumeSource{EmptyDir: &corev1.EmptyDirVolumeSource{}}, + }} + vc.Spec.Pod.VolumeMounts = []corev1.VolumeMount{ + {Name: "cache-ssd", MountPath: "/var/lib/varnish-cache"}, + } + vc.Spec.Storage = []vinylv1alpha1.StorageSpec{{ + Name: "disk", + Type: "file", + Path: "/var/lib/varnish-cache/spill.bin", + Size: resource.MustParse("10Gi"), + }} + _, err := webhook.ValidateVinylCache(vc) + require.NoError(t, err) +} From c0e983a529b4c0858bf7e275a6f2dea3cb0b181f Mon Sep 17 00:00:00 2001 From: "Jens W. Klein" Date: Tue, 21 Apr 2026 00:39:20 +0200 Subject: [PATCH 5/9] test(e2e): exercise spec.pod.volumes + spec.storage interaction MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Creates a VinylCache with a user EmptyDir volume mounted at a path that spec.storage[type=file].path writes into. Asserts the generated StatefulSet contains the user volume + mount, and the VinylCache reaches Ready phase under this configuration. Does not exercise volumeClaimTemplates (Kind has no default SSD StorageClass in CI) — unit tests cover the passthrough. Refs #43 --- .../vinylcaches/ssd-backed-storage.yaml | 29 ++++++++ e2e/tests/volumes-and-pvc/chainsaw-test.yaml | 68 +++++++++++++++++++ 2 files changed, 97 insertions(+) create mode 100644 e2e/fixtures/vinylcaches/ssd-backed-storage.yaml create mode 100644 e2e/tests/volumes-and-pvc/chainsaw-test.yaml diff --git a/e2e/fixtures/vinylcaches/ssd-backed-storage.yaml b/e2e/fixtures/vinylcaches/ssd-backed-storage.yaml new file mode 100644 index 0000000..fe24762 --- /dev/null +++ b/e2e/fixtures/vinylcaches/ssd-backed-storage.yaml @@ -0,0 +1,29 @@ +apiVersion: vinyl.bluedynamics.eu/v1alpha1 +kind: VinylCache +metadata: + name: ssd-cache +spec: + replicas: 1 + image: varnish:7.6 + backends: + - name: app + port: 80 + serviceRef: + name: echo-backend + storage: + - name: disk + type: file + path: /var/lib/varnish-cache/spill.bin + size: 100Mi + pod: + volumes: + - name: cache-ssd + emptyDir: + sizeLimit: 200Mi + - name: another-vol + emptyDir: {} + volumeMounts: + - name: cache-ssd + mountPath: /var/lib/varnish-cache + - name: another-vol + mountPath: /var/cache/extra diff --git a/e2e/tests/volumes-and-pvc/chainsaw-test.yaml b/e2e/tests/volumes-and-pvc/chainsaw-test.yaml new file mode 100644 index 0000000..d96c98d --- /dev/null +++ b/e2e/tests/volumes-and-pvc/chainsaw-test.yaml @@ -0,0 +1,68 @@ +apiVersion: chainsaw.kyverno.io/v1alpha1 +kind: Test +metadata: + name: volumes-and-pvc +spec: + description: | + Verify spec.pod.volumes and spec.pod.volumeMounts are passed through + to the generated StatefulSet and the VinylCache reaches Ready phase + with a user-declared EmptyDir mounted under a path consumed by + spec.storage[].path. + timeouts: + apply: 10s + assert: 180s + delete: 60s + cleanup: 60s + exec: 30s + steps: + - name: deploy-backend + try: + - apply: + file: ../../fixtures/backends/echo-service.yaml + - assert: + resource: + apiVersion: apps/v1 + kind: Deployment + metadata: + name: echo-backend + status: + readyReplicas: 1 + + - name: deploy-cache-with-ssd-volume + try: + - apply: + file: ../../fixtures/vinylcaches/ssd-backed-storage.yaml + - assert: + resource: + apiVersion: vinyl.bluedynamics.eu/v1alpha1 + kind: VinylCache + metadata: + name: ssd-cache + status: + phase: Ready + + - name: verify-statefulset-has-user-volumes + try: + - assert: + resource: + apiVersion: apps/v1 + kind: StatefulSet + metadata: + name: ssd-cache + spec: + template: + spec: + (volumes[?name=='cache-ssd']): + - name: cache-ssd + emptyDir: + sizeLimit: 200Mi + (containers[?name=='varnish'].volumeMounts[?name=='cache-ssd']): + - - name: cache-ssd + mountPath: /var/lib/varnish-cache + + - name: cleanup + try: + - delete: + file: ../../fixtures/vinylcaches/ssd-backed-storage.yaml + - delete: + file: ../../fixtures/backends/echo-service.yaml From 007dce7ad4bd3c4f5df493963dd2e423ff03d50a Mon Sep 17 00:00:00 2001 From: "Jens W. Klein" Date: Tue, 21 Apr 2026 00:40:19 +0200 Subject: [PATCH 6/9] docs: how-to for SSD-backed spec.storage via pod volumes / PVC New how-to covers EmptyDir-with-sizeLimit and StatefulSet volumeClaimTemplates (per-pod PVC) as ways to back spec.storage[type=file].path. Reference table gains entries for spec.pod.volumes, spec.pod.volumeMounts, and spec.volumeClaimTemplates. Refs #43 --- docs/sources/how-to/index.md | 1 + docs/sources/how-to/ssd-backed-storage.md | 100 ++++++++++++++++++++++ docs/sources/reference/vinylcache-spec.md | 3 + 3 files changed, 104 insertions(+) create mode 100644 docs/sources/how-to/ssd-backed-storage.md diff --git a/docs/sources/how-to/index.md b/docs/sources/how-to/index.md index 96dd9f6..06befc1 100644 --- a/docs/sources/how-to/index.md +++ b/docs/sources/how-to/index.md @@ -7,6 +7,7 @@ Step-by-step guides for common tasks with cloud-vinyl. install create-cache +ssd-backed-storage per-backend-directors purge-ban upgrade diff --git a/docs/sources/how-to/ssd-backed-storage.md b/docs/sources/how-to/ssd-backed-storage.md new file mode 100644 index 0000000..e565359 --- /dev/null +++ b/docs/sources/how-to/ssd-backed-storage.md @@ -0,0 +1,100 @@ +# Back spec.storage[].type=file with a user-provisioned volume + +By default, `spec.storage[].type=file` lands the cache spill file in the operator's `/var/lib/varnish` EmptyDir. That works for small working sets on nodes with SSD-backed ephemeral storage, but has limits: no persistence across pod restart, no `sizeLimit`, no choice of StorageClass, no isolation from node ephemeral use (logs, image layers). + +This guide shows how to back the spill file with (1) an EmptyDir with an explicit size limit, or (2) a StorageClass-provisioned PVC per pod. + +## Option 1 — EmptyDir with sizeLimit (simplest) + +Useful when you want to cap cache disk use and isolate it from node ephemeral capacity, without per-pod persistence. + +```yaml +apiVersion: vinyl.bluedynamics.eu/v1alpha1 +kind: VinylCache +metadata: + name: my-cache +spec: + replicas: 2 + image: varnish:7.6 + backends: + - name: app + serviceRef: + name: app-service + port: 8080 + storage: + - name: mem + type: malloc + size: 1Gi + - name: disk + type: file + path: /var/lib/varnish-cache/spill.bin + size: 50Gi + pod: + volumes: + - name: cache-scratch + emptyDir: + sizeLimit: 60Gi + volumeMounts: + - name: cache-scratch + mountPath: /var/lib/varnish-cache +``` + +The file lives on node ephemeral storage, but capped at 60 GiB regardless of how much the node has. + +## Option 2 — PVC per pod via `volumeClaimTemplates` + +Useful for persistence across pod restarts (faster warmup after a roll), or for isolating cache I/O onto a dedicated SSD StorageClass (`hcloud-volumes`, `gp3`, a CSI-driver-provisioned NVMe, etc.): + +```yaml +apiVersion: vinyl.bluedynamics.eu/v1alpha1 +kind: VinylCache +metadata: + name: my-cache +spec: + replicas: 2 + image: varnish:7.6 + backends: + - name: app + serviceRef: + name: app-service + port: 8080 + storage: + - name: mem + type: malloc + size: 1Gi + - name: disk + type: file + path: /var/lib/varnish-cache/spill.bin + size: 80Gi + volumeClaimTemplates: + - metadata: + name: cache-ssd + spec: + accessModes: [ReadWriteOnce] + storageClassName: hcloud-volumes + resources: + requests: + storage: 100Gi + pod: + volumeMounts: + - name: cache-ssd + mountPath: /var/lib/varnish-cache +``` + +The StatefulSet creates one PVC per replica — `cache-ssd-my-cache-0`, `cache-ssd-my-cache-1`, etc. They persist across pod deletion (StatefulSet semantics) so a rolling restart doesn't throw away the warmed cache. + +Make sure `spec.storage[].size` is well under the PVC size (Varnish needs filesystem overhead — allow ~20%). + +## Reserved names and paths + +These names cannot be used for your volumes (they collide with operator-managed volumes): + +- `agent-token`, `varnish-secret`, `varnish-workdir`, `varnish-tmp`, `bootstrap-vcl` + +These mount paths are reserved by the operator: + +- `/run/vinyl`, `/etc/varnish/secret`, `/etc/varnish/default.vcl`, `/var/lib/varnish`, `/tmp` + +`spec.storage[].path` cannot live under a reserved mount — you must declare your own `pod.volumeMounts` entry that covers the path. + +The admission webhook rejects violations with a clear message. diff --git a/docs/sources/reference/vinylcache-spec.md b/docs/sources/reference/vinylcache-spec.md index cb63729..ff2d3a0 100644 --- a/docs/sources/reference/vinylcache-spec.md +++ b/docs/sources/reference/vinylcache-spec.md @@ -25,6 +25,9 @@ | `proxyProtocol.port` | integer | no | PROXY protocol port (default: `8081` when enabled). | | `service.annotations` | object | no | Annotations on the traffic Service. | | `pod.labels` | object | no | Extra labels on Vinyl Cache pods. | +| `pod.volumes` | list | no | Additional pod volumes appended to operator-managed defaults. Reserved names rejected by webhook. See [SSD-backed storage how-to](../how-to/ssd-backed-storage.md). | +| `pod.volumeMounts` | list | no | Additional mounts on the varnish container. Each `name` must reference a `spec.pod.volumes` entry or a `spec.volumeClaimTemplates` claim name. Reserved mount paths rejected by webhook. | +| `volumeClaimTemplates` | list | no | StatefulSet-native per-replica PVC templates. Reference the claim `name` from `spec.pod.volumeMounts`. | ### backends From e37e99a10ab22fcb93ab109dd1482eedf5a9158b Mon Sep 17 00:00:00 2001 From: "Jens W. Klein" Date: Tue, 21 Apr 2026 00:41:16 +0200 Subject: [PATCH 7/9] docs(reference): fix stale example (host->serviceRef, healthCheck->probe) Spotted while reviewing Task 5 of the pod-volumes plan. Pre-existing staleness unrelated to this feature, but easier to fix now than in a separate PR. Refs #43 --- docs/sources/reference/vinylcache-spec.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/sources/reference/vinylcache-spec.md b/docs/sources/reference/vinylcache-spec.md index ff2d3a0..9614c5c 100644 --- a/docs/sources/reference/vinylcache-spec.md +++ b/docs/sources/reference/vinylcache-spec.md @@ -133,9 +133,10 @@ spec: replicas: 3 backends: - name: api - host: api-service.production.svc.cluster.local + serviceRef: + name: api-service port: 8080 - healthCheck: + probe: url: /healthz interval: 5s threshold: 3 From 7fbf6979d9b3a48bac6da5d72acba23457b1047c Mon Sep 17 00:00:00 2001 From: "Jens W. Klein" Date: Tue, 21 Apr 2026 00:51:08 +0200 Subject: [PATCH 8/9] fix(webhook): reject volumeMounts that are ancestors of reserved paths MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Addresses I-1 from the final code review on PR #45. The previous pathIsReserved check only rejected user mountPaths that equal or sit under a reserved operator path. It did not reject the inverse direction — a mountPath that is an *ancestor* of a reserved path. A user with VinylCache edit rights could declare volumes: - { name: my-vol, emptyDir: {} } volumeMounts: - { name: my-vol, mountPath: /etc/varnish } which kubelet mounts on top of the operator's narrower subPath mounts at /etc/varnish/secret (agent-auth shared secret) and /etc/varnish/default.vcl (bootstrap VCL), effectively shadowing operator-owned data. Since spec.pod doesn't expose securityContext or capabilities, this was a new privilege-escalation vector. Webhook now rejects these via the new pathConflictsWithReserved helper covering both directions. Table-test covers /etc/varnish, /var/lib, and / — the three realistic ancestor shapes. / gets a fast-path since "/" + "/" = "//" defeats HasPrefix on reserved paths. Refs #43 --- internal/webhook/vinylcache_validator.go | 28 +++++++++++++++-- internal/webhook/vinylcache_validator_test.go | 31 +++++++++++++++++++ 2 files changed, 57 insertions(+), 2 deletions(-) diff --git a/internal/webhook/vinylcache_validator.go b/internal/webhook/vinylcache_validator.go index 6db607e..ea71173 100644 --- a/internal/webhook/vinylcache_validator.go +++ b/internal/webhook/vinylcache_validator.go @@ -88,6 +88,30 @@ func pathIsReserved(p string) bool { return false } +// pathConflictsWithReserved reports whether user path p either sits under +// a reserved path (pathIsReserved) OR is an ancestor of one. Ancestor +// mounts must be rejected for mountPath because kubelet would otherwise +// let the user-declared mount shadow the operator's narrower subPath +// mount (e.g. mounting "/etc/varnish" shadows the agent secret at +// "/etc/varnish/secret"), giving a user with VinylCache edit rights a +// new path to operator-owned data. +func pathConflictsWithReserved(p string) bool { + if pathIsReserved(p) { + return true + } + // "/" is the ancestor of every reserved path; special-case it so the + // HasPrefix check below doesn't have to deal with "/"+"/"="//" quirks. + if p == "/" { + return true + } + for _, r := range reservedMountPaths { + if strings.HasPrefix(r, p+"/") { + return true + } + } + return false +} + // ValidateVinylCache performs semantic validation of a VinylCache resource that is not // expressible as CRD schema constraints. It is called by both ValidateCreate and ValidateUpdate. // @@ -169,9 +193,9 @@ func ValidateVinylCache(vc *vinylv1alpha1.VinylCache) (admission.Warnings, error // Validate mount paths + that each mount resolves to a declared volume. for _, m := range vc.Spec.Pod.VolumeMounts { - if pathIsReserved(m.MountPath) { + if pathConflictsWithReserved(m.MountPath) { errs = append(errs, fmt.Sprintf( - "spec.pod.volumeMounts[%q]: mountPath %q is reserved by the operator", + "spec.pod.volumeMounts[%q]: mountPath %q conflicts with a reserved operator mount", m.Name, m.MountPath)) } if !declared[m.Name] && !reservedVolumeNames[m.Name] { diff --git a/internal/webhook/vinylcache_validator_test.go b/internal/webhook/vinylcache_validator_test.go index 90bc3fa..56e106e 100644 --- a/internal/webhook/vinylcache_validator_test.go +++ b/internal/webhook/vinylcache_validator_test.go @@ -502,6 +502,37 @@ func TestValidate_VolumeMountPath_ReservedIsRejected(t *testing.T) { assert.Contains(t, err.Error(), "/var/lib/varnish") } +func TestValidate_VolumeMountPath_AncestorOfReservedIsRejected(t *testing.T) { + // Guards against a shadowing attack: mounting /etc/varnish would + // cover the operator's subPath mounts at /etc/varnish/secret and + // /etc/varnish/default.vcl, giving a user with VinylCache edit + // rights a new vector onto operator-owned data. + cases := []struct { + name string + mountPath string + }{ + {"etc-varnish", "/etc/varnish"}, // ancestor of /etc/varnish/secret and /etc/varnish/default.vcl + {"var-lib", "/var/lib"}, // ancestor of /var/lib/varnish + {"root", "/"}, // ancestor of everything + } + for _, tc := range cases { + t.Run(tc.name, func(t *testing.T) { + vc := validBaseVinylCache() + vc.Spec.Pod.Volumes = []corev1.Volume{{ + Name: "my-vol", + VolumeSource: corev1.VolumeSource{EmptyDir: &corev1.EmptyDirVolumeSource{}}, + }} + vc.Spec.Pod.VolumeMounts = []corev1.VolumeMount{ + {Name: "my-vol", MountPath: tc.mountPath}, + } + _, err := webhook.ValidateVinylCache(vc) + require.Error(t, err) + assert.Contains(t, err.Error(), tc.mountPath) + assert.Contains(t, err.Error(), "conflicts with a reserved") + }) + } +} + func TestValidate_VolumeMountName_Unresolvable_Rejected(t *testing.T) { vc := validBaseVinylCache() vc.Spec.Pod.VolumeMounts = []corev1.VolumeMount{ From fbdb27fd277da7f7fdb90fe33424a64f4a6d2942 Mon Sep 17 00:00:00 2001 From: "Jens W. Klein" Date: Tue, 21 Apr 2026 01:06:26 +0200 Subject: [PATCH 9/9] test(e2e): fix JMESPath in volumes-and-pvc assertion The chainsaw assertion used containers[?name=='varnish'].volumeMounts[?...] which projects volumeMounts through the filter result, producing a list-of-lists that JMESPath's outer filter couldn't unwrap. Result was an empty slice compared against expected [[{mount}]], 'lengths of slices don't match' error. Fixed by piping to [0] to extract the matching container first, then filtering its volumeMounts as a flat list. Volumes assertion already worked because it didn't have the nested projection. Production code was correct (the VinylCache reached Ready phase, so the StatefulSet did have the user volume + mount). Refs #43 --- e2e/tests/volumes-and-pvc/chainsaw-test.yaml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/e2e/tests/volumes-and-pvc/chainsaw-test.yaml b/e2e/tests/volumes-and-pvc/chainsaw-test.yaml index d96c98d..45d7117 100644 --- a/e2e/tests/volumes-and-pvc/chainsaw-test.yaml +++ b/e2e/tests/volumes-and-pvc/chainsaw-test.yaml @@ -56,9 +56,11 @@ spec: - name: cache-ssd emptyDir: sizeLimit: 200Mi - (containers[?name=='varnish'].volumeMounts[?name=='cache-ssd']): - - - name: cache-ssd - mountPath: /var/lib/varnish-cache + # Pipe + [0] so .volumeMounts returns a flat list + # instead of list-of-lists from projection semantics. + (containers[?name=='varnish'] | [0].volumeMounts[?name=='cache-ssd']): + - name: cache-ssd + mountPath: /var/lib/varnish-cache - name: cleanup try: