Make common_metrics dashboard work on K8s 1.12 to 1.16
What does this MR do?
-
K8s 1.14 introduced the
pod
andcontainer
labels and deprecated thepod_name
andcontainer_name
labels. K8s 1.16 removes thepod_name
andcontainer_name
labels. -
Metrics from K8s versions before 1.14 contain
pod_name
andcontainer_name
labels. Metrics from K8s 1.14/1.15 containpod
,pod_name
,container
andcontainer_name
. Metrics from K8s 1.16 onwards containpod
andcontainer
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 ofpod_name
andcontainer
instead ofcontainer_name
. These changed queries should work on K8s 1.14 onwards. -
This MR also adds a second query using
OR
. The second query usespod_name
instead ofpod
, andcontainer_name
instead ofcontainer
. This second query should work for K8s 1.12 to 1.15.
Issue: #216022 (closed)
Screenshots
Using K8s 1.16:
Before | After |
---|---|
K8s 1.14 | K8s 1.15 |
---|---|
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry - Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. - Tested in all supported browsers
- Informed Infrastructure department of a default or new setting change, if applicable per definition of done
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