Skip to content

Commit 0a34bd9

Browse files
[9.0] (backport #8575) [ci] fix k8s integration tests flakiness (#8624)
* [ci] fix k8s integration tests flakiness (#8575) * feat: vendor all necessary test artifacts for kubernetes integration to minimise flakiness due to transient errors * fix: correct decode api key * fix: clear CA_TRUSTED env var for kustomize * fix: bump memory limits for kustomize * fix: fabricate paths leveraging filepath * fix: remove redundant file moving when downloading kube stack helm chart * feat: vendor expanded archives * fix: use filepath.Join * doc: update BuildDependencies godoc (cherry picked from commit 7259e54) # Conflicts: # NOTICE-fips.txt # NOTICE.txt # go.mod # testing/integration/k8s/journald_test.go * fix: resolve conflicts --------- Co-authored-by: Panos Koutsovasilis <panos.koutsovasilis@elastic.co>
1 parent 3ce2594 commit 0a34bd9

File tree

239 files changed

+63199
-266
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

239 files changed

+63199
-266
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ check-ci:
4141
@mage -v helm:lint
4242
@mage -v helm:updateAgentVersion
4343
@mage -v helm:renderExamples
44+
@mage -v integration:buildKubernetesTestData
4445
@$(MAKE) check-no-changes
4546

4647
## check: run all the checks including linting using golangci-lint.

NOTICE.txt

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,36 @@ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
109109
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
110110

111111

112+
--------------------------------------------------------------------------------
113+
Dependency : github.com/cenkalti/backoff/v5
114+
Version: v5.0.2
115+
Licence type (autodetected): MIT
116+
--------------------------------------------------------------------------------
117+
118+
Contents of probable licence file $GOMODCACHE/github.com/cenkalti/backoff/v5@v5.0.2/LICENSE:
119+
120+
The MIT License (MIT)
121+
122+
Copyright (c) 2014 Cenk Altı
123+
124+
Permission is hereby granted, free of charge, to any person obtaining a copy of
125+
this software and associated documentation files (the "Software"), to deal in
126+
the Software without restriction, including without limitation the rights to
127+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
128+
the Software, and to permit persons to whom the Software is furnished to do so,
129+
subject to the following conditions:
130+
131+
The above copyright notice and this permission notice shall be included in all
132+
copies or substantial portions of the Software.
133+
134+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
135+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
136+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
137+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
138+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
139+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
140+
141+
112142
--------------------------------------------------------------------------------
113143
Dependency : github.com/cespare/xxhash/v2
114144
Version: v2.3.0
@@ -32740,36 +32770,6 @@ SOFTWARE.
3274032770

3274132771

3274232772

32743-
--------------------------------------------------------------------------------
32744-
Dependency : github.com/cenkalti/backoff/v5
32745-
Version: v5.0.2
32746-
Licence type (autodetected): MIT
32747-
--------------------------------------------------------------------------------
32748-
32749-
Contents of probable licence file $GOMODCACHE/github.com/cenkalti/backoff/v5@v5.0.2/LICENSE:
32750-
32751-
The MIT License (MIT)
32752-
32753-
Copyright (c) 2014 Cenk Altı
32754-
32755-
Permission is hereby granted, free of charge, to any person obtaining a copy of
32756-
this software and associated documentation files (the "Software"), to deal in
32757-
the Software without restriction, including without limitation the rights to
32758-
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
32759-
the Software, and to permit persons to whom the Software is furnished to do so,
32760-
subject to the following conditions:
32761-
32762-
The above copyright notice and this permission notice shall be included in all
32763-
copies or substantial portions of the Software.
32764-
32765-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
32766-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
32767-
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
32768-
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
32769-
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
32770-
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
32771-
32772-
3277332773
--------------------------------------------------------------------------------
3277432774
Dependency : github.com/cilium/ebpf
3277532775
Version: v0.16.0
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*~
18+
# Various IDEs
19+
.project
20+
.idea/
21+
*.tmproj
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
annotations:
2+
artifacthub.io/license: Apache-2.0
3+
artifacthub.io/links: |
4+
- name: Chart Source
5+
url: https://github.com/prometheus-community/helm-charts
6+
apiVersion: v2
7+
appVersion: 2.15.0
8+
description: Install kube-state-metrics to generate and expose cluster-level metrics
9+
home: https://github.com/kubernetes/kube-state-metrics/
10+
keywords:
11+
- metric
12+
- monitoring
13+
- prometheus
14+
- kubernetes
15+
maintainers:
16+
- email: tariq.ibrahim@mulesoft.com
17+
name: tariq1890
18+
url: https://github.com/tariq1890
19+
- email: manuel@rueg.eu
20+
name: mrueg
21+
url: https://github.com/mrueg
22+
- email: david@0xdc.me
23+
name: dotdc
24+
url: https://github.com/dotdc
25+
name: kube-state-metrics
26+
sources:
27+
- https://github.com/kubernetes/kube-state-metrics/
28+
type: application
29+
version: 5.30.1
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# kube-state-metrics Helm Chart
2+
3+
Installs the [kube-state-metrics agent](https://github.com/kubernetes/kube-state-metrics).
4+
5+
## Get Repository Info
6+
<!-- textlint-disable -->
7+
```console
8+
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
9+
helm repo update
10+
```
11+
12+
_See [helm repo](https://helm.sh/docs/helm/helm_repo/) for command documentation._
13+
<!-- textlint-enable -->
14+
15+
## Install Chart
16+
17+
```console
18+
helm install [RELEASE_NAME] prometheus-community/kube-state-metrics [flags]
19+
```
20+
21+
_See [configuration](#configuration) below._
22+
23+
_See [helm install](https://helm.sh/docs/helm/helm_install/) for command documentation._
24+
25+
## Uninstall Chart
26+
27+
```console
28+
helm uninstall [RELEASE_NAME]
29+
```
30+
31+
This removes all the Kubernetes components associated with the chart and deletes the release.
32+
33+
_See [helm uninstall](https://helm.sh/docs/helm/helm_uninstall/) for command documentation._
34+
35+
## Upgrading Chart
36+
37+
```console
38+
helm upgrade [RELEASE_NAME] prometheus-community/kube-state-metrics [flags]
39+
```
40+
41+
_See [helm upgrade](https://helm.sh/docs/helm/helm_upgrade/) for command documentation._
42+
43+
### Migrating from stable/kube-state-metrics and kubernetes/kube-state-metrics
44+
45+
You can upgrade in-place:
46+
47+
1. [get repository info](#get-repository-info)
48+
1. [upgrade](#upgrading-chart) your existing release name using the new chart repository
49+
50+
## Upgrading to v3.0.0
51+
52+
v3.0.0 includes kube-state-metrics v2.0, see the [changelog](https://github.com/kubernetes/kube-state-metrics/blob/release-2.0/CHANGELOG.md) for major changes on the application-side.
53+
54+
The upgraded chart now the following changes:
55+
56+
* Dropped support for helm v2 (helm v3 or later is required)
57+
* collectors key was renamed to resources
58+
* namespace key was renamed to namespaces
59+
60+
## Configuration
61+
62+
See [Customizing the Chart Before Installing](https://helm.sh/docs/intro/using_helm/#customizing-the-chart-before-installing). To see all configurable options with detailed comments:
63+
64+
```console
65+
helm show values prometheus-community/kube-state-metrics
66+
```
67+
68+
### kube-rbac-proxy
69+
70+
You can enable `kube-state-metrics` endpoint protection using `kube-rbac-proxy`. By setting `kubeRBACProxy.enabled: true`, this chart will deploy one RBAC proxy container per endpoint (metrics & telemetry).
71+
To authorize access, authenticate your requests (via a `ServiceAccount` for example) with a `ClusterRole` attached such as:
72+
73+
```yaml
74+
apiVersion: rbac.authorization.k8s.io/v1
75+
kind: ClusterRole
76+
metadata:
77+
name: kube-state-metrics-read
78+
rules:
79+
- apiGroups: [ "" ]
80+
resources: ["services/kube-state-metrics"]
81+
verbs:
82+
- get
83+
```
84+
85+
See [kube-rbac-proxy examples](https://github.com/brancz/kube-rbac-proxy/tree/master/examples/resource-attributes) for more details.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
kube-state-metrics is a simple service that listens to the Kubernetes API server and generates metrics about the state of the objects.
2+
The exposed metrics can be found here:
3+
https://github.com/kubernetes/kube-state-metrics/blob/master/docs/README.md#exposed-metrics
4+
5+
The metrics are exported on the HTTP endpoint /metrics on the listening port.
6+
In your case, {{ template "kube-state-metrics.fullname" . }}.{{ template "kube-state-metrics.namespace" . }}.svc.cluster.local:{{ .Values.service.port }}/metrics
7+
8+
They are served either as plaintext or protobuf depending on the Accept header.
9+
They are designed to be consumed either by Prometheus itself or by a scraper that is compatible with scraping a Prometheus client endpoint.
10+
11+
{{- if .Values.kubeRBACProxy.enabled}}
12+
13+
kube-rbac-proxy endpoint protections is enabled:
14+
- Metrics endpoints are now HTTPS
15+
- Ensure that the client authenticates the requests (e.g. via service account) with the following role permissions:
16+
```
17+
rules:
18+
- apiGroups: [ "" ]
19+
resources: ["services/{{ template "kube-state-metrics.fullname" . }}"]
20+
verbs:
21+
- get
22+
```
23+
{{- end }}

0 commit comments

Comments
 (0)