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
9dc5bb56
Unverified
Commit
9dc5bb56
authored
Sep 21, 2018
by
k8s-ci-robot
Committed by
GitHub
Sep 21, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #68492 from vishh/68372
Fix node label assignment for GCE k8s clusters.
parents
5dc2c13e
9dc14488
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
8 deletions
+14
-8
config-default.sh
cluster/gce/config-default.sh
+7
-4
config-test.sh
cluster/gce/config-test.sh
+7
-4
No files found.
cluster/gce/config-default.sh
View file @
9dc5bb56
...
...
@@ -55,9 +55,6 @@ NODE_LOCAL_SSDS_EXT=${NODE_LOCAL_SSDS_EXT:-}
NODE_ACCELERATORS
=
${
NODE_ACCELERATORS
:-
""
}
REGISTER_MASTER_KUBELET
=
${
REGISTER_MASTER
:-
true
}
PREEMPTIBLE_NODE
=
${
PREEMPTIBLE_NODE
:-
false
}
if
[[
"
${
PREEMPTIBLE_NODE
}
"
==
"true"
]]
;
then
NODE_LABELS
=
"
${
NODE_LABELS
}
,cloud.google.com/gke-preemptible=true"
fi
PREEMPTIBLE_MASTER
=
${
PREEMPTIBLE_MASTER
:-
false
}
KUBE_DELETE_NODES
=
${
KUBE_DELETE_NODES
:-
true
}
KUBE_DELETE_NETWORK
=
${
KUBE_DELETE_NETWORK
:-}
# default value calculated below
...
...
@@ -177,6 +174,12 @@ HEAPSTER_MACHINE_TYPE="${HEAPSTER_MACHINE_TYPE:-}"
# NON_MASTER_NODE_LABELS are labels will only be applied on non-master nodes.
NON_MASTER_NODE_LABELS
=
"
${
KUBE_NON_MASTER_NODE_LABELS
:-}
"
if
[[
"
${
PREEMPTIBLE_MASTER
}
"
==
"true"
]]
;
then
NODE_LABELS
=
"
${
NODE_LABELS
}
,cloud.google.com/gke-preemptible=true"
elif
[[
"
${
PREEMPTIBLE_NODE
}
"
==
"true"
]]
;
then
NON_MASTER_NODE_LABELS
=
"
${
NON_MASTER_NODE_LABELS
}
,cloud.google.com/gke-preemptible=true"
fi
# To avoid running Calico on a node that is not configured appropriately,
# label each Node so that the DaemonSet can run the Pods only on ready Nodes.
if
[[
${
NETWORK_POLICY_PROVIDER
:-}
==
"calico"
]]
;
then
...
...
@@ -253,7 +256,7 @@ FEATURE_GATES="${KUBE_FEATURE_GATES:-ExperimentalCriticalPodAnnotation=true}"
if
[[
!
-z
"
${
NODE_ACCELERATORS
}
"
]]
;
then
FEATURE_GATES
=
"
${
FEATURE_GATES
}
,DevicePlugins=true"
if
[[
"
${
NODE_ACCELERATORS
}
"
=
~ .
*
type
=([
a-zA-Z0-9-]+
)
.
*
]]
;
then
NO
DE_LABELS
=
"
${
NODE_LABELS
}
,cloud.google.com/gke-accelerator=
${
BASH_REMATCH
[1]
}
"
NO
N_MASTER_NODE_LABELS
=
"
${
NON_MASTER_
NODE_LABELS
}
,cloud.google.com/gke-accelerator=
${
BASH_REMATCH
[1]
}
"
fi
fi
...
...
cluster/gce/config-test.sh
View file @
9dc5bb56
...
...
@@ -55,9 +55,6 @@ REGISTER_MASTER_KUBELET=${REGISTER_MASTER:-true}
KUBE_APISERVER_REQUEST_TIMEOUT
=
300
PREEMPTIBLE_NODE
=
${
PREEMPTIBLE_NODE
:-
false
}
PREEMPTIBLE_MASTER
=
${
PREEMPTIBLE_MASTER
:-
false
}
if
[[
"
${
PREEMPTIBLE_NODE
}
"
==
"true"
]]
;
then
NODE_LABELS
=
"
${
NODE_LABELS
}
,cloud.google.com/gke-preemptible=true"
fi
KUBE_DELETE_NODES
=
${
KUBE_DELETE_NODES
:-
true
}
KUBE_DELETE_NETWORK
=
${
KUBE_DELETE_NETWORK
:-
true
}
CREATE_CUSTOM_NETWORK
=
${
CREATE_CUSTOM_NETWORK
:-
false
}
...
...
@@ -215,6 +212,12 @@ KUBEPROXY_TEST_ARGS="${KUBEPROXY_TEST_ARGS:-} ${TEST_CLUSTER_API_CONTENT_TYPE}"
# NON_MASTER_NODE_LABELS are labels will only be applied on non-master nodes.
NON_MASTER_NODE_LABELS
=
"
${
KUBE_NON_MASTER_NODE_LABELS
:-}
"
if
[[
"
${
PREEMPTIBLE_MASTER
}
"
==
"true"
]]
;
then
NODE_LABELS
=
"
${
NODE_LABELS
}
,cloud.google.com/gke-preemptible=true"
elif
[[
"
${
PREEMPTIBLE_NODE
}
"
==
"true"
]]
;
then
NON_MASTER_NODE_LABELS
=
"
${
NON_MASTER_NODE_LABELS
}
,cloud.google.com/gke-preemptible=true"
fi
# Optional: Enable netd.
ENABLE_NETD
=
"
${
KUBE_ENABLE_NETD
:-
false
}
"
CUSTOM_NETD_YAML
=
"
${
KUBE_CUSTOM_NETD_YAML
:-}
"
...
...
@@ -260,7 +263,7 @@ fi
if
[[
!
-z
"
${
NODE_ACCELERATORS
}
"
]]
;
then
FEATURE_GATES
=
"
${
FEATURE_GATES
}
,DevicePlugins=true"
if
[[
"
${
NODE_ACCELERATORS
}
"
=
~ .
*
type
=([
a-zA-Z0-9-]+
)
.
*
]]
;
then
NO
DE_LABELS
=
"
${
NODE_LABELS
}
,cloud.google.com/gke-accelerator=
${
BASH_REMATCH
[1]
}
"
NO
N_MASTER_NODE_LABELS
=
"
${
NON_MASTER_
NODE_LABELS
}
,cloud.google.com/gke-accelerator=
${
BASH_REMATCH
[1]
}
"
fi
fi
...
...
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