Skip to content

Make common_metrics dashboard work on K8s 1.12 to 1.16

Reuben Pereira requested to merge 216022-use-pod-label into master

What does this MR do?

  • K8s 1.14 introduced the pod and container labels and deprecated the pod_name and container_name labels. K8s 1.16 removes the pod_name and container_name labels.

  • Metrics from K8s versions before 1.14 contain pod_name and container_name labels. Metrics from K8s 1.14/1.15 contain pod, pod_name, container and container_name. Metrics from K8s 1.16 onwards contain pod and container labels.

  • According to https://docs.gitlab.com/ee/user/project/clusters/#supported-cluster-versions, we need to support K8s 1.12 to 1.16.

  • This MR changes existing queries to use pod instead of pod_name and container instead of container_name. These changed queries should work on K8s 1.14 onwards.

  • This MR also adds a second query using OR. The second query uses pod_name instead of pod, and container_name instead of container. This second query should work for K8s 1.12 to 1.15.

Issue: #216022 (closed)

Screenshots

Using K8s 1.16:

Before After
image image
K8s 1.14 K8s 1.15
image image

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Reuben Pereira

Merge request reports

Loading