-
Notifications
You must be signed in to change notification settings - Fork 38.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the salt-overlay directory to the GCE master-pd and reserve the master's IP #4715
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -433,6 +433,13 @@ function kube-up { | |
--target-tags "${MASTER_TAG}" \ | ||
--allow tcp:443 & | ||
|
||
# We have to make sure the disk is created before creating the master VM, so | ||
# run this in the foreground. | ||
gcloud compute disks create "${MASTER_NAME}-pd" \ | ||
--project "${PROJECT}" \ | ||
--zone "${ZONE}" \ | ||
--size "10GB" | ||
|
||
( | ||
echo "#! /bin/bash" | ||
echo "mkdir -p /var/cache/kubernetes-install" | ||
|
@@ -454,28 +461,12 @@ function kube-up { | |
echo "readonly DNS_SERVER_IP='${DNS_SERVER_IP:-}'" | ||
echo "readonly DNS_DOMAIN='${DNS_DOMAIN:-}'" | ||
grep -v "^#" "${KUBE_ROOT}/cluster/gce/templates/common.sh" | ||
grep -v "^#" "${KUBE_ROOT}/cluster/gce/templates/format-and-mount-pd.sh" | ||
grep -v "^#" "${KUBE_ROOT}/cluster/gce/templates/mount-pd.sh" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you miss committing this file, or did I miss something? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ugh, yeah. Thanks for catching that. |
||
grep -v "^#" "${KUBE_ROOT}/cluster/gce/templates/create-dynamic-salt-files.sh" | ||
grep -v "^#" "${KUBE_ROOT}/cluster/gce/templates/download-release.sh" | ||
grep -v "^#" "${KUBE_ROOT}/cluster/gce/templates/salt-master.sh" | ||
) > "${KUBE_TEMP}/master-start.sh" | ||
|
||
# Report logging choice (if any). | ||
if [[ "${ENABLE_NODE_LOGGING-}" == "true" ]]; then | ||
echo "+++ Logging using Fluentd to ${LOGGING_DESTINATION:-unknown}" | ||
# For logging to GCP we need to enable some minion scopes. | ||
if [[ "${LOGGING_DESTINATION-}" == "gcp" ]]; then | ||
MINION_SCOPES+=('https://www.googleapis.com/auth/logging.write') | ||
fi | ||
fi | ||
|
||
# We have to make sure the disk is created before creating the master VM, so | ||
# run this in the foreground. | ||
gcloud compute disks create "${MASTER_NAME}-pd" \ | ||
--project "${PROJECT}" \ | ||
--zone "${ZONE}" \ | ||
--size "10GB" | ||
|
||
gcloud compute instances create "${MASTER_NAME}" \ | ||
--project "${PROJECT}" \ | ||
--zone "${ZONE}" \ | ||
|
@@ -491,6 +482,15 @@ function kube-up { | |
# Create a single firewall rule for all minions. | ||
create-firewall-rule "${MINION_TAG}-all" "${CLUSTER_IP_RANGE}" "${MINION_TAG}" & | ||
|
||
# Report logging choice (if any). | ||
if [[ "${ENABLE_NODE_LOGGING-}" == "true" ]]; then | ||
echo "+++ Logging using Fluentd to ${LOGGING_DESTINATION:-unknown}" | ||
# For logging to GCP we need to enable some minion scopes. | ||
if [[ "${LOGGING_DESTINATION-}" == "gcp" ]]; then | ||
MINION_SCOPES+=('https://www.googleapis.com/auth/logging.write') | ||
fi | ||
fi | ||
|
||
# Wait for last batch of jobs. | ||
wait-for-jobs | ||
|
||
|
@@ -548,6 +548,16 @@ function kube-up { | |
|
||
detect-master | ||
|
||
# Reserve the master's IP so that it can later be transferred to another VM | ||
# without disrupting the kubelets. IPs are associated with regions, not zones, | ||
# so extract the region name, which is the same as the zone but with the final | ||
# dash and characters trailing the dash removed. | ||
local REGION=${ZONE%-*} | ||
gcloud compute addresses create "${MASTER_NAME}-ip" \ | ||
--project "${PROJECT}" \ | ||
--addresses "${KUBE_MASTER_IP}" \ | ||
--region "${REGION}" | ||
|
||
echo "Waiting for cluster initialization." | ||
echo | ||
echo " This will continually check to see if the API for kubernetes is reachable." | ||
|
@@ -727,6 +737,14 @@ function kube-down { | |
routes=( "${routes[@]:10}" ) | ||
done | ||
|
||
# Delete the master's reserved IP | ||
local REGION=${ZONE%-*} | ||
gcloud compute addresses delete \ | ||
--project "${PROJECT}" \ | ||
--region "${REGION}" \ | ||
--quiet \ | ||
"${MASTER_NAME}-ip" || true | ||
|
||
} | ||
|
||
# Update a kubernetes cluster with latest source | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain the re-organizations in here, both of the
compute disks create
and theMINION_SCOPES
? They don't seem to be necessary?If it's just cleanup, maybe revert or put in a separate commit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's just cleanup to keep the commands grouped more logically. I'll move it into a separate commit. Is it fine if I leave it in this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I'm happy in the same PR. I was just trying to make sure there wasn't something I was missing.