mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 19:01:49 +00:00
Merge pull request #59916 from kawych/cluster-location
Automatic merge from submit-queue (batch tested with PRs 59634, 59821, 57850, 59916, 60032). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Add cluster-location to GCE instance attributes **What this PR does / why we need it**: Exposes cluster location on GCP as instance attribute. In particular, this metadata is useful for exposing metrics to Stackdriver monitoring system and is necessary for some Stackdriver integration components, i.e. Stackdriver Metadata Agent **Release note**: ```release-note NONE ```
This commit is contained in:
commit
b31e94dc19
@ -108,6 +108,7 @@ function create-master-instance-internal() {
|
||||
local metadata="kube-env=${KUBE_TEMP}/master-kube-env.yaml"
|
||||
metadata="${metadata},user-data=${KUBE_ROOT}/cluster/gce/gci/master.yaml"
|
||||
metadata="${metadata},configure-sh=${KUBE_ROOT}/cluster/gce/gci/configure.sh"
|
||||
metadata="${metadata},cluster-location=${KUBE_TEMP}/cluster-location.txt"
|
||||
metadata="${metadata},cluster-name=${KUBE_TEMP}/cluster-name.txt"
|
||||
metadata="${metadata},gci-update-strategy=${KUBE_TEMP}/gci-update.txt"
|
||||
metadata="${metadata},gci-ensure-gke-docker=${KUBE_TEMP}/gci-ensure-gke-docker.txt"
|
||||
|
@ -22,6 +22,7 @@ function get-node-instance-metadata {
|
||||
metadata+="kube-env=${KUBE_TEMP}/node-kube-env.yaml,"
|
||||
metadata+="user-data=${KUBE_ROOT}/cluster/gce/gci/node.yaml,"
|
||||
metadata+="configure-sh=${KUBE_ROOT}/cluster/gce/gci/configure.sh,"
|
||||
metadata+="cluster-location=${KUBE_TEMP}/cluster-location.txt,"
|
||||
metadata+="cluster-name=${KUBE_TEMP}/cluster-name.txt,"
|
||||
metadata+="gci-update-strategy=${KUBE_TEMP}/gci-update.txt,"
|
||||
metadata+="gci-ensure-gke-docker=${KUBE_TEMP}/gci-ensure-gke-docker.txt,"
|
||||
|
@ -151,6 +151,7 @@ function prepare-upgrade() {
|
||||
detect-project
|
||||
detect-subnetworks
|
||||
detect-node-names # sets INSTANCE_GROUPS
|
||||
write-cluster-location
|
||||
write-cluster-name
|
||||
tars_from_version
|
||||
}
|
||||
|
@ -472,6 +472,15 @@ function yaml-quote {
|
||||
echo "'$(echo "${@:-}" | sed -e "s/'/''/g")'"
|
||||
}
|
||||
|
||||
# Writes the cluster location into a temporary file.
|
||||
# Assumed vars
|
||||
# ZONE
|
||||
function write-cluster-location {
|
||||
cat >"${KUBE_TEMP}/cluster-location.txt" << EOF
|
||||
${ZONE}
|
||||
EOF
|
||||
}
|
||||
|
||||
# Writes the cluster name into a temporary file.
|
||||
# Assumed vars
|
||||
# CLUSTER_NAME
|
||||
@ -1499,6 +1508,7 @@ function kube-up() {
|
||||
create-network
|
||||
create-subnetworks
|
||||
detect-subnetworks
|
||||
write-cluster-location
|
||||
write-cluster-name
|
||||
create-autoscaler-config
|
||||
create-master
|
||||
|
Loading…
Reference in New Issue
Block a user