Grafana: use endpoints section and lookups to set port
This PS moves grafana to use the endpoints section and lookups to set the port it serves on. Change-Id: I51d4c10297f3423569539dcbf7fbecad24d5e47f
This commit is contained in:
parent
d681396412
commit
934bef2f0d
@ -17,7 +17,7 @@ limitations under the License.
|
|||||||
|
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
exec curl "http://${GF_SECURITY_ADMIN_USER}:${GF_SECURITY_ADMIN_PASSWORD}@${GRAFANA_SERVICE}:{{ .Values.network.grafana.port }}/api/datasources" \
|
exec curl "http://${GF_SECURITY_ADMIN_USER}:${GF_SECURITY_ADMIN_PASSWORD}@${GRAFANA_SERVICE}:${GRAFANA_PORT}/api/datasources" \
|
||||||
-H "Content-Type: application/json;charset=UTF-8" --data-binary \
|
-H "Content-Type: application/json;charset=UTF-8" --data-binary \
|
||||||
{{- with .Values.conf.datasource }}
|
{{- with .Values.conf.datasource }}
|
||||||
"{\"name\":\"{{ .name }}\",\"type\":\"{{ .type }}\",\"url\":\"$PROMETHEUS_URL\",\"database\":\"{{ .database }}\",\"jsonData\":{ {{ .jsonData }} },\"access\":\"{{ .access }}\",\"isDefault\":{{ .isDefault }}}"
|
"{\"name\":\"{{ .name }}\",\"type\":\"{{ .type }}\",\"url\":\"$PROMETHEUS_URL\",\"database\":\"{{ .database }}\",\"jsonData\":{ {{ .jsonData }} },\"access\":\"{{ .access }}\",\"isDefault\":{{ .isDefault }}}"
|
||||||
|
@ -57,11 +57,11 @@ spec:
|
|||||||
- start
|
- start
|
||||||
ports:
|
ports:
|
||||||
- name: dashboard
|
- name: dashboard
|
||||||
containerPort: {{ .Values.network.grafana.port }}
|
containerPort: {{ tuple "grafana" "internal" "grafana" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
|
||||||
readinessProbe:
|
readinessProbe:
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /login
|
path: /login
|
||||||
port: 3000
|
port: {{ tuple "grafana" "internal" "grafana" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
|
||||||
initialDelaySeconds: 30
|
initialDelaySeconds: 30
|
||||||
timeoutSeconds: 30
|
timeoutSeconds: 30
|
||||||
env:
|
env:
|
||||||
|
@ -56,6 +56,8 @@ spec:
|
|||||||
key: GRAFANA_ADMIN_PASSWORD
|
key: GRAFANA_ADMIN_PASSWORD
|
||||||
- name: GRAFANA_SERVICE
|
- name: GRAFANA_SERVICE
|
||||||
value: {{ tuple "grafana" "internal" $envAll | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
|
value: {{ tuple "grafana" "internal" $envAll | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
|
||||||
|
- name: GRAFANA_PORT
|
||||||
|
value: {{ tuple "grafana" "internal" "grafana" . | include "helm-toolkit.endpoints.endpoint_port_lookup" | quote }}
|
||||||
- name: PROMETHEUS_URL
|
- name: PROMETHEUS_URL
|
||||||
value: {{ tuple "monitoring" "internal" "api" $envAll | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup" }}
|
value: {{ tuple "monitoring" "internal" "api" $envAll | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup" }}
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
|
@ -24,7 +24,7 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
ports:
|
ports:
|
||||||
- name: dashboard
|
- name: dashboard
|
||||||
port: {{ .Values.network.grafana.port }}
|
port: {{ tuple "grafana" "internal" "grafana" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
|
||||||
{{ if .Values.network.grafana.node_port.enabled }}
|
{{ if .Values.network.grafana.node_port.enabled }}
|
||||||
nodePort: {{ .Values.network.grafana.node_port.port }}
|
nodePort: {{ .Values.network.grafana.node_port.port }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
@ -221,7 +221,6 @@ dependencies:
|
|||||||
|
|
||||||
network:
|
network:
|
||||||
grafana:
|
grafana:
|
||||||
port: 3000
|
|
||||||
node_port:
|
node_port:
|
||||||
enabled: false
|
enabled: false
|
||||||
port: 30902
|
port: 30902
|
||||||
|
Loading…
Reference in New Issue
Block a user