Skip to content

Commit 9df2172

Browse files
ChrsMarkmergify-bot
authored andcommitted
Add latest k8s versions in testing (#26729)
(cherry picked from commit 1654489)
1 parent b42ffc4 commit 9df2172

7 files changed

Lines changed: 39 additions & 8 deletions

File tree

.ci/scripts/kind-setup.sh

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
#!/usr/bin/env bash
22
set -exuo pipefail
33

4-
kind create cluster --image kindest/node:${K8S_VERSION}
4+
kind create cluster --image kindest/node:${K8S_VERSION} --config - <<EOF
5+
kind: Cluster
6+
apiVersion: kind.x-k8s.io/v1alpha4
7+
nodes:
8+
- role: control-plane
9+
kubeadmConfigPatches:
10+
- |
11+
kind: ClusterConfiguration
12+
scheduler:
13+
extraArgs:
14+
bind-address: "0.0.0.0"
15+
port: "10251"
16+
secure-port: "10259"
17+
controllerManager:
18+
extraArgs:
19+
bind-address: "0.0.0.0"
20+
port: "10252"
21+
secure-port: "10257"
22+
EOF
523
kubectl cluster-info

Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ def k8sTest(Map args = [:]) {
300300
versions.each{ v ->
301301
withNode(labels: args.label, forceWorkspace: true){
302302
stage("${args.context} ${v}"){
303-
withEnv(["K8S_VERSION=${v}", "KIND_VERSION=v0.7.0", "KUBECONFIG=${env.WORKSPACE}/kubecfg"]){
303+
withEnv(["K8S_VERSION=${v}", "KIND_VERSION=v0.11.1", "KUBECONFIG=${env.WORKSPACE}/kubecfg"]){
304304
withGithubNotify(context: "${args.context} ${v}") {
305305
withBeatsEnv(archive: false, withModule: false) {
306306
retryWithSleep(retries: 2, seconds: 5, backoff: true){ sh(label: "Install kind", script: ".ci/scripts/install-kind.sh") }

deploy/kubernetes/Jenkinsfile.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ stages:
1818
make check-no-changes;
1919
stage: lint
2020
k8sTest:
21-
k8sTest: "v1.18.2,v1.17.2,v1.16.4,v1.15.7,v1.14.10"
21+
k8sTest: "v1.21.1,v1.20.7,v1.19.11,v1.18.19,v1.17.17,v1.14.10"
2222
stage: mandatory

metricbeat/docs/modules/kubernetes.asciidoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,8 @@ roleRef:
144144
[float]
145145
=== Compatibility
146146

147-
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
147+
The Kubernetes module is tested with the following versions of Kubernetes:
148+
1.14.x, 1.17.x, 1.18.x, 1.19.x, 1.20.x, 1.21.x
148149

149150
[float]
150151
=== Dashboard

metricbeat/module/kubernetes/_meta/docs.asciidoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@ roleRef:
137137
[float]
138138
=== Compatibility
139139

140-
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
140+
The Kubernetes module is tested with the following versions of Kubernetes:
141+
1.14.x, 1.17.x, 1.18.x, 1.19.x, 1.20.x, 1.21.x
141142

142143
[float]
143144
=== Dashboard

metricbeat/module/kubernetes/controllermanager/controllermanager_integration_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import (
2929
)
3030

3131
func TestFetchMetricset(t *testing.T) {
32-
config := test.GetAPIServerConfig(t, "controllermanager")
32+
config := test.GetControllerManagerConfig(t, "controllermanager")
3333
metricSet := mbtest.NewFetcher(t, config)
3434
events, errs := metricSet.FetchEvents()
3535
if len(errs) > 0 {

metricbeat/module/kubernetes/test/integration.go

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@ func GetKubeProxyConfig(t *testing.T, metricSetName string) map[string]interface
7171
"module": "kubernetes",
7272
"metricsets": []string{metricSetName},
7373
"host": "${NODE_NAME}",
74-
"hosts": []string{"localhost:10252"},
74+
"hosts": []string{"localhost:10249"},
7575
}
7676
}
7777

78-
// GetSchedulerConfig function returns configuration for talking to kube-proxy.
78+
// GetSchedulerConfig function returns configuration for talking to kube-scheduler.
7979
func GetSchedulerConfig(t *testing.T, metricSetName string) map[string]interface{} {
8080
t.Helper()
8181
return map[string]interface{}{
@@ -85,3 +85,14 @@ func GetSchedulerConfig(t *testing.T, metricSetName string) map[string]interface
8585
"hosts": []string{"localhost:10251"},
8686
}
8787
}
88+
89+
// GetControllerManagerConfig function returns configuration for talking to kube-controller-manager.
90+
func GetControllerManagerConfig(t *testing.T, metricSetName string) map[string]interface{} {
91+
t.Helper()
92+
return map[string]interface{}{
93+
"module": "kubernetes",
94+
"metricsets": []string{metricSetName},
95+
"host": "${NODE_NAME}",
96+
"hosts": []string{"localhost:10252"},
97+
}
98+
}

0 commit comments

Comments
 (0)