|
| 1 | +#!/usr/bin/env bash |
| 2 | + |
| 3 | +# Copyright 2026 The Kubernetes Authors. |
| 4 | +# |
| 5 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | +# you may not use this file except in compliance with the License. |
| 7 | +# You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, software |
| 12 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | +# See the License for the specific language governing permissions and |
| 15 | +# limitations under the License. |
| 16 | + |
| 17 | +set -e |
| 18 | +set -x |
| 19 | + |
| 20 | +# We need an instance group with a large single single node for addons such as prometheus, exec-service, etc. |
| 21 | +# In kubeup we used to call it heapster due to name of first addon, but now we call it addons. |
| 22 | + |
| 23 | +if [[ "${CLOUD_PROVIDER}" == "aws" ]]; then |
| 24 | + kops create instancegroup addons --edit=false --role node --zone us-east-2b |
| 25 | + kops edit instancegroup addons --set=spec.machineType="${ADDONS_NODE_SIZE:-c7a.8xlarge}" \ |
| 26 | + --set=spec.maxSize=1 --set=spec.minSize=1 --set=spec.image="ssm:/aws/service/canonical/ubuntu/server/24.04/stable/current/amd64/hvm/ebs-gp3/ami-id" |
| 27 | +elif [[ "${CLOUD_PROVIDER}" == "gce" ]]; then |
| 28 | + kops create instancegroup addons --edit=false --role node --zone us-east1-b |
| 29 | + kops edit instancegroup addons --set=spec.machineType="${ADDONS_NODE_SIZE:-c3-standard-22}" \ |
| 30 | + --set=spec.maxSize=1 --set=spec.minSize=1 \ |
| 31 | + --set=spec.image="${INSTANCE_IMAGE:-ubuntu-os-cloud/ubuntu-2404-noble-amd64-v20251001}" |
| 32 | +fi |
| 33 | + |
| 34 | +kops update cluster --yes |
| 35 | +sleep 120 # it shouldn't take long to have the node up and ready |
| 36 | +# TODO: replace with kops validate instancegroup instead of the wait |
0 commit comments