Skip to content

[K8s testing] Support use of Kustomize #1102

@constanca-m

Description

@constanca-m

What does this issue try to achieve?

Updating kube state metrics version on testing at most one time.

What is the problem?

Right now, the current kube state metrics version being used for Kubernetes integration testing is 2.3.0.
However, this version is no longer aligned with the Kubernetes version being supported, which range between
1.23.x-1.26.x. This implies that, at least, there should be support for 2.4.2 version - and this version should keep being incremented at the same time Kubernetes versions are released and supported by the integration.

Example of a problem the current being used version is causing (also documented here):

DEBUG found 0 hits in metrics-kubernetes.state_cronjob-ep data stream: index_not_found_exception: no such index [metrics-kubernetes.state_cronjob-ep] Status=404

This causes our tests to fail and makes it impossible to merge PRs on our Kubernetes integration.

The problem is that changing this version, doesn't apply changing only one tag. We need to:

  • Update tag on five different files (the ones related to kube state metrics), and, on top of that:
  • We need to update other things, such as permissions.

This can be seen on this PR.

This is, of course, not ideal and this process should not require such high maintenance. Since, Kustomize is already being used (see from this PR), the same approach should be followed.

Steps this would require

We would need to:

  1. In elastic package repository Change flag -f on kubectl to -k in here to allow (and enforce) the use of Kustomize;
  1. In integrations repository Update files in a way that a new kustomization.yaml file is deployed, that will simultaneously apply kube-state-metrics from the original repository. Same approach as shown in this merged PR;
  1. Document this (maybe in this file).

Making this change will let us update kube-state-version by changing just one word: the reference to the branch we are targeting. And if we always want to use the latest version we won't even have to do that.

Which packages does this affect?

As of the moment this issue is created, the only package that will be affected by this change will be Kubernetes.
The reason for this, is that only integrations with this kind of folder _dev/deploy/k8s are considered on Kubernetes testing. There are three integrations with one: Kubernetes, Cloud Defend and Cloud Security Posture. However, as documented here, since the last two have the .empty file, only the Kubernetes integration makes use of this test.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions