diff --git a/pulsar/templates/grafana-ingress.yaml b/pulsar/templates/grafana-ingress.yaml new file mode 100644 index 0000000..79f4a8b --- /dev/null +++ b/pulsar/templates/grafana-ingress.yaml @@ -0,0 +1,50 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + + {{- if .Values.extra.monitoring}} + {{- if .Values.grafana.ingress.enabled }} +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: "{{ template "pulsar.fullname" . }}-{{ .Values.grafana.component }}" + namespace: {{ .Values.namespace }} + labels: + app: {{ template "pulsar.name" . }} + chart: {{ template "pulsar.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +{{- with .Values.grafana.ingress.annotations }} + annotations: +{{ toYaml . | indent 4 }} +{{- end }} +spec: +{{- if .Values.grafana.ingress.tls }} + tls: +{{ toYaml .Values.grafana.ingress.tls | indent 4 }} +{{- end }} + rules: + - host: {{ required "Grafana ingress hostname not provided" .Values.grafana.ingress.hostname }} + http: + paths: + - path: {{ .Values.grafana.ingress.path }} + backend: + serviceName: "{{ template "pulsar.fullname" . }}-{{ .Values.grafana.component }}" + servicePort: {{ .Values.grafana.ingress.port }} + {{- end }} + {{- end }} diff --git a/pulsar/templates/grafana-service.yaml b/pulsar/templates/grafana-service.yaml index cd73f43..3288f26 100644 --- a/pulsar/templates/grafana-service.yaml +++ b/pulsar/templates/grafana-service.yaml @@ -17,7 +17,7 @@ # under the License. # -{{- if .Values.extra.monitoring }} + {{- if .Values.extra.monitoring }} apiVersion: v1 kind: Service metadata: @@ -31,13 +31,14 @@ metadata: component: {{ .Values.grafana.component }} cluster: {{ template "pulsar.fullname" . }} annotations: -{{ toYaml .Values.grafana.service.annotations | indent 4 }} + {{ toYaml .Values.grafana.service.annotations | indent 4 }} spec: ports: -{{ toYaml .Values.grafana.service.ports | indent 2 }} - clusterIP: None + {{ toYaml .Values.grafana.service.ports | indent 2 }} selector: app: {{ template "pulsar.name" . }} release: {{ .Release.Name }} component: {{ .Values.grafana.component }} -{{- end }} + type: ClusterIP + sessionAffinity: None + {{- end }} diff --git a/pulsar/values-mini.yaml b/pulsar/values-mini.yaml index 2a300b8..a932d32 100644 --- a/pulsar/values-mini.yaml +++ b/pulsar/values-mini.yaml @@ -445,6 +445,31 @@ grafana: ports: - name: server port: 3000 + plugins: [] + ## Grafana ingress + ## templates/grafana-ingress.yaml + ## + ingress: + enabled: false + annotations: + kubernetes.io/ingress.class: nginx + # nginx.ingress.kubernetes.io/rewrite-target: /$1 + # ingress.kubernetes.io/force-ssl-redirect: "true" + ingress.kubernetes.io/rewrite-target: / + labels: {} + + tls: [] + + ## Optional. Leave it blank if your Ingress Controller can provide a default certificate. + #- secretName: "" + + ## Extra paths to prepend to every host configuration. This is useful when working with annotation based services. + extraPaths: [] + ## Required if ingress is enabled + hostname: "" + protocol: http + path: /grafana + port: 80 zookeeper_metadata: resources: diff --git a/pulsar/values.yaml b/pulsar/values.yaml index ab9aef9..3ccd0ae 100644 --- a/pulsar/values.yaml +++ b/pulsar/values.yaml @@ -447,6 +447,31 @@ grafana: ports: - name: server port: 3000 + plugins: [] + ## Grafana ingress + ## templates/grafana-ingress.yaml + ## + ingress: + enabled: false + annotations: + kubernetes.io/ingress.class: nginx + # nginx.ingress.kubernetes.io/rewrite-target: /$1 + # ingress.kubernetes.io/force-ssl-redirect: "true" + ingress.kubernetes.io/rewrite-target: / + labels: {} + + tls: [] + + ## Optional. Leave it blank if your Ingress Controller can provide a default certificate. + #- secretName: "" + + ## Extra paths to prepend to every host configuration. This is useful when working with annotation based services. + extraPaths: [] + ## Required if ingress is enabled + hostname: "" + protocol: http + path: /grafana + port: 80 ## Components Stack: pulsar_manager ## templates/pulsar-manager.yaml