Merge pull request #70193 from saad-ali/csiCRDAddon
Register CSI CRDs as addon
This commit is contained in:
6
cluster/addons/storage-crds/OWNERS
Normal file
6
cluster/addons/storage-crds/OWNERS
Normal file
@@ -0,0 +1,6 @@
|
||||
approvers:
|
||||
- saad-ali
|
||||
- jsafrane
|
||||
- msau42
|
||||
reviewers:
|
||||
- davidz627
|
13
cluster/addons/storage-crds/README.md
Normal file
13
cluster/addons/storage-crds/README.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# Kubernetes CSI CRDs
|
||||
|
||||
The Kubernetes Container Storage Interface implementation defines some API objects as CRDs that Kubernetes components
|
||||
including the Attach/Detach controller depend on.
|
||||
|
||||
If you are using CSI, it is recommended that you enable the relevant feature gates (e.g. `CSIDriverRegistry`, `CSINodeInfo`, etc.), and ensure the CRDs in this directory are installed.
|
||||
|
||||
These objects and their CRDs are defined in `staging/src/k8s.io/csi-api/pkg/crd/manifests`, the source of truth.
|
||||
They are copied from that CRD manifest directory to this addon directory.
|
||||
A unit test in `staging/src/k8s.io/csi-api/pkg/crd` verifies that this (and any other) copies of the manifest outside of `staging/src/k8s.io/csi-api/pkg/crd/manifests` do not drift from that source of truth.
|
||||
If you need to make changes please make changes in the `staging/src/k8s.io/csi-api/pkg/crd/manifests` directory and then update this copy.
|
||||
|
||||
For more information, see: https://kubernetes-csi.github.io/docs/
|
28
cluster/addons/storage-crds/csidriver.yaml
Normal file
28
cluster/addons/storage-crds/csidriver.yaml
Normal file
@@ -0,0 +1,28 @@
|
||||
apiVersion: apiextensions.k8s.io/v1beta1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
name: csidrivers.csi.storage.k8s.io
|
||||
labels:
|
||||
addonmanager.kubernetes.io/mode: Reconcile
|
||||
spec:
|
||||
group: csi.storage.k8s.io
|
||||
names:
|
||||
kind: CSIDriver
|
||||
plural: csidrivers
|
||||
scope: Cluster
|
||||
validation:
|
||||
openAPIV3Schema:
|
||||
properties:
|
||||
spec:
|
||||
description: Specification of the CSI Driver.
|
||||
properties:
|
||||
attachRequired:
|
||||
description: Indicates this CSI volume driver requires an attach operation,
|
||||
and that Kubernetes should call attach and wait for any attach operation
|
||||
to complete before proceeding to mount.
|
||||
type: boolean
|
||||
podInfoOnMountVersion:
|
||||
description: Indicates this CSI volume driver requires additional pod
|
||||
information (like podName, podUID, etc.) during mount operations.
|
||||
type: string
|
||||
version: v1alpha1
|
32
cluster/addons/storage-crds/csinodeinfo.yaml
Normal file
32
cluster/addons/storage-crds/csinodeinfo.yaml
Normal file
@@ -0,0 +1,32 @@
|
||||
apiVersion: apiextensions.k8s.io/v1beta1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
name: csinodeinfos.csi.storage.k8s.io
|
||||
labels:
|
||||
addonmanager.kubernetes.io/mode: Reconcile
|
||||
spec:
|
||||
group: csi.storage.k8s.io
|
||||
names:
|
||||
kind: CSINodeInfo
|
||||
plural: csinodeinfos
|
||||
scope: Cluster
|
||||
validation:
|
||||
openAPIV3Schema:
|
||||
properties:
|
||||
csiDrivers:
|
||||
description: List of CSI drivers running on the node and their properties.
|
||||
items:
|
||||
properties:
|
||||
driver:
|
||||
description: The CSI driver that this object refers to.
|
||||
type: string
|
||||
nodeID:
|
||||
description: The node from the driver point of view.
|
||||
type: string
|
||||
topologyKeys:
|
||||
description: List of keys supported by the driver.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
type: array
|
||||
version: v1alpha1
|
@@ -246,10 +246,6 @@ fi
|
||||
# Optional: customize runtime config
|
||||
RUNTIME_CONFIG="${KUBE_RUNTIME_CONFIG:-}"
|
||||
|
||||
if [[ "${KUBE_FEATURE_GATES:-}" == "AllAlpha=true" ]]; then
|
||||
RUNTIME_CONFIG="${KUBE_RUNTIME_CONFIG:-api/all=true}"
|
||||
fi
|
||||
|
||||
# Optional: set feature gates
|
||||
FEATURE_GATES="${KUBE_FEATURE_GATES:-ExperimentalCriticalPodAnnotation=true}"
|
||||
|
||||
@@ -260,6 +256,18 @@ if [[ ! -z "${NODE_ACCELERATORS}" ]]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "${KUBE_FEATURE_GATES:-}" == "AllAlpha=true" ]]; then
|
||||
RUNTIME_CONFIG="${KUBE_RUNTIME_CONFIG:-api/all=true}"
|
||||
if ! [[ "${KUBE_FEATURE_GATES:-}" =~ "CSIDriverRegistry" ]]; then
|
||||
# If not explicitly specified, default to true.
|
||||
FEATURE_GATES="${FEATURE_GATES},CSIDriverRegistry=true"
|
||||
fi
|
||||
if ! [[ "${KUBE_FEATURE_GATES:-}" =~ "CSINodeInfo" ]]; then
|
||||
# If not explicitly specified, default to true.
|
||||
FEATURE_GATES="${FEATURE_GATES},CSINodeInfo=true"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Optional: Install cluster DNS.
|
||||
# Set CLUSTER_DNS_CORE_DNS to 'false' to install kube-dns instead of CoreDNS.
|
||||
CLUSTER_DNS_CORE_DNS="${CLUSTER_DNS_CORE_DNS:-true}"
|
||||
|
@@ -2567,6 +2567,9 @@ EOF
|
||||
if [[ "${ENABLE_DEFAULT_STORAGE_CLASS:-}" == "true" ]]; then
|
||||
setup-addon-manifests "addons" "storage-class/gce"
|
||||
fi
|
||||
if [[ "${FEATURE_GATES:-}" =~ "CSIDriverRegistry=true" || "${FEATURE_GATES:-}" =~ "CSINodeInfo=true" ]]; then
|
||||
setup-addon-manifests "addons" "storage-crds"
|
||||
fi
|
||||
if [[ "${ENABLE_IP_MASQ_AGENT:-}" == "true" ]]; then
|
||||
setup-addon-manifests "addons" "ip-masq-agent"
|
||||
fi
|
||||
|
Reference in New Issue
Block a user