Skip to content

Commit

Permalink
[KYUUBI #5212] Fix configuration errors causing by helm charts of pro…
Browse files Browse the repository at this point in the history
…metheus services

### _Why are the changes needed?_

This bug will affect k8s deployments.

#5212

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [x] [Run test](https://kyuubi.readthedocs.io/en/master/contributing/code/testing.html#running-tests) locally before make a pull request

### _Was this patch authored or co-authored using generative AI tooling?_
No

Closes #5281 from FourSpaces/fix_k8s_deployment_error.

Closes #5212

484da7e [伟程] Remove the monitoring.prometheus.server node that is not being used temporarily
90396c1 [伟程] Specification format
1773c7c [wei.cheng] Separate the configuration of Prometheus from other components.
59159eb [伟程] Fix configuration errors causing by k8s deployment of prometheus services.

Lead-authored-by: 伟程 <[email protected]>
Co-authored-by: wei.cheng <[email protected]>
Signed-off-by: Cheng Pan <[email protected]>
  • Loading branch information
FourSpaces authored and pan3793 committed Oct 24, 2023
1 parent 9a40995 commit 5eba900
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion charts/kyuubi/templates/kyuubi-alert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
limitations under the License.
*/}}

{{- if and .Values.server.prometheus.enabled (eq .Values.metricsReporters "PROMETHEUS") .Values.prometheusRule.enabled }}
{{- if and .Values.monitoring.prometheus.enabled (eq .Values.metricsReporters "PROMETHEUS") .Values.prometheusRule.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
Expand Down
2 changes: 1 addition & 1 deletion charts/kyuubi/templates/kyuubi-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ data:
kyuubi.frontend.protocols={{ include "kyuubi.frontend.protocols" . }}
# Kyuubi Metrics
kyuubi.metrics.enabled={{ .Values.server.prometheus.enabled }}
kyuubi.metrics.enabled={{ .Values.monitoring.prometheus.enabled }}
kyuubi.metrics.reporters={{ .Values.metricsReporters }}
## User provided Kyuubi configurations
Expand Down
5 changes: 5 additions & 0 deletions charts/kyuubi/templates/kyuubi-headless-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ spec:
port: {{ tpl $frontend.service.port $ }}
targetPort: {{ $frontend.port }}
{{- end }}
{{- if .Values.monitoring.prometheus.enabled }}
- name: prometheus
port: {{ .Values.monitoring.prometheus.port }}
targetPort: {{ .Values.monitoring.prometheus.port }}
{{- end }}
selector:
{{- include "kyuubi.selectorLabels" $ | nindent 4 }}

2 changes: 1 addition & 1 deletion charts/kyuubi/templates/kyuubi-podmonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
limitations under the License.
*/}}

{{- if and .Values.server.prometheus.enabled (eq .Values.metricsReporters "PROMETHEUS") .Values.podMonitor.enabled }}
{{- if and .Values.monitoring.prometheus.enabled (eq .Values.metricsReporters "PROMETHEUS") .Values.podMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
Expand Down
2 changes: 1 addition & 1 deletion charts/kyuubi/templates/kyuubi-servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
limitations under the License.
*/}}

{{- if and .Values.server.prometheus.enabled (eq .Values.metricsReporters "PROMETHEUS") .Values.serviceMonitor.enabled }}
{{- if and .Values.monitoring.prometheus.enabled (eq .Values.metricsReporters "PROMETHEUS") .Values.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
Expand Down
4 changes: 4 additions & 0 deletions charts/kyuubi/templates/kyuubi-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ spec:
containerPort: {{ $frontend.port }}
{{- end }}
{{- end }}
{{- if .Values.monitoring.prometheus.enabled }}
- name: prometheus
containerPort: {{ .Values.monitoring.prometheus.port }}
{{- end }}
{{- if .Values.livenessProbe.enabled }}
livenessProbe:
exec:
Expand Down
6 changes: 1 addition & 5 deletions charts/kyuubi/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,11 @@ server:
nodePort: ~
annotations: {}

monitoring:
# Exposes metrics in Prometheus format
prometheus:
enabled: true
port: 10019
service:
type: ClusterIP
port: "{{ .Values.server.prometheus.port }}"
nodePort: ~
annotations: {}

# $KYUUBI_CONF_DIR directory
kyuubiConfDir: /opt/kyuubi/conf
Expand Down

0 comments on commit 5eba900

Please sign in to comment.