Skip to content

Commit 9e4a06b

Browse files
committed
feat(helm-charts): Add commonPodAnnotations to allow Prometheus scrapping
Signed-off-by: hayk96 <hayko5999@gmail.com>
1 parent 9aec341 commit 9e4a06b

4 files changed

Lines changed: 27 additions & 9 deletions

File tree

charts/kubebridge/README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ This document provides a reference for the configurable values in the `values.ya
55
## Parameters
66
### Global parameters
77

8-
| Name | Type | Value | Description |
9-
|---------------------------|--------|---------------------|------------------------------------------------------------------------------------|
10-
| `global.logLevel` | string | `info` | The log level for all KubeBridge components. |
11-
| `global.nameOverride` | string | `""` | Partially override common.names.fullname template (will maintain the release name) |
12-
| `global.fullnameOverride` | string | `""` | Fully override common.names.fullname template. |
13-
| `global.image.repository` | string | `hayk96/kubebridge` | The Docker image repository. |
14-
| `global.image.tag` | string | `v0.1.0` | The Docker image tag. |
8+
| Name | Type | Value | Description |
9+
|-------------------------------|--------|---------------------|------------------------------------------------------------------------------------|
10+
| `global.logLevel` | string | `info` | The log level for all KubeBridge components. |
11+
| `global.nameOverride` | string | `""` | Partially override common.names.fullname template (will maintain the release name) |
12+
| `global.fullnameOverride` | string | `""` | Fully override common.names.fullname template. |
13+
| `global.commonPodAnnotations` | object | See `values.yaml` | Add annotations to pods of Sync and DNS components |
14+
| `global.image.repository` | string | `hayk96/kubebridge` | The Docker image repository. |
15+
| `global.image.tag` | string | `v0.1.0` | The Docker image tag. |
1516

1617
### Sync parameters
1718

charts/kubebridge/templates/dns-deployment.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,17 @@ spec:
1818
app: {{ include "kubebridge.fullname" . }}-dns
1919
template:
2020
metadata:
21-
{{- with .Values.dns.podAnnotations }}
21+
{{- if or .Values.global.commonPodAnnotations .Values.dns.podAnnotations }}
2222
annotations:
23+
{{- with .Values.global.commonPodAnnotations }}
2324
{{- toYaml . | nindent 8 }}
2425
{{- end }}
26+
{{- with .Values.dns.podAnnotations }}
27+
{{- toYaml . | nindent 8 }}
28+
{{- end }}
29+
{{- else }}
30+
annotations: {}
31+
{{- end }}
2532
labels:
2633
{{- include "kubebridge.selectorLabels" . | nindent 8 }}
2734
app.kubernetes.io/component: dns

charts/kubebridge/templates/sync-deployment.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,17 @@ spec:
1818
app: {{ include "kubebridge.fullname" . }}-sync
1919
template:
2020
metadata:
21-
{{- with .Values.sync.podAnnotations }}
21+
{{- if or .Values.global.commonPodAnnotations .Values.sync.podAnnotations }}
2222
annotations:
23+
{{- with .Values.global.commonPodAnnotations }}
2324
{{- toYaml . | nindent 8 }}
2425
{{- end }}
26+
{{- with .Values.sync.podAnnotations }}
27+
{{- toYaml . | nindent 8 }}
28+
{{- end }}
29+
{{- else }}
30+
annotations: {}
31+
{{- end }}
2532
labels:
2633
{{- include "kubebridge.selectorLabels" . | nindent 8 }}
2734
app.kubernetes.io/component: sync

charts/kubebridge/values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ global:
55
logLevel: info
66
nameOverride: ""
77
fullnameOverride: ""
8+
commonPodAnnotations:
9+
prometheus.io/scrape: "true"
10+
prometheus.io/port: "8080"
811

912
image:
1013
repository: hayk96/kubebridge

0 commit comments

Comments
 (0)