From f3d97c9d9a316062f7b67272cddc3aed6ebd84de Mon Sep 17 00:00:00 2001 From: Jon Cope Date: Wed, 24 Jul 2024 15:43:44 -0500 Subject: [PATCH] implementation of Optional CSI Config: openshift/enhancements#1635 expand microshift config with new storage root field. allows users to disable LVMS and/or CSI components Signed-off-by: Jon Cope --- .../config/config-openapi-spec.json | 31 ++- docs/user/howto_config.md | 8 + .../openshift/microshift/pkg/config/config.go | 11 +- .../microshift/pkg/config/storage.go | 116 ++++++++ packaging/greenboot/functions.sh | 92 +++++++ .../greenboot/microshift-running-check.sh | 31 ++- packaging/microshift/config.yaml | 19 ++ packaging/rpm/microshift.spec | 1 + pkg/components/csi-snapshot-controller.go | 89 +++++-- pkg/components/storage.go | 4 + pkg/config/config.go | 11 +- pkg/config/config_test.go | 18 +- pkg/config/storage.go | 116 ++++++++ pkg/config/storage_test.go | 250 ++++++++++++++++++ test/resources/oc.resource | 9 + test/suites/standard1/configuration.robot | 111 ++++++-- test/suites/tuned/microshift-tuned.robot | 3 +- 17 files changed, 854 insertions(+), 66 deletions(-) create mode 100644 etcd/vendor/github.com/openshift/microshift/pkg/config/storage.go create mode 100644 pkg/config/storage.go create mode 100644 pkg/config/storage_test.go diff --git a/cmd/generate-config/config/config-openapi-spec.json b/cmd/generate-config/config/config-openapi-spec.json index a8f87e040a..e8d8c21621 100755 --- a/cmd/generate-config/config/config-openapi-spec.json +++ b/cmd/generate-config/config/config-openapi-spec.json @@ -9,7 +9,8 @@ "kubelet", "manifests", "network", - "node" + "node", + "storage" ], "properties": { "apiServer": { @@ -267,6 +268,34 @@ "type": "string" } } + }, + "storage": { + "description": "Storage represents a subfield of the MicroShift config data structure. Its purpose to provide a user\nfacing interface to control whether MicroShift should deploy LVMS on startup.", + "type": "object", + "properties": { + "driver": { + "description": "Driver is a user defined string value matching one of the above CSIStorageDriver values. MicroShift uses this\nvalue to decide whether to deploy the LVMS operator. An unset field defaults to \"\" during yaml parsing, and thus\ncould mean that the cluster has been upgraded. In order to support the existing out-of-box behavior, MicroShift\nassumes an empty string to mean the storage driver should be deployed.\nAllowed values are: unset or one of [\"\", \"lvms\", \"none\"]", + "type": "string", + "enum": [ + "", + "none", + "lvms" + ] + }, + "optionalCsiComponents": { + "description": "OptionalCSIComponents is a user defined slice of CSIComponent values. These value tell MicroShift which\nadditional, non-driver, CSI controllers to deploy on start. MicroShift will deploy snapshot controller\nand webhook when no components are specified. This preserves the current deployment behavior of existing\nclusters. Users must set `.storage.optionalCsiComponents: []` to explicitly tell MicroShift not to deploy any CSI\ncomponents. The CSI Driver is excluded as it is typically deployed via the same manifest as the accompanying\nstorage driver. Like CSIStorageDriver, uninstallation is not supported as this can lead to orphaned storage\nobjects.\nAllowed values are: unset, [], or one or more of [\"snapshot-controller\", \"snapshot-webhook\"]", + "type": "array", + "items": { + "description": "OptionalCsiComponent values determine which CSI components MicroShift should deploy. Currently only csi snapshot components\nare supported.", + "type": "string", + "enum": [ + "none", + "snapshot-controller", + "snapshot-webhook" + ] + } + } + } } } } \ No newline at end of file diff --git a/docs/user/howto_config.md b/docs/user/howto_config.md index 6e4daa1b8a..fdbf570ba9 100644 --- a/docs/user/howto_config.md +++ b/docs/user/howto_config.md @@ -50,6 +50,10 @@ node: hostnameOverride: "" nodeIP: "" nodeIPv6: "" +storage: + driver: "" + optionalCsiComponents: + - "" ```