Change:
If you create a private cluster via kube-up using provider GCE, you won't be able to restart your master nodes. If you restart you master, the nodes won't be able to connect to your master. This is due to this line - It gets executed on master on cluster-up, but it won't be re-executed on master restart. We should fix that, especially if we're to implement /sig scalability /priority important-soon
Issues go stale after 90d of inactivity. Mark the issue as fresh with . Stale issues rot after an additional 30d of inactivity and eventually close. If this issue is safe to close now please do so with . Send feedback to sig-testing, kubernetes/test-infra and/or . /lifecycle stale
/remove-lifecycle stale /good-first-issue I'll ask whether someone in SIG Scalability public meeting would like to take on this one
This request has been marked as suitable for new contributors. Please ensure the request meets the requirements listed . If this request no longer meets these requirements, the label can be removed by commenting with the command. <detailsIn response to : /remove-lifecycle stale /good-first-issue Instructions for interacting with me using PR comments are available . If you have questions or suggestions related to my behavior, please file an issue against the repository. </details
Hello, Can I start work on this one as my first issue? :)
I don't see anyone else claiming it, so your contributions are welcome :)
let me know if you need any explanations here
Thank you :) I've made some changes and assign you can you tell me is this will be good approach?
Thanks, I replied in the PR

Discussion:
<ins> #!/usr/bin/env bash # Copyright 2016 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # #     http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. METADATA_ENDPOINT="http://metadata.google.internal/computeMetadata/v1/instance/attributes/kube-master-internal-ip" METADATA_HEADER="Metadata-Flavor: Google" ip=$(curl -s --fail ${METADATA_ENDPOINT} -H "${METADATA_HEADER}") if [ -n "$ip" ]; then # Check if route is already set if not set it if ! sudo ip route show table local | grep -q "$(echo "$ip" | cut -d'/' -f 1)"; then sudo ip route add to local "${ip}/32" dev "$(ip route | grep default | awk '{print $5}')" fi fi </ins>

metadata="${metadata},gci-docker-version=${KUBE_TEMP}/gci-docker-version.txt" metadata="${metadata},kube-master-certs=${KUBE_TEMP}/kube-master-certs.yaml" metadata="${metadata},cluster-location=${KUBE_TEMP}/cluster-location.txt" <ins> metadata="${metadata},kube-master-internal-route=${KUBE_ROOT}/cluster/gce/gci/kube-master-internal-route.sh" </ins> metadata="${metadata},${MASTER_EXTRA_METADATA}" local disk="name=${master_name}-pd"

[Install] WantedBy=kubernetes.target <ins> - path: /etc/systemd/system/kube-master-internal-route.service permissions: 0644 owner: root content: | [Unit] Description=Configure kube internal route After=kube-master-installation.service [Service] Type=oneshot RemainAfterExit=yes ExecStartPre=/usr/bin/curl --fail --retry 5 --retry-delay 3 --silent --show-error -H "X-Google-Metadata-Request: True" -o /home/kubernetes/bin/kube-master-internal-route.sh http://metadata.google.internal/computeMetadata/v1/instance/attributes/kube-master-internal-route ExecStartPre=/bin/chmod 544 /home/kubernetes/bin/kube-master-internal-route.sh ExecStart=/home/kubernetes/bin/kube-master-internal-route.sh [Install] WantedBy=kubernetes.target </ins> - path: /etc/systemd/system/kube-master-configuration.service permissions: 0644 owner: root

runcmd: - systemctl daemon-reload - systemctl enable kube-master-installation.service <ins> - systemctl enable kube-master-internal-route.service </ins> - systemctl enable kube-master-configuration.service - systemctl enable kube-container-runtime-monitor.service - systemctl enable kubelet-monitor.service

echo "Setting ${name}'s aliases to '${aliases}' (added ${ip})" # Attach ${ip} to ${name} gcloud compute instances network-interfaces update "${name}" --project "${PROJECT}" --zone "${zone}" --aliases="${aliases}" <del> run-gcloud-command "${name}" "${zone}" 'sudo ip route add to local '${ip}'/32 dev $(ip route | grep default | awk '''{print $5}''')' || true </del> <ins> gcloud compute instances add-metadata "${name}" --zone "${zone}" --metadata=kube-master-internal-ip="${ip}" run-gcloud-command "${name}" "${zone}" 'sudo /bin/bash /home/kubernetes/bin/kube-master-internal-route.sh' || true </ins> return $? }

echo "Setting ${name}'s aliases to '${aliases}' (removed ${ip})" # Detach ${MASTER_NAME}-internal-ip from ${name} gcloud compute instances network-interfaces update "${name}" --project "${PROJECT}" --zone "${zone}" --aliases="${aliases}" <ins> gcloud compute instances remove-metadata "${name}" --zone "${zone}" --keys=kube-master-internal-ip </ins> run-gcloud-command "${name}" "${zone}" 'sudo ip route del to local '${ip}'/32 dev $(ip route | grep default | awk '''{print $5}''')' || true return $? }