mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 22:46:12 +00:00
Add netd as an addon for GKE.
This commit is contained in:
parent
9fee771b40
commit
d903d32856
@ -349,6 +349,9 @@ STORAGE_BACKEND=${STORAGE_BACKEND:-}
|
|||||||
# Networking plugin specific settings.
|
# Networking plugin specific settings.
|
||||||
NETWORK_PROVIDER="${NETWORK_PROVIDER:-kubenet}" # none, kubenet
|
NETWORK_PROVIDER="${NETWORK_PROVIDER:-kubenet}" # none, kubenet
|
||||||
|
|
||||||
|
# Optional: Enable netd.
|
||||||
|
ENABLE_NETD="${KUBE_ENABLE_NETD:-false}"
|
||||||
|
|
||||||
# Network Policy plugin specific settings.
|
# Network Policy plugin specific settings.
|
||||||
NETWORK_POLICY_PROVIDER="${NETWORK_POLICY_PROVIDER:-none}" # calico
|
NETWORK_POLICY_PROVIDER="${NETWORK_POLICY_PROVIDER:-none}" # calico
|
||||||
|
|
||||||
|
@ -359,6 +359,9 @@ STORAGE_MEDIA_TYPE=${STORAGE_MEDIA_TYPE:-}
|
|||||||
|
|
||||||
NETWORK_PROVIDER="${NETWORK_PROVIDER:-kubenet}" # none, kubenet
|
NETWORK_PROVIDER="${NETWORK_PROVIDER:-kubenet}" # none, kubenet
|
||||||
|
|
||||||
|
# Optional: Enable netd.
|
||||||
|
ENABLE_NETD="${KUBE_ENABLE_NETD:-false}"
|
||||||
|
|
||||||
# Network Policy plugin specific settings.
|
# Network Policy plugin specific settings.
|
||||||
NETWORK_POLICY_PROVIDER="${NETWORK_POLICY_PROVIDER:-none}" # calico
|
NETWORK_POLICY_PROVIDER="${NETWORK_POLICY_PROVIDER:-none}" # calico
|
||||||
|
|
||||||
|
@ -2235,6 +2235,19 @@ EOF
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Sets up the manifests of netd for k8s addons.
|
||||||
|
function setup-netd-manifest {
|
||||||
|
local -r netd_file="${dst_dir}/netd/netd.yaml"
|
||||||
|
mkdir -p "${dst_dir}/netd"
|
||||||
|
touch "${netd_file}"
|
||||||
|
if [ -n "${CUSTOM_NETD_YAML:-}" ]; then
|
||||||
|
# Replace with custom GKE netd deployment.
|
||||||
|
cat > "${netd_file}" <<EOF
|
||||||
|
$(echo "$CUSTOM_NETD_YAML")
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# Prepares the manifests of k8s addons, and starts the addon manager.
|
# Prepares the manifests of k8s addons, and starts the addon manager.
|
||||||
# Vars assumed:
|
# Vars assumed:
|
||||||
# CLUSTER_NAME
|
# CLUSTER_NAME
|
||||||
@ -2348,6 +2361,9 @@ EOF
|
|||||||
setup-kube-dns-manifest
|
setup-kube-dns-manifest
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
if [[ "${ENABLE_NETD:-}" == "true" ]]; then
|
||||||
|
setup-netd-manifest
|
||||||
|
fi
|
||||||
if [[ "${ENABLE_NODE_LOGGING:-}" == "true" ]] && \
|
if [[ "${ENABLE_NODE_LOGGING:-}" == "true" ]] && \
|
||||||
[[ "${LOGGING_DESTINATION:-}" == "elasticsearch" ]] && \
|
[[ "${LOGGING_DESTINATION:-}" == "elasticsearch" ]] && \
|
||||||
[[ "${ENABLE_CLUSTER_LOGGING:-}" == "true" ]]; then
|
[[ "${ENABLE_CLUSTER_LOGGING:-}" == "true" ]]; then
|
||||||
|
@ -898,6 +898,7 @@ REGION: $(yaml-quote ${REGION})
|
|||||||
VOLUME_PLUGIN_DIR: $(yaml-quote ${VOLUME_PLUGIN_DIR})
|
VOLUME_PLUGIN_DIR: $(yaml-quote ${VOLUME_PLUGIN_DIR})
|
||||||
KUBELET_ARGS: $(yaml-quote ${KUBELET_ARGS})
|
KUBELET_ARGS: $(yaml-quote ${KUBELET_ARGS})
|
||||||
REQUIRE_METADATA_KUBELET_CONFIG_FILE: $(yaml-quote true)
|
REQUIRE_METADATA_KUBELET_CONFIG_FILE: $(yaml-quote true)
|
||||||
|
ENABLE_NETD: $(yaml-quote ${ENABLE_NETD:-false})
|
||||||
EOF
|
EOF
|
||||||
if [[ "${master}" == "true" && "${MASTER_OS_DISTRIBUTION}" == "gci" ]] || \
|
if [[ "${master}" == "true" && "${MASTER_OS_DISTRIBUTION}" == "gci" ]] || \
|
||||||
[[ "${master}" == "false" && "${NODE_OS_DISTRIBUTION}" == "gci" ]] || \
|
[[ "${master}" == "false" && "${NODE_OS_DISTRIBUTION}" == "gci" ]] || \
|
||||||
|
Loading…
Reference in New Issue
Block a user