Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
fdccfe97
Commit
fdccfe97
authored
Jan 02, 2015
by
Zach Loafman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GKE: Add ENABLE_CLUSTER_DNS, compute appropriate DNS_SERVER_IP
Fixes
https://github.com/GoogleCloudPlatform/kubernetes/issues/3191
parent
d098456b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
0 deletions
+24
-0
config-common.sh
cluster/gke/config-common.sh
+9
-0
util.sh
cluster/gke/util.sh
+15
-0
No files found.
cluster/gke/config-common.sh
View file @
fdccfe97
...
...
@@ -28,6 +28,15 @@ NETWORK="${NETWORK:-default}"
GCLOUD
=
"
${
GCLOUD
:-
gcloud
}
"
GCLOUD_CONFIG_DIR
=
"
${
GCLOUD_CONFIG_DIR
:-${
HOME
}
/.config/gcloud/kubernetes
}
"
# 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
# then things grossly fail during normal runs because cluster/kubecfg.sh and
# cluster/kubectl.sh both use this if it's set.
...
...
cluster/gke/util.sh
View file @
fdccfe97
...
...
@@ -85,6 +85,8 @@ function verify-prereqs() {
# CLUSTER_API_VERSION (optional)
# NUM_MINIONS
function
kube-up
()
{
local
service_prefix
echo
"... in kube-up()"
>
&2
detect-project
>
&2
"
${
GCLOUD
}
"
preview container clusters create
"
${
CLUSTER_NAME
}
"
\
...
...
@@ -92,6 +94,19 @@ function kube-up() {
--project
=
"
${
PROJECT
}
"
\
--cluster-api-version
=
"
${
CLUSTER_API_VERSION
:-}
"
\
--num-nodes
=
"
${
NUM_MINIONS
}
"
# 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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment