mirror of https://github.com/k3s-io/k3s
Merge pull request #25841 from ojarjur/ojarjur/registry-mirror
Automatic merge from submit-queue GCE: Enable using gcr.io as a Docker registry mirror. ```release-note Use gcr.io as a Docker registry mirror when setting up a cluster in GCE. ``` [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]() This only affects clusters running under GCE.pull/6/head
commit
98c432a943
|
@ -495,6 +495,7 @@ SERVICE_CLUSTER_IP_RANGE: $(yaml-quote ${SERVICE_CLUSTER_IP_RANGE})
|
||||||
KUBERNETES_MASTER_NAME: $(yaml-quote ${MASTER_NAME})
|
KUBERNETES_MASTER_NAME: $(yaml-quote ${MASTER_NAME})
|
||||||
ALLOCATE_NODE_CIDRS: $(yaml-quote ${ALLOCATE_NODE_CIDRS:-false})
|
ALLOCATE_NODE_CIDRS: $(yaml-quote ${ALLOCATE_NODE_CIDRS:-false})
|
||||||
ENABLE_CLUSTER_MONITORING: $(yaml-quote ${ENABLE_CLUSTER_MONITORING:-none})
|
ENABLE_CLUSTER_MONITORING: $(yaml-quote ${ENABLE_CLUSTER_MONITORING:-none})
|
||||||
|
DOCKER_REGISTRY_MIRROR_URL: $(yaml-quote ${DOCKER_REGISTRY_MIRROR_URL:-})
|
||||||
ENABLE_L7_LOADBALANCING: $(yaml-quote ${ENABLE_L7_LOADBALANCING:-none})
|
ENABLE_L7_LOADBALANCING: $(yaml-quote ${ENABLE_L7_LOADBALANCING:-none})
|
||||||
ENABLE_CLUSTER_LOGGING: $(yaml-quote ${ENABLE_CLUSTER_LOGGING:-false})
|
ENABLE_CLUSTER_LOGGING: $(yaml-quote ${ENABLE_CLUSTER_LOGGING:-false})
|
||||||
ENABLE_CLUSTER_UI: $(yaml-quote ${ENABLE_CLUSTER_UI:-false})
|
ENABLE_CLUSTER_UI: $(yaml-quote ${ENABLE_CLUSTER_UI:-false})
|
||||||
|
|
|
@ -64,6 +64,9 @@ EXTRA_DOCKER_OPTS="${EXTRA_DOCKER_OPTS:-}"
|
||||||
SERVICE_CLUSTER_IP_RANGE="${SERVICE_CLUSTER_IP_RANGE:-10.0.0.0/16}" # formerly PORTAL_NET
|
SERVICE_CLUSTER_IP_RANGE="${SERVICE_CLUSTER_IP_RANGE:-10.0.0.0/16}" # formerly PORTAL_NET
|
||||||
ALLOCATE_NODE_CIDRS=true
|
ALLOCATE_NODE_CIDRS=true
|
||||||
|
|
||||||
|
# When set to true, Docker Cache is enabled by default as part of the cluster bring up.
|
||||||
|
ENABLE_DOCKER_REGISTRY_CACHE=true
|
||||||
|
|
||||||
# Optional: Deploy a L7 loadbalancer controller to fulfill Ingress requests:
|
# Optional: Deploy a L7 loadbalancer controller to fulfill Ingress requests:
|
||||||
# glbc - CE L7 Load Balancer Controller
|
# glbc - CE L7 Load Balancer Controller
|
||||||
ENABLE_L7_LOADBALANCING="${KUBE_ENABLE_L7_LOADBALANCING:-glbc}"
|
ENABLE_L7_LOADBALANCING="${KUBE_ENABLE_L7_LOADBALANCING:-glbc}"
|
||||||
|
|
|
@ -66,6 +66,9 @@ EXTRA_DOCKER_OPTS="${EXTRA_DOCKER_OPTS:-}"
|
||||||
|
|
||||||
SERVICE_CLUSTER_IP_RANGE="10.0.0.0/16" # formerly PORTAL_NET
|
SERVICE_CLUSTER_IP_RANGE="10.0.0.0/16" # formerly PORTAL_NET
|
||||||
|
|
||||||
|
# When set to true, Docker Cache is enabled by default as part of the cluster bring up.
|
||||||
|
ENABLE_DOCKER_REGISTRY_CACHE=true
|
||||||
|
|
||||||
# Optional: Deploy a L7 loadbalancer controller to fulfill Ingress requests:
|
# Optional: Deploy a L7 loadbalancer controller to fulfill Ingress requests:
|
||||||
# glbc - CE L7 Load Balancer Controller
|
# glbc - CE L7 Load Balancer Controller
|
||||||
ENABLE_L7_LOADBALANCING="${KUBE_ENABLE_L7_LOADBALANCING:-glbc}"
|
ENABLE_L7_LOADBALANCING="${KUBE_ENABLE_L7_LOADBALANCING:-glbc}"
|
||||||
|
|
|
@ -899,6 +899,13 @@ function node-docker-opts() {
|
||||||
if [[ -n "${EXTRA_DOCKER_OPTS-}" ]]; then
|
if [[ -n "${EXTRA_DOCKER_OPTS-}" ]]; then
|
||||||
DOCKER_OPTS="${DOCKER_OPTS:-} ${EXTRA_DOCKER_OPTS}"
|
DOCKER_OPTS="${DOCKER_OPTS:-} ${EXTRA_DOCKER_OPTS}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Decide whether to enable a docker registry mirror. This is taken from
|
||||||
|
# the "kube-env" metadata value.
|
||||||
|
if [[ -n "${DOCKER_REGISTRY_MIRROR_URL:-}" ]]; then
|
||||||
|
echo "Enable docker registry mirror at: ${DOCKER_REGISTRY_MIRROR_URL}"
|
||||||
|
DOCKER_OPTS="${DOCKER_OPTS:-} --registry-mirror=${DOCKER_REGISTRY_MIRROR_URL}"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function salt-grains() {
|
function salt-grains() {
|
||||||
|
|
|
@ -191,6 +191,10 @@ function set-preferred-region() {
|
||||||
else
|
else
|
||||||
KUBE_ADDON_REGISTRY="gcr.io/google_containers"
|
KUBE_ADDON_REGISTRY="gcr.io/google_containers"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ "${ENABLE_DOCKER_REGISTRY_CACHE:-}" == "true" ]]; then
|
||||||
|
DOCKER_REGISTRY_MIRROR_URL="https://${preferred}-mirror.gcr.io"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Take the local tar files and upload them to Google Storage. They will then be
|
# Take the local tar files and upload them to Google Storage. They will then be
|
||||||
|
|
Loading…
Reference in New Issue