From 74b4802b46a3c01349a7f92764359fa171908282 Mon Sep 17 00:00:00 2001 From: Ethan Mosbaugh Date: Tue, 24 May 2022 11:05:59 -0700 Subject: [PATCH] Add support for k8s 1.24+ --- pkg/analyze/distribution.go | 3 +++ pkg/collect/copy_from_host.go | 5 +++++ pkg/collect/run_pod.go | 5 +++++ 3 files changed, 13 insertions(+) diff --git a/pkg/analyze/distribution.go b/pkg/analyze/distribution.go index 09be8ea6..18e937a5 100644 --- a/pkg/analyze/distribution.go +++ b/pkg/analyze/distribution.go @@ -73,6 +73,9 @@ func ParseNodesForProviders(nodes []corev1.Node) (providers, string) { if k == "node-role.kubernetes.io/master" { foundMaster = true } + if k == "node-role.kubernetes.io/control-plane" { + foundMaster = true + } if k == "kubernetes.azure.com/role" { foundProviders.aks = true stringProvider = "aks" diff --git a/pkg/collect/copy_from_host.go b/pkg/collect/copy_from_host.go index f40230a8..3ead703c 100644 --- a/pkg/collect/copy_from_host.go +++ b/pkg/collect/copy_from_host.go @@ -137,6 +137,11 @@ func copyFromHostCreateDaemonSet(ctx context.Context, client kubernetes.Interfac Operator: "Exists", Effect: "NoSchedule", }, + { + Key: "node-role.kubernetes.io/control-plane", + Operator: "Exists", + Effect: "NoSchedule", + }, }, Volumes: []corev1.Volume{ { diff --git a/pkg/collect/run_pod.go b/pkg/collect/run_pod.go index 171dcbb5..1a6ef7a1 100644 --- a/pkg/collect/run_pod.go +++ b/pkg/collect/run_pod.go @@ -69,6 +69,11 @@ func RunPodsReadyNodes(ctx context.Context, client v1.CoreV1Interface, opts RunP Operator: "Exists", Effect: "NoSchedule", }, + { + Key: "node-role.kubernetes.io/control-plane", + Operator: "Exists", + Effect: "NoSchedule", + }, }, }, }