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
ef91e2bb
Commit
ef91e2bb
authored
Nov 22, 2016
by
Jerzy Szczepkowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
HA master, fixed replica name when creating load balancer.
HA master, fixed replica name when creating load balancer. Was broken when replica w/o suffix is no longer in the cluster.
parent
acb8a3f7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
util.sh
cluster/gce/util.sh
+6
-3
No files found.
cluster/gce/util.sh
View file @
ef91e2bb
...
...
@@ -1008,17 +1008,20 @@ function create-loadbalancer() {
echo
"Load balancer already exists"
return
fi
local
EXISTING_MASTER_ZONE
=
$(
gcloud compute instances list
"
${
MASTER_NAME
}
"
\
local
EXISTING_MASTER_NAME
=
"
$(
get-all-replica-names
)
"
local
EXISTING_MASTER_ZONE
=
$(
gcloud compute instances list
"
${
EXISTING_MASTER_NAME
}
"
\
--project
"
${
PROJECT
}
"
--format
=
"value(zone)"
)
echo
"Creating load balancer in front of an already existing master in
${
EXISTING_MASTER_ZONE
}
"
# Step 1: Detach master IP address and attach ephemeral address to the existing master
attach-external-ip
${
MASTER_NAME
}
${
EXISTING_MASTER_ZONE
}
attach-external-ip
"
${
EXISTING_MASTER_NAME
}
"
"
${
EXISTING_MASTER_ZONE
}
"
# Step 2: Create target pool.
gcloud compute target-pools create
"
${
MASTER_NAME
}
"
--region
"
${
REGION
}
"
# TODO: We should also add master instances with suffixes
gcloud compute target-pools add-instances
${
MASTER_NAME
}
--instances
${
MASTER_NAME
}
--zone
${
EXISTING_MASTER_ZONE
}
gcloud compute target-pools add-instances
"
${
MASTER_NAME
}
"
--instances
"
${
EXISTING_MASTER_NAME
}
"
--zone
"
${
EXISTING_MASTER_ZONE
}
"
# Step 3: Create forwarding rule.
# TODO: This step can take up to 20 min. We need to speed this up...
...
...
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