Skip to content

Commit

Permalink
Add support for latest k8s versions (#29575)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrsMark authored Dec 23, 2021
1 parent 3a6bd25 commit 78e1c58
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 30 deletions.
20 changes: 1 addition & 19 deletions .ci/scripts/kind-setup.sh
Original file line number Diff line number Diff line change
@@ -1,23 +1,5 @@
#!/usr/bin/env bash
set -exuo pipefail

kind create cluster --image kindest/node:${K8S_VERSION} --config - <<EOF
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
kubeadmConfigPatches:
- |
kind: ClusterConfiguration
scheduler:
extraArgs:
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
kind create cluster --image kindest/node:${K8S_VERSION}
kubectl cluster-info
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Update k8s library {pull}29394[29394]
- Add FIPS configuration option for all AWS API calls. {pull}28899[28899]
- Add `default_region` config to AWS common module. {pull}29415[29415]
- Add support for latest k8s versions v1.23 and v1.22 {pull}29575[29575]

*Auditbeat*

Expand Down
2 changes: 1 addition & 1 deletion deploy/kubernetes/Jenkinsfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ stages:
make check-no-changes;
stage: lint
k8sTest:
k8sTest: "v1.21.1,v1.20.7,v1.19.11,v1.18.19,v1.17.17,v1.14.10"
k8sTest: "v1.23.0,v1.22.0,v1.21.1,v1.20.7,v1.19.11,v1.18.19"
stage: mandatory
2 changes: 1 addition & 1 deletion metricbeat/docs/modules/kubernetes.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ roleRef:
=== Compatibility

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
1.18.x, 1.19.x, 1.20.x, 1.21.x, 1.22.x, 1.23.x

[float]
=== Dashboard
Expand Down
2 changes: 1 addition & 1 deletion metricbeat/module/kubernetes/_meta/docs.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ roleRef:
=== Compatibility

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
1.18.x, 1.19.x, 1.20.x, 1.21.x, 1.22.x, 1.23.x

[float]
=== Dashboard
Expand Down
20 changes: 12 additions & 8 deletions metricbeat/module/kubernetes/test/integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,20 +79,24 @@ func GetKubeProxyConfig(t *testing.T, metricSetName string) map[string]interface
func GetSchedulerConfig(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:10251"},
"module": "kubernetes",
"metricsets": []string{metricSetName},
"host": "${NODE_NAME}",
"hosts": []string{"https://0.0.0.0:10259"},
"bearer_token_file": "/var/run/secrets/kubernetes.io/serviceaccount/token",
"ssl.verification_mode": "none",
}
}

// 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"},
"module": "kubernetes",
"metricsets": []string{metricSetName},
"host": "${NODE_NAME}",
"hosts": []string{"https://0.0.0.0:10257"},
"bearer_token_file": "/var/run/secrets/kubernetes.io/serviceaccount/token",
"ssl.verification_mode": "none",
}
}

0 comments on commit 78e1c58

Please sign in to comment.