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
4e57dbdc
Commit
4e57dbdc
authored
Jun 12, 2015
by
CJ Cullen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make GKE test firewalls work with new short-hash node names.
parent
69f5765f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
11 deletions
+10
-11
util.sh
cluster/gke/util.sh
+10
-11
No files found.
cluster/gke/util.sh
View file @
4e57dbdc
...
@@ -166,23 +166,22 @@ function test-setup() {
...
@@ -166,23 +166,22 @@ function test-setup() {
echo
"... in test-setup()"
>
&2
echo
"... in test-setup()"
>
&2
# Detect the project into $PROJECT if it isn't set
# Detect the project into $PROJECT if it isn't set
detect-project
>
&2
detect-project
>
&2
detect-minions
>
&2
# At this point, CLUSTER_NAME should have been used, so its value is final.
# At this point, CLUSTER_NAME should have been used, so its value is final.
MINION_TAG
=
"gke-
${
CLUSTER_NAME
}
-node"
MINION_TAG
=
$(
$GCLOUD
compute instances describe
${
MINION_NAMES
[0]
}
|
grep
-o
"gke-
${
CLUSTER_NAME
}
-.
\{
8
\}
-node"
|
head
-1
)
OLD_MINION_TAG
=
"k8s-
${
CLUSTER_NAME
}
-node"
OLD_MINION_TAG
=
"k8s-
${
CLUSTER_NAME
}
-node"
# Open up port 80 & 8080 so common containers on minions can be reached.
# Open up port 80 & 8080 so common containers on minions can be reached.
# TODO(mbforbes): Is adding ${USER} necessary, and sufficient, to avoid
# collisions here?
"
${
GCLOUD
}
"
compute firewall-rules create
\
"
${
GCLOUD
}
"
compute firewall-rules create
\
"
${
MINION_TAG
}
-
${
USER
}
-
http-alt"
\
"
${
MINION_TAG
}
-http-alt"
\
--allow
tcp:80,tcp:8080
\
--allow
tcp:80,tcp:8080
\
--project
"
${
PROJECT
}
"
\
--project
"
${
PROJECT
}
"
\
--target-tags
"
${
MINION_TAG
}
,
${
OLD_MINION_TAG
}
"
\
--target-tags
"
${
MINION_TAG
}
,
${
OLD_MINION_TAG
}
"
\
--network
=
"
${
NETWORK
}
"
--network
=
"
${
NETWORK
}
"
"
${
GCLOUD
}
"
compute firewall-rules create
\
"
${
GCLOUD
}
"
compute firewall-rules create
\
"
${
MINION_TAG
}
-
${
USER
}
-
nodeports"
\
"
${
MINION_TAG
}
-nodeports"
\
--allow
tcp:30000-32767,udp:30000-32767
\
--allow
tcp:30000-32767,udp:30000-32767
\
--project
"
${
PROJECT
}
"
\
--project
"
${
PROJECT
}
"
\
--target-tags
"
${
MINION_TAG
}
,
${
OLD_MINION_TAG
}
"
\
--target-tags
"
${
MINION_TAG
}
,
${
OLD_MINION_TAG
}
"
\
...
@@ -242,10 +241,9 @@ function detect-minions() {
...
@@ -242,10 +241,9 @@ function detect-minions() {
# MINION_NAMES
# MINION_NAMES
function
detect-minion-names
{
function
detect-minion-names
{
detect-project
detect-project
GROUP_NAME
=(
$(
gcloud preview
--project
"
${
PROJECT
}
"
instance-groups
\
detect-node-instance-group
--zone
"
${
ZONE
}
"
list |
grep
-o
"k8s-
${
CLUSTER_NAME
}
-.
\{
8
\}
-group"
)
)
MINION_NAMES
=(
$(
gcloud preview
--project
"
${
PROJECT
}
"
instance-groups
\
MINION_NAMES
=(
$(
gcloud preview
--project
"
${
PROJECT
}
"
instance-groups
\
--zone
"
${
ZONE
}
"
instances
--group
"
${
GROUP_NAME
}
"
list
\
--zone
"
${
ZONE
}
"
instances
--group
"
${
NODE_INSTANCE_GROUP
}
"
list
\
|
cut
-d
'/'
-f11
)
)
|
cut
-d
'/'
-f11
)
)
echo
"MINION_NAMES=
${
MINION_NAMES
[*]
}
"
echo
"MINION_NAMES=
${
MINION_NAMES
[*]
}
"
}
}
...
@@ -311,14 +309,15 @@ function test-teardown() {
...
@@ -311,14 +309,15 @@ function test-teardown() {
echo
"... in test-teardown()"
>
&2
echo
"... in test-teardown()"
>
&2
detect-project
>
&2
detect-project
>
&2
detect-minions
>
&2
# At this point, CLUSTER_NAME should have been used, so its value is final.
# At this point, CLUSTER_NAME should have been used, so its value is final.
MINION_TAG
=
"gke-
${
CLUSTER_NAME
}
-node"
MINION_TAG
=
$(
$GCLOUD
compute instances describe
${
MINION_NAMES
[0]
}
|
grep
-o
"gke-
${
CLUSTER_NAME
}
-.
\{
8
\}
-node"
|
head
-1
)
# First, remove anything we did with test-setup (currently, the firewall).
# First, remove anything we did with test-setup (currently, the firewall).
# NOTE: Keep in sync with names above in test-setup.
# NOTE: Keep in sync with names above in test-setup.
"
${
GCLOUD
}
"
compute firewall-rules delete
"
${
MINION_TAG
}
-
${
USER
}
-
http-alt"
\
"
${
GCLOUD
}
"
compute firewall-rules delete
"
${
MINION_TAG
}
-http-alt"
\
--project
=
"
${
PROJECT
}
"
||
true
--project
=
"
${
PROJECT
}
"
||
true
"
${
GCLOUD
}
"
compute firewall-rules delete
"
${
MINION_TAG
}
-
${
USER
}
-
nodeports"
\
"
${
GCLOUD
}
"
compute firewall-rules delete
"
${
MINION_TAG
}
-nodeports"
\
--project
=
"
${
PROJECT
}
"
||
true
--project
=
"
${
PROJECT
}
"
||
true
# Then actually turn down the cluster.
# Then actually turn down the cluster.
...
...
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