Commit 0c23b2f3 authored by Naseem's avatar Naseem Committed by GitHub

Use include function instead of template. (#20788)

Signed-off-by: 's avatarNaseem <naseem@transit.app>
parent a0cb2436
apiVersion: v1
name: influxdb
version: 4.2.0
version: 4.2.1
appVersion: 1.7.6
description: Scalable datastore for metrics, events, and real-time analytics.
keywords:
......
InfluxDB can be accessed via port {{ .Values.config.http.bind_address | default 8086 }} on the following DNS name from within your cluster:
- http://{{ template "influxdb.fullname" . }}.{{ .Release.Namespace }}:{{ .Values.config.http.bind_address | default 8086 }}
- http://{{ include "influxdb.fullname" . }}.{{ .Release.Namespace }}:{{ .Values.config.http.bind_address | default 8086 }}
You can easily connect to the remote instance with your local influx cli. To forward the API port to localhost:8086 run the following:
- kubectl port-forward --namespace {{ .Release.Namespace }} $(kubectl get pods --namespace {{ .Release.Namespace }} -l app={{ template "influxdb.fullname" . }} -o jsonpath='{ .items[0].metadata.name }') 8086:{{ .Values.config.http.bind_address | default 8086 }}
- kubectl port-forward --namespace {{ .Release.Namespace }} $(kubectl get pods --namespace {{ .Release.Namespace }} -l app={{ include "influxdb.fullname" . }} -o jsonpath='{ .items[0].metadata.name }') 8086:{{ .Values.config.http.bind_address | default 8086 }}
You can also connect to the influx cli from inside the container. To open a shell session in the InfluxDB pod run the following:
- kubectl exec -i -t --namespace {{ .Release.Namespace }} $(kubectl get pods --namespace {{ .Release.Namespace }} -l app={{ template "influxdb.fullname" . }} -o jsonpath='{.items[0].metadata.name}') /bin/sh
- kubectl exec -i -t --namespace {{ .Release.Namespace }} $(kubectl get pods --namespace {{ .Release.Namespace }} -l app={{ include "influxdb.fullname" . }} -o jsonpath='{.items[0].metadata.name}') /bin/sh
To tail the logs for the InfluxDB pod run the following:
- kubectl logs -f --namespace {{ .Release.Namespace }} $(kubectl get pods --namespace {{ .Release.Namespace }} -l app={{ template "influxdb.fullname" . }} -o jsonpath='{ .items[0].metadata.name }')
- kubectl logs -f --namespace {{ .Release.Namespace }} $(kubectl get pods --namespace {{ .Release.Namespace }} -l app={{ include "influxdb.fullname" . }} -o jsonpath='{ .items[0].metadata.name }')
{{- if .Values.setDefaultUser.enabled }}
......@@ -24,7 +24,7 @@ To retrieve the default user name:
{{- else }}
- echo $(kubectl get secret {{ template "influxdb.fullname" . }}-auth -o "jsonpath={.data['influxdb-user']}" --namespace {{ .Release.Namespace }} | base64 --decode)
- echo $(kubectl get secret {{ include "influxdb.fullname" . }}-auth -o "jsonpath={.data['influxdb-user']}" --namespace {{ .Release.Namespace }} | base64 --decode)
{{- end }}
......@@ -36,7 +36,7 @@ To retrieve the default user password:
{{- else }}
- echo $(kubectl get secret {{ template "influxdb.fullname" . }}-auth -o "jsonpath={.data['influxdb-password']}" --namespace {{ .Release.Namespace }} | base64 --decode)
- echo $(kubectl get secret {{ include "influxdb.fullname" . }}-auth -o "jsonpath={.data['influxdb-password']}" --namespace {{ .Release.Namespace }} | base64 --decode)
{{- end }}
{{- end }}
......@@ -41,7 +41,7 @@ spec:
args:
- '-c'
- |
influxd backup -host {{ template "influxdb.fullname" . }}.{{ .Release.Namespace }}.svc:{{ .Values.config.rpc.bind_address | default 8088 }} -portable /backups/backup_$(date +%Y%m%d_%H%M%S)
influxd backup -host {{ include "influxdb.fullname" . }}.{{ .Release.Namespace }}.svc:{{ .Values.config.rpc.bind_address | default 8088 }} -portable /backups/backup_$(date +%Y%m%d_%H%M%S)
containers:
{{- if .Values.backup.gcs }}
- name: gsutil-cp
......
......@@ -20,6 +20,6 @@ spec:
paths:
- path: /
backend:
serviceName: {{ template "influxdb.fullname" . }}
serviceName: {{ include "influxdb.fullname" . }}
servicePort: 8086
{{- end -}}
......@@ -16,7 +16,7 @@ spec:
{{- include "influxdb.selectorLabels" . | nindent 8 }}
spec:
containers:
- name: {{ template "influxdb.fullname" . }}-set-auth
- name: {{ include "influxdb.fullname" . }}-set-auth
image: "{{ .Values.setDefaultUser.image }}"
env:
- name: INFLUXDB_USER
......@@ -25,7 +25,7 @@ spec:
{{- if .Values.setDefaultUser.user.existingSecret }}
name: {{ .Values.setDefaultUser.user.existingSecret -}}
{{ else }}
name: {{ template "influxdb.fullname" . }}-auth
name: {{ include "influxdb.fullname" . }}-auth
{{- end }}
key: influxdb-user
- name: INFLUXDB_PASSWORD
......@@ -34,14 +34,14 @@ spec:
{{- if .Values.setDefaultUser.user.existingSecret }}
name: {{ .Values.setDefaultUser.user.existingSecret -}}
{{ else }}
name: {{ template "influxdb.fullname" . }}-auth
name: {{ include "influxdb.fullname" . }}-auth
{{- end }}
key: influxdb-password
args:
- "/bin/sh"
- "-c"
- |
curl -X POST http://{{ template "influxdb.fullname" . }}:{{ .Values.config.http.bind_address | default 8086 }}/query \
curl -X POST http://{{ include "influxdb.fullname" . }}:{{ .Values.config.http.bind_address | default 8086 }}/query \
--data-urlencode \
"q=CREATE USER \"${INFLUXDB_USER}\" WITH PASSWORD '${INFLUXDB_PASSWORD}' {{ .Values.setDefaultUser.user.privileges }}"
restartPolicy: {{ .Values.setDefaultUser.restartPolicy }}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment