From 7531423264c30a97b6a75976fbc1ef5eaca80830 Mon Sep 17 00:00:00 2001 From: chrismark Date: Tue, 6 Jul 2021 12:33:05 +0300 Subject: [PATCH 1/9] Add latest k8s versions in testing Signed-off-by: chrismark --- deploy/kubernetes/Jenkinsfile.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/kubernetes/Jenkinsfile.yml b/deploy/kubernetes/Jenkinsfile.yml index 107e15107c3..cf677386ea5 100644 --- a/deploy/kubernetes/Jenkinsfile.yml +++ b/deploy/kubernetes/Jenkinsfile.yml @@ -18,5 +18,5 @@ stages: make check-no-changes; stage: lint k8sTest: - k8sTest: "v1.18.2,v1.17.2,v1.16.4,v1.15.7,v1.14.10" + k8sTest: "v1.21.1,v1.20.7,v1.19.11,v1.18.2,v1.17.2,v1.16.4,v1.15.7,v1.14.10" stage: mandatory From 3e993a803cd35e8b54a6e99bd08265dc4e0c5fd4 Mon Sep 17 00:00:00 2001 From: chrismark Date: Tue, 6 Jul 2021 14:12:38 +0300 Subject: [PATCH 2/9] try: norrow down versions Signed-off-by: chrismark --- deploy/kubernetes/Jenkinsfile.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/kubernetes/Jenkinsfile.yml b/deploy/kubernetes/Jenkinsfile.yml index cf677386ea5..e953925a728 100644 --- a/deploy/kubernetes/Jenkinsfile.yml +++ b/deploy/kubernetes/Jenkinsfile.yml @@ -18,5 +18,5 @@ stages: make check-no-changes; stage: lint k8sTest: - k8sTest: "v1.21.1,v1.20.7,v1.19.11,v1.18.2,v1.17.2,v1.16.4,v1.15.7,v1.14.10" + k8sTest: "v1.20.7,v1.19.11,v1.18.2,v1.17.2,v1.16.4,v1.15.7,v1.14.10" stage: mandatory From 9c870567e95de4e1df36c6990fc52d4a53ac0136 Mon Sep 17 00:00:00 2001 From: chrismark Date: Tue, 6 Jul 2021 16:19:57 +0300 Subject: [PATCH 3/9] fix proxy port Signed-off-by: chrismark --- metricbeat/module/kubernetes/test/integration.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/metricbeat/module/kubernetes/test/integration.go b/metricbeat/module/kubernetes/test/integration.go index 64dfc99ab65..4f42c223084 100644 --- a/metricbeat/module/kubernetes/test/integration.go +++ b/metricbeat/module/kubernetes/test/integration.go @@ -71,7 +71,7 @@ func GetKubeProxyConfig(t *testing.T, metricSetName string) map[string]interface "module": "kubernetes", "metricsets": []string{metricSetName}, "host": "${NODE_NAME}", - "hosts": []string{"localhost:10252"}, + "hosts": []string{"localhost:10249"}, } } @@ -84,4 +84,8 @@ func GetSchedulerConfig(t *testing.T, metricSetName string) map[string]interface "host": "${NODE_NAME}", "hosts": []string{"localhost:10251"}, } + //hosts: + // - https://0.0.0.0:10257 + //bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token + // ssl.verification_mode: "none" } From f3bcc01a0c716d0f9e0f2c5b5aa4e66b3a915dd3 Mon Sep 17 00:00:00 2001 From: chrismark Date: Wed, 7 Jul 2021 10:58:27 +0300 Subject: [PATCH 4/9] Patch kind config Signed-off-by: chrismark --- .ci/scripts/kind-setup.sh | 15 ++++++++++++++- metricbeat/module/kubernetes/test/integration.go | 4 ---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.ci/scripts/kind-setup.sh b/.ci/scripts/kind-setup.sh index fa4f66dd6e6..f4cde228efc 100755 --- a/.ci/scripts/kind-setup.sh +++ b/.ci/scripts/kind-setup.sh @@ -1,5 +1,18 @@ #!/usr/bin/env bash set -exuo pipefail -kind create cluster --image kindest/node:${K8S_VERSION} +kind create cluster --image kindest/node:${K8S_VERSION} --config - < Date: Wed, 7 Jul 2021 11:56:52 +0300 Subject: [PATCH 5/9] More fixes Signed-off-by: chrismark --- .ci/scripts/kind-setup.sh | 5 +++++ deploy/kubernetes/Jenkinsfile.yml | 2 +- metricbeat/docs/modules/kubernetes.asciidoc | 3 ++- metricbeat/module/kubernetes/_meta/docs.asciidoc | 3 ++- .../controllermanager_integration_test.go | 2 +- metricbeat/module/kubernetes/test/integration.go | 13 ++++++++++++- 6 files changed, 23 insertions(+), 5 deletions(-) diff --git a/.ci/scripts/kind-setup.sh b/.ci/scripts/kind-setup.sh index f4cde228efc..d2c9eeeb771 100755 --- a/.ci/scripts/kind-setup.sh +++ b/.ci/scripts/kind-setup.sh @@ -14,5 +14,10 @@ nodes: bind-address: "0.0.0.0" port: "10251" secure-port: "10259" + controllerManager: + extraArgs: + bind-address: "0.0.0.0" + port: "10252" + secure-port: "10257" EOF kubectl cluster-info diff --git a/deploy/kubernetes/Jenkinsfile.yml b/deploy/kubernetes/Jenkinsfile.yml index e953925a728..4f6c06d8f56 100644 --- a/deploy/kubernetes/Jenkinsfile.yml +++ b/deploy/kubernetes/Jenkinsfile.yml @@ -18,5 +18,5 @@ stages: make check-no-changes; stage: lint k8sTest: - k8sTest: "v1.20.7,v1.19.11,v1.18.2,v1.17.2,v1.16.4,v1.15.7,v1.14.10" + k8sTest: "v1.20.7,v1.19.11,v1.18.2,v1.17.2,v1.14.10" stage: mandatory diff --git a/metricbeat/docs/modules/kubernetes.asciidoc b/metricbeat/docs/modules/kubernetes.asciidoc index 042c972f6c5..dc7581ff79b 100644 --- a/metricbeat/docs/modules/kubernetes.asciidoc +++ b/metricbeat/docs/modules/kubernetes.asciidoc @@ -144,7 +144,8 @@ roleRef: [float] === Compatibility -The Kubernetes module is tested with Kubernetes 1.13.x, 1.14.x, 1.15.x, 1.16.x, 1.17.x, and 1.18.x +The Kubernetes module is tested with the following versions of Kubernetes: +1.14.x, 1.17.x, 1.18.x, 1.19.x, 1.20.x, 1.21.x [float] === Dashboard diff --git a/metricbeat/module/kubernetes/_meta/docs.asciidoc b/metricbeat/module/kubernetes/_meta/docs.asciidoc index daba6d728a6..11fc568d010 100644 --- a/metricbeat/module/kubernetes/_meta/docs.asciidoc +++ b/metricbeat/module/kubernetes/_meta/docs.asciidoc @@ -137,7 +137,8 @@ roleRef: [float] === Compatibility -The Kubernetes module is tested with Kubernetes 1.13.x, 1.14.x, 1.15.x, 1.16.x, 1.17.x, and 1.18.x +The Kubernetes module is tested with the following versions of Kubernetes: +1.14.x, 1.17.x, 1.18.x, 1.19.x, 1.20.x, 1.21.x [float] === Dashboard diff --git a/metricbeat/module/kubernetes/controllermanager/controllermanager_integration_test.go b/metricbeat/module/kubernetes/controllermanager/controllermanager_integration_test.go index f07bb7b1071..285242ebb03 100644 --- a/metricbeat/module/kubernetes/controllermanager/controllermanager_integration_test.go +++ b/metricbeat/module/kubernetes/controllermanager/controllermanager_integration_test.go @@ -29,7 +29,7 @@ import ( ) func TestFetchMetricset(t *testing.T) { - config := test.GetAPIServerConfig(t, "controllermanager") + config := test.GetControllerManagerConfig(t, "controllermanager") metricSet := mbtest.NewFetcher(t, config) events, errs := metricSet.FetchEvents() if len(errs) > 0 { diff --git a/metricbeat/module/kubernetes/test/integration.go b/metricbeat/module/kubernetes/test/integration.go index 207f3ff2dd1..6966e82406c 100644 --- a/metricbeat/module/kubernetes/test/integration.go +++ b/metricbeat/module/kubernetes/test/integration.go @@ -75,7 +75,7 @@ func GetKubeProxyConfig(t *testing.T, metricSetName string) map[string]interface } } -// GetSchedulerConfig function returns configuration for talking to kube-proxy. +// GetSchedulerConfig function returns configuration for talking to kube-scheduler. func GetSchedulerConfig(t *testing.T, metricSetName string) map[string]interface{} { t.Helper() return map[string]interface{}{ @@ -85,3 +85,14 @@ func GetSchedulerConfig(t *testing.T, metricSetName string) map[string]interface "hosts": []string{"localhost:10251"}, } } + +// GetControllerManagerConfig function returns configuration for talking to kube-controller-manager. +func GetControllerManagerConfig(t *testing.T, metricSetName string) map[string]interface{} { + t.Helper() + return map[string]interface{}{ + "module": "kubernetes", + "metricsets": []string{metricSetName}, + "host": "${NODE_NAME}", + "hosts": []string{"localhost:10252"}, + } +} From c8a71447ec7ef30f7a1bf803371e9d7453cf7fda Mon Sep 17 00:00:00 2001 From: chrismark Date: Wed, 7 Jul 2021 14:18:07 +0300 Subject: [PATCH 6/9] Add 1.21 Signed-off-by: chrismark --- deploy/kubernetes/Jenkinsfile.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/kubernetes/Jenkinsfile.yml b/deploy/kubernetes/Jenkinsfile.yml index 4f6c06d8f56..7e619914e15 100644 --- a/deploy/kubernetes/Jenkinsfile.yml +++ b/deploy/kubernetes/Jenkinsfile.yml @@ -18,5 +18,5 @@ stages: make check-no-changes; stage: lint k8sTest: - k8sTest: "v1.20.7,v1.19.11,v1.18.2,v1.17.2,v1.14.10" + k8sTest: "v1.21.1,v1.20.7,v1.19.11,v1.18.2,v1.17.2,v1.14.10" stage: mandatory From c846bc2f158f055b64c5e14a710aa9b5f297b13e Mon Sep 17 00:00:00 2001 From: chrismark Date: Wed, 7 Jul 2021 14:57:57 +0300 Subject: [PATCH 7/9] Upgrade kind version Signed-off-by: chrismark --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 527bcbecb55..c15af004a5e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -300,7 +300,7 @@ def k8sTest(Map args = [:]) { versions.each{ v -> withNode(labels: args.label, sleepMin: 30, sleepMax: 200, forceWorkspace: true){ stage("${args.context} ${v}"){ - withEnv(["K8S_VERSION=${v}", "KIND_VERSION=v0.7.0", "KUBECONFIG=${env.WORKSPACE}/kubecfg"]){ + withEnv(["K8S_VERSION=${v}", "KIND_VERSION=v0.11.1", "KUBECONFIG=${env.WORKSPACE}/kubecfg"]){ withGithubNotify(context: "${args.context} ${v}") { withBeatsEnv(archive: false, withModule: false) { retryWithSleep(retries: 2, seconds: 5, backoff: true){ sh(label: "Install kind", script: ".ci/scripts/install-kind.sh") } From 827ca24ce5ee1868b0d49480184b54d4ebd3c76a Mon Sep 17 00:00:00 2001 From: chrismark Date: Wed, 7 Jul 2021 16:15:35 +0300 Subject: [PATCH 8/9] Add latest versions Signed-off-by: chrismark --- deploy/kubernetes/Jenkinsfile.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/kubernetes/Jenkinsfile.yml b/deploy/kubernetes/Jenkinsfile.yml index 7e619914e15..0d5f984280b 100644 --- a/deploy/kubernetes/Jenkinsfile.yml +++ b/deploy/kubernetes/Jenkinsfile.yml @@ -18,5 +18,5 @@ stages: make check-no-changes; stage: lint k8sTest: - k8sTest: "v1.21.1,v1.20.7,v1.19.11,v1.18.2,v1.17.2,v1.14.10" + k8sTest: "v1.21.1,v1.20.7,v1.19.11,v1.18.20,v1.17.17,v1.14.10" stage: mandatory From 554728413f07101561fd7312777425c3b832e970 Mon Sep 17 00:00:00 2001 From: chrismark Date: Wed, 7 Jul 2021 17:10:11 +0300 Subject: [PATCH 9/9] Fix 1.18 version Signed-off-by: chrismark --- deploy/kubernetes/Jenkinsfile.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/kubernetes/Jenkinsfile.yml b/deploy/kubernetes/Jenkinsfile.yml index 0d5f984280b..8b9dfcded5a 100644 --- a/deploy/kubernetes/Jenkinsfile.yml +++ b/deploy/kubernetes/Jenkinsfile.yml @@ -18,5 +18,5 @@ stages: make check-no-changes; stage: lint k8sTest: - k8sTest: "v1.21.1,v1.20.7,v1.19.11,v1.18.20,v1.17.17,v1.14.10" + k8sTest: "v1.21.1,v1.20.7,v1.19.11,v1.18.19,v1.17.17,v1.14.10" stage: mandatory