Skip to content

Commit

Permalink
Add customizable Grafana and Prometheus service object in Helm chart
Browse files Browse the repository at this point in the history
  • Loading branch information
walbertus authored Jun 18, 2020
1 parent 2922544 commit e59b861
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 5 deletions.
10 changes: 7 additions & 3 deletions helm/chart/maesh/charts/metrics/templates/grafana.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ data:
- name: prometheus
type: prometheus
orgId: 1
url: http://prometheus.{{ .Release.Namespace }}.svc.{{ default "cluster.local" .Values.clusterDomain }}:9090
url: http://prometheus.{{ .Release.Namespace }}.svc.{{ default "cluster.local" .Values.clusterDomain }}:{{ .Values.prometheus.service.port }}
isDefault: true
access: proxy
jsonData:
Expand Down Expand Up @@ -161,9 +161,13 @@ metadata:
heritage: {{ .Release.Service | quote }}
component: grafana
spec:
type: NodePort
type: {{ .Values.grafana.service.type }}
ports:
- port: 3000
- port: {{ .Values.grafana.service.port }}
targetPort: web
{{- if .Values.grafana.service.nodePort }}
nodePort: {{ .Values.grafana.service.nodePort }}
{{- end }}
selector:
app: grafana
component: core
Expand Down
8 changes: 6 additions & 2 deletions helm/chart/maesh/charts/metrics/templates/prometheus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,13 @@ metadata:
annotations:
prometheus.io/scrape: 'true'
spec:
type: NodePort
type: {{ .Values.prometheus.service.type }}
ports:
- port: 9090
- port: {{ .Values.prometheus.service.port }}
targetPort: webui
{{- if .Values.prometheus.service.nodePort }}
nodePort: {{ .Values.prometheus.service.nodePort }}
{{- end }}
protocol: TCP
name: webui
selector:
Expand Down
18 changes: 18 additions & 0 deletions helm/chart/maesh/charts/metrics/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ image:
configmapReload: jimmidyson/configmap-reload:v0.2.2

grafana:
service:
type: ClusterIP
port: 3000

## Specify the nodePort value for the NodePort service types.
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#nodeport
##
# nodePort: 30030

## storageClassName: "" disables dynamic provisioning
## if undefined or null, no storageClassName spec is
## set, choosing the default provisioner
Expand All @@ -18,6 +27,15 @@ grafana:
# cpu: "100m"

prometheus:
service:
type: ClusterIP
port: 9090

## Specify the nodePort value for the NodePort service types.
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#nodeport
##
# nodePort: 30090

## storageClassName: "" disables dynamic provisioning
## if undefined or null, no storageClassName spec is
## set, choosing the default provisioner
Expand Down

0 comments on commit e59b861

Please sign in to comment.