diff --git a/.ci/scripts/kind-setup.sh b/.ci/scripts/kind-setup.sh index fa4f66dd6e6..d2c9eeeb771 100755 --- a/.ci/scripts/kind-setup.sh +++ b/.ci/scripts/kind-setup.sh @@ -1,5 +1,23 @@ #!/usr/bin/env bash set -exuo pipefail -kind create cluster --image kindest/node:${K8S_VERSION} +kind create cluster --image kindest/node:${K8S_VERSION} --config - < 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") } diff --git a/deploy/kubernetes/Jenkinsfile.yml b/deploy/kubernetes/Jenkinsfile.yml index 107e15107c3..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.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.19,v1.17.17,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 64dfc99ab65..6966e82406c 100644 --- a/metricbeat/module/kubernetes/test/integration.go +++ b/metricbeat/module/kubernetes/test/integration.go @@ -71,11 +71,11 @@ 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"}, } } -// 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"}, + } +}