Merge pull request #869 from Random-Liu/support-netd

Support netd in GCE bootstrap.
This commit is contained in:
Lantao Liu 2018-07-31 10:44:53 -07:00 committed by GitHub
commit c9d6151526
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -147,13 +147,14 @@ config_path="${CONTAINERD_CONFIG_PATH:-"/etc/containerd/config.toml"}"
mkdir -p $(dirname ${config_path}) mkdir -p $(dirname ${config_path})
cni_bin_dir="${CONTAINERD_HOME}/opt/cni/bin" cni_bin_dir="${CONTAINERD_HOME}/opt/cni/bin"
cni_template_path="${CONTAINERD_HOME}/opt/containerd/cluster/gce/cni.template" cni_template_path="${CONTAINERD_HOME}/opt/containerd/cluster/gce/cni.template"
# NETWORK_POLICY_PROVIDER is from kube-env. if [ "${KUBERNETES_MASTER:-}" != "true" ]; then
network_policy_provider="${NETWORK_POLICY_PROVIDER:-"none"}" if [ "${NETWORK_POLICY_PROVIDER:-"none"}" != "none" ] || [ "${ENABLE_NETD:-}" == "true" ]; then
if [ -n "${network_policy_provider}" ] && [ "${network_policy_provider}" != "none" ] && [ "${KUBERNETES_MASTER:-}" != "true" ]; then # Use Kubernetes cni daemonset on node if network policy provider is specified
# Use Kubernetes cni daemonset on node if network policy provider is specified. # or netd is enabled.
cni_bin_dir="${KUBE_HOME}/bin" cni_bin_dir="${KUBE_HOME}/bin"
cni_template_path="" cni_template_path=""
fi fi
fi
log_level="${CONTAINERD_LOG_LEVEL:-"info"}" log_level="${CONTAINERD_LOG_LEVEL:-"info"}"
max_container_log_line="${CONTAINERD_MAX_CONTAINER_LOG_LINE:-16384}" max_container_log_line="${CONTAINERD_MAX_CONTAINER_LOG_LINE:-16384}"
cat > ${config_path} <<EOF cat > ${config_path} <<EOF