Przeglądaj źródła

feat: Add arb label support to helm chart for service serviceMonitors, addresses https://github.com/emqx/emqx/issues/11956

James Saffer 2 lat temu
rodzic
commit
b458df52e2

+ 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 | / |

+ 5 - 5
deploy/charts/emqx-enterprise/templates/StatefulSet.yaml

@@ -110,14 +110,14 @@ spec:
           - name: wss
             containerPort: {{ .Values.emqxConfig.EMQX_LISTENERS__WSS__DEFAULT__BIND | default 8084 }}
           - name: dashboard
-            containerPort: {{ .Values.emqxConfig.EMQX_DASHBOARD__LISTENER__HTTP__BIND | default 18083 }}
+            containerPort: {{ .Values.emqxConfig.EMQX_DASHBOARD__LISTENERS__HTTP__BIND | default 18083 }}
           {{- if not (empty .Values.emqxConfig.EMQX_LISTENERS__TCP__INTERNAL__BIND) }}
           - name: internalmqtt
             containerPort: {{ .Values.emqxConfig.EMQX_LISTENERS__TCP__INTERNAL__BIND }}
           {{- end }}
-          {{- if not (empty .Values.emqxConfig.EMQX_DASHBOARD__LISTENER__HTTPS__BIND) }}
+          {{- if not (empty .Values.emqxConfig.EMQX_DASHBOARD__LISTENERS__HTTPS__BIND) }}
           - name: dashboardtls
-            containerPort: {{ .Values.emqxConfig.EMQX_DASHBOARD__LISTENER__HTTPS__BIND }}
+            containerPort: {{ .Values.emqxConfig.EMQX_DASHBOARD__LISTENERS__HTTPS__BIND }}
           {{- end }}
           - name: ekka
             containerPort: 4370
@@ -152,14 +152,14 @@ spec:
           readinessProbe:
             httpGet:
               path: /status
-              port: {{ .Values.emqxConfig.EMQX_DASHBOARD__LISTENER__HTTP__BIND | default 18083 }}
+              port: {{ .Values.emqxConfig.EMQX_DASHBOARD__LISTENERS__HTTP__BIND | default 18083 }}
             initialDelaySeconds: 10
             periodSeconds: 5
             failureThreshold: 30
           livenessProbe:
             httpGet:
               path: /status
-              port: {{ .Values.emqxConfig.EMQX_DASHBOARD__LISTENER__HTTP__BIND | default 18083 }}
+              port: {{ .Values.emqxConfig.EMQX_DASHBOARD__LISTENERS__HTTP__BIND | default 18083 }}
             initialDelaySeconds: 60
             periodSeconds: 30
             failureThreshold: 10

+ 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: {}