Add test case for node labels and taints

This commit is contained in:
Flo Piboubès 2025-06-13 11:05:21 +02:00
parent eb6bc8544a
commit 804d6a6065
4 changed files with 9 additions and 2 deletions

View File

@ -45,6 +45,7 @@ KubeletConfig:
kubeconfigPath: /var/lib/kubelet/kubeconfig
logLevel: 2
nodeLabels:
kops.k8s.io/instancegroup: nodes
node-role.kubernetes.io/node: ""
podInfraContainerImage: registry.k8s.io/pause:3.9
podManifestPath: /etc/kubernetes/manifests
@ -52,6 +53,8 @@ KubeletConfig:
registerSchedulable: true
shutdownGracePeriod: 30s
shutdownGracePeriodCriticalPods: 10s
taints:
- a=b:c
KubernetesVersion: 1.32.0
Networking:
nonMasqueradeCIDR: 100.64.0.0/10

View File

@ -152,7 +152,7 @@ ConfigServer:
- https://kops-controller.internal.ha-gce.example.com:3988/
InstanceGroupName: nodes
InstanceGroupRole: Node
NodeupConfigHash: yKU09Zx4MJaCy5r784FI8CXqrVXqnDp7nZdOuzohYlU=
NodeupConfigHash: RTYXnI1xkrWZ/Bnir7cCMFBfUMzhd6uvrj0Zkdg5Z7o=
__EOF_KUBE_ENV

View File

@ -132,9 +132,13 @@ spec:
machineType: e2-medium
maxSize: 2
minSize: 2
nodeLabels:
kops.k8s.io/instancegroup: nodes
role: Node
subnets:
- us-test1
taints:
- a=b:c
zones:
- us-test1-a
- us-test1-b

View File

@ -741,7 +741,7 @@ resource "google_compute_instance_template" "nodes-ha-gce-example-com" {
metadata = {
"cluster-name" = "ha-gce.example.com"
"kops-k8s-io-instance-group-name" = "nodes"
"kube-env" = "AUTOSCALER_ENV_VARS: os_distribution=ubuntu;arch=amd64;os=linux"
"kube-env" = "AUTOSCALER_ENV_VARS: os_distribution=ubuntu;arch=amd64;os=linux;node_labels=kops.k8s.io/instancegroup=nodes;node_taints=a=b:c"
"ssh-keys" = "admin: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCtWu40XQo8dczLsCq0OWV+hxm9uV3WxeH9Kgh4sMzQxNtoU1pvW0XdjpkBesRKGoolfWeCLXWxpyQb1IaiMkKoz7MdhQ/6UKjMjP66aFWWp3pwD0uj0HuJ7tq4gKHKRYGTaZIRWpzUiANBrjugVgA+Sd7E/mYwc/DMXkIyRZbvhQ=="
"user-data" = file("${path.module}/data/google_compute_instance_template_nodes-ha-gce-example-com_metadata_user-data")
}