Просмотр исходного кода

Merge pull request #11957 from dounix/master

feat: Add arbitrary label support to helm chart for service serviceMonitors
Ivan Dyachkov 2 лет назад
Родитель
Сommit
363c56c085

+ 2 - 1
deploy/charts/emqx-enterprise/README.md

@@ -78,7 +78,8 @@ The following table lists the configurable parameters of the emqx chart and thei
 | `service.loadBalancerSourceRanges` | Address(es) that are allowed when service is LoadBalancer | [] |
 | `service.externalIPs` | ExternalIPs for the service | [] |
 | `service.externalTrafficPolicy` |	External Traffic Policy for the service |	`Cluster`
-| `service.annotations` | Service annotations | {}(evaluated as a template) |
+| `service.annotations` | Service/ServiceMonitor annotations | {}(evaluated as a template) |
+| `service.labels` | Service/ServiceMontior labels | {}(evaluated as a template) |
 | `ingress.dashboard.enabled` | Enable ingress for EMQX Dashboard | false |
 | `ingress.dashboard.ingressClassName` | Set the ingress class for EMQX Dashboard | |
 | `ingress.dashboard.path` | Ingress path for EMQX Dashboard | / |

+ 3 - 0
deploy/charts/emqx-enterprise/templates/service-monitor.yaml

@@ -9,6 +9,9 @@ metadata:
     helm.sh/chart: {{ include "emqx.chart" . }}
     app.kubernetes.io/instance: {{ .Release.Name }}
     app.kubernetes.io/managed-by: {{ .Release.Service }}
+  {{- if .Values.service.labels }}
+    {{- toYaml .Values.service.labels | nindent 4 }}
+  {{- end }}
   {{- if .Values.service.annotations }}
   annotations:
     {{- toYaml .Values.service.annotations | nindent 4 }}

+ 3 - 0
deploy/charts/emqx-enterprise/templates/service.yaml

@@ -8,6 +8,9 @@ metadata:
     helm.sh/chart: {{ include "emqx.chart" . }}
     app.kubernetes.io/instance: {{ .Release.Name }}
     app.kubernetes.io/managed-by: {{ .Release.Service }}
+  {{- if .Values.service.labels }}
+    {{- toYaml .Values.service.labels | nindent 4 }}
+  {{- end }}
   {{- if .Values.service.annotations }}
   annotations:
     {{- toYaml .Values.service.annotations | nindent 4 }}

+ 1 - 0
deploy/charts/emqx-enterprise/values.yaml

@@ -190,6 +190,7 @@ service:
   ## Provide any additional annotations which may be required. Evaluated as a template
   ##
   annotations: {}
+  labels: {}
 
 nodeSelector: {}
 

+ 2 - 1
deploy/charts/emqx/README.md

@@ -79,7 +79,8 @@ The following table lists the configurable parameters of the emqx chart and thei
 | `service.loadBalancerSourceRanges` | Address(es) that are allowed when service is LoadBalancer | [] |
 | `service.externalIPs` | ExternalIPs for the service | [] |
 | `service.externalTrafficPolicy` |	External Traffic Policy for the service |	`Cluster`
-| `service.annotations` | Service annotations | {}(evaluated as a template) |
+| `service.annotations` | Service/ServiceMonitor annotations | {}(evaluated as a template) |
+| `service.labels` | Service/ServiceMontior labels | {}(evaluated as a template) |
 | `ingress.dashboard.enabled` | Enable ingress for EMQX Dashboard | false |
 | `ingress.dashboard.ingressClassName` | Set the ingress class for EMQX Dashboard | |
 | `ingress.dashboard.path` | Ingress path for EMQX Dashboard | / |

+ 3 - 0
deploy/charts/emqx/templates/service-monitor.yaml

@@ -9,6 +9,9 @@ metadata:
     helm.sh/chart: {{ include "emqx.chart" . }}
     app.kubernetes.io/instance: {{ .Release.Name }}
     app.kubernetes.io/managed-by: {{ .Release.Service }}
+  {{- if .Values.service.labels }}
+    {{- toYaml .Values.service.labels | nindent 4 }}
+  {{- end }}
   {{- if .Values.service.annotations }}
   annotations:
     {{- toYaml .Values.service.annotations | nindent 4 }}

+ 3 - 0
deploy/charts/emqx/templates/service.yaml

@@ -8,6 +8,9 @@ metadata:
     helm.sh/chart: {{ include "emqx.chart" . }}
     app.kubernetes.io/instance: {{ .Release.Name }}
     app.kubernetes.io/managed-by: {{ .Release.Service }}
+  {{- if .Values.service.labels }}
+    {{- toYaml .Values.service.labels | nindent 4 }}
+  {{- end }}
   {{- if .Values.service.annotations }}
   annotations:
     {{- toYaml .Values.service.annotations | nindent 4 }}

+ 1 - 0
deploy/charts/emqx/values.yaml

@@ -190,6 +190,7 @@ service:
   ## Provide any additional annotations which may be required. Evaluated as a template
   ##
   annotations: {}
+  labels: {}
 
 nodeSelector: {}