mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-02 08:17:26 +00:00
Merge pull request #3291 from zmerlynn/disable_gke_cluster_dns
Revert "GKE: Add ENABLE_CLUSTER_DNS, compute appropriate DNS_SERVER_IP"
This commit is contained in:
commit
2c54dd5cb0
@ -27,15 +27,7 @@ CLUSTER_API_VERSION="${CLUSTER_API_VERSION:-}"
|
|||||||
NETWORK="${NETWORK:-default}"
|
NETWORK="${NETWORK:-default}"
|
||||||
GCLOUD="${GCLOUD:-gcloud}"
|
GCLOUD="${GCLOUD:-gcloud}"
|
||||||
GCLOUD_CONFIG_DIR="${GCLOUD_CONFIG_DIR:-${HOME}/.config/gcloud/kubernetes}"
|
GCLOUD_CONFIG_DIR="${GCLOUD_CONFIG_DIR:-${HOME}/.config/gcloud/kubernetes}"
|
||||||
|
ENABLE_CLUSTER_DNS=false
|
||||||
# Optional: Install cluster DNS.
|
|
||||||
# TODO: enable this when DNS_SERVER_IP can be easily bound.
|
|
||||||
ENABLE_CLUSTER_DNS=true
|
|
||||||
# DNS_SERVER_IP bound during kube-up using servicesIpv4Cidr
|
|
||||||
# and DNS_SERVER_OCTET.
|
|
||||||
DNS_SERVER_OCTET="10"
|
|
||||||
DNS_DOMAIN="kubernetes.local"
|
|
||||||
DNS_REPLICAS=1
|
|
||||||
|
|
||||||
# This is a hack, but I keep setting this when I run commands manually, and
|
# This is a hack, but I keep setting this when I run commands manually, and
|
||||||
# then things grossly fail during normal runs because cluster/kubecfg.sh and
|
# then things grossly fail during normal runs because cluster/kubecfg.sh and
|
||||||
|
@ -85,8 +85,6 @@ function verify-prereqs() {
|
|||||||
# CLUSTER_API_VERSION (optional)
|
# CLUSTER_API_VERSION (optional)
|
||||||
# NUM_MINIONS
|
# NUM_MINIONS
|
||||||
function kube-up() {
|
function kube-up() {
|
||||||
local service_prefix
|
|
||||||
|
|
||||||
echo "... in kube-up()" >&2
|
echo "... in kube-up()" >&2
|
||||||
detect-project >&2
|
detect-project >&2
|
||||||
"${GCLOUD}" preview container clusters create "${CLUSTER_NAME}" \
|
"${GCLOUD}" preview container clusters create "${CLUSTER_NAME}" \
|
||||||
@ -95,19 +93,6 @@ function kube-up() {
|
|||||||
--cluster-api-version="${CLUSTER_API_VERSION:-}" \
|
--cluster-api-version="${CLUSTER_API_VERSION:-}" \
|
||||||
--num-nodes="${NUM_MINIONS}" \
|
--num-nodes="${NUM_MINIONS}" \
|
||||||
--network="${NETWORK}"
|
--network="${NETWORK}"
|
||||||
|
|
||||||
# Compute DNS_SERVER_IP: This is looking for something like
|
|
||||||
# "servicesIpv4Cidr: 10.27.240.0/20" and returning "10.27.240"
|
|
||||||
# (which is presumptious of at least a /24 network mask, but easier
|
|
||||||
# to use in bash than the /20). We then tack on the DNS_SERVER_OCTET
|
|
||||||
# to mutate the global DNS_SERVER_IP.
|
|
||||||
if [[ "${ENABLE_CLUSTER_DNS}" == "true" ]]; then
|
|
||||||
service_prefix=$("${GCLOUD}" preview container clusters describe \
|
|
||||||
--project="${PROJECT}" --zone="${ZONE}" "${CLUSTER_NAME}" |
|
|
||||||
egrep "^servicesIpv4Cidr:" | cut -f2 -d\ | cut -f1-3 -d.)
|
|
||||||
|
|
||||||
DNS_SERVER_IP="${service_prefix}.${DNS_SERVER_OCTET}"
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Called during cluster/kube-up.sh
|
# Called during cluster/kube-up.sh
|
||||||
|
Loading…
Reference in New Issue
Block a user