mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Install CRDs in local cluster
This PR installs CSIDriver and CSINodeInfo CRDs in the local cluster. fixes: #70791
This commit is contained in:
parent
86691cad55
commit
36030137b3
@ -968,6 +968,18 @@ function create_storage_class {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
create_csi_crd() {
|
||||||
|
echo "create_csi_crd $1"
|
||||||
|
YAML_FILE=${KUBE_ROOT}/cluster/addons/storage-crds/$1.yaml
|
||||||
|
|
||||||
|
if [ -e $YAML_FILE ]; then
|
||||||
|
echo "Create $1 crd"
|
||||||
|
${KUBECTL} --kubeconfig="${CERT_DIR}/admin.kubeconfig" create -f $YAML_FILE
|
||||||
|
else
|
||||||
|
echo "No $1 available."
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
function print_success {
|
function print_success {
|
||||||
if [[ "${START_MODE}" != "kubeletonly" ]]; then
|
if [[ "${START_MODE}" != "kubeletonly" ]]; then
|
||||||
if [[ "${ENABLE_DAEMON}" = false ]]; then
|
if [[ "${ENABLE_DAEMON}" = false ]]; then
|
||||||
@ -1112,6 +1124,14 @@ if [[ "$DEFAULT_STORAGE_CLASS" = "true" ]]; then
|
|||||||
create_storage_class
|
create_storage_class
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ "${FEATURE_GATES:-}" == "AllAlpha=true" || "${FEATURE_GATES:-}" =~ "CSIDriverRegistry=true" ]]; then
|
||||||
|
create_csi_crd "csidriver"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${FEATURE_GATES:-}" == "AllAlpha=true" || "${FEATURE_GATES:-}" =~ "CSINodeInfo=true" ]]; then
|
||||||
|
create_csi_crd "csinodeinfo"
|
||||||
|
fi
|
||||||
|
|
||||||
print_success
|
print_success
|
||||||
|
|
||||||
if [[ "${ENABLE_DAEMON}" = false ]]; then
|
if [[ "${ENABLE_DAEMON}" = false ]]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user