forked from apache/pulsar
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[deployment][helm] Add Grafana ingress template (apache#6280)
### Motivation Exposing Grafana via soft ingress controller so that it can be exposed through a Load Balancer. #### Proposed solution: Create ingress template for Grafana so that it can be automatically picked up if ingress controller instance is running in the cluster. The other solutions are to expose Grafana as NodePort or setting it as a LoadBalancer. ### Modifications Added `grafana-ingress.yaml` template in the templates and an `ingress` section for Grafana in the values file. ### Verifying this change 1) Set ingress to `true` for Grafana in values file and provide hostname. Currently tested with NGINX, but can use another ingress controller, but will need to change the ingress controller class to another one in the template. 2) Add NGINX Helm repository : ```bash helm repo add nginx-stable https://helm.nginx.com/stable helm repo update ``` 3) Install with Helm 3: ```bash helm install nginix-ingress-crl nginx-stable/nginx-ingress ``` 4) Follow the instructions on how deploying helm and run: `helm install pulsar --values pulsar/values-mini.yaml ./pulsar/`. 5) Wait until all the services are up and running. 6) Verify that Grafana is accessible via url. **Path settings** Currently, by default the path setting is set to `/grafana`. For that to work, the NGINX configuration file `nginx.conf` should have `grafana` sub path enabled: ``` See https://grafana.com/docs/grafana/latest/installation/behind_proxy/ To avoid having to mess with NGINX configurations files `path` can be changed to `/`, but this path might conflict with other services that are being proxied in the cluster. #### Modules affected: The changes in the PR are affecting the deployment using the helm charts. Now the if the flag `functionsAsPods` is set to `yes` inside the `values.yaml. file, the functions would run as pods. ### Documentation This PR will be adding ingress capability for Grafana and this should be documented.
- Loading branch information
1 parent
d2f37a7
commit bec768f
Showing
4 changed files
with
106 additions
and
5 deletions.
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
deployment/kubernetes/helm/pulsar/templates/grafana-ingress.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters