Commit 0029342e authored by Frank Mai's avatar Frank Mai Committed by Alena Prokharchyk
Browse files

Compatible with v1.16 deprecated labels

parent 43eafbf9
Loading
Loading
Loading
Loading
+30 −0
Original line number Original line Diff line number Diff line
@@ -71,6 +71,21 @@ spec:
      action: replace
      action: replace
      regex: (.+)
      regex: (.+)
      replacement: $1
      replacement: $1
    {{- if semverCompare ">=1.16-0" .Capabilities.KubeVersion.GitVersion }}
    metricRelabelings:
    - action: replace
      regex: (.+)
      replacement: $1
      sourceLabels:
      - container
      targetLabel: container_name
    - action: replace
      regex: (.+)
      replacement: $1
      sourceLabels:
      - pod
      targetLabel: pod_name
    {{- end }}
  - port: https-metrics
  - port: https-metrics
    scheme: https
    scheme: https
    path: /metrics/resource/v1alpha1
    path: /metrics/resource/v1alpha1
@@ -128,6 +143,21 @@ spec:
      action: replace
      action: replace
      regex: (.+)
      regex: (.+)
      replacement: $1
      replacement: $1
    {{- if semverCompare ">=1.16-0" .Capabilities.KubeVersion.GitVersion }}
    metricRelabelings:
    - action: replace
      regex: (.+)
      replacement: $1
      sourceLabels:
      - container
      targetLabel: container_name
    - action: replace
      regex: (.+)
      replacement: $1
      sourceLabels:
      - pod
      targetLabel: pod_name
    {{- end }}
  - port: http-metrics
  - port: http-metrics
    path: /metrics/resource/v1alpha1
    path: /metrics/resource/v1alpha1
    honorLabels: true
    honorLabels: true