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 apiVersion: v1
name: influxdb name: influxdb
version: 4.2.0 version: 4.2.1
appVersion: 1.7.6 appVersion: 1.7.6
description: Scalable datastore for metrics, events, and real-time analytics. description: Scalable datastore for metrics, events, and real-time analytics.
keywords: keywords:
......
InfluxDB can be accessed via port {{ .Values.config.http.bind_address | default 8086 }} on the following DNS name from within your cluster: 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: 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: 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: 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 }} {{- if .Values.setDefaultUser.enabled }}
...@@ -24,7 +24,7 @@ To retrieve the default user name: ...@@ -24,7 +24,7 @@ To retrieve the default user name:
{{- else }} {{- 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 }} {{- end }}
...@@ -36,7 +36,7 @@ To retrieve the default user password: ...@@ -36,7 +36,7 @@ To retrieve the default user password:
{{- else }} {{- 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 }}
{{- end }} {{- end }}
...@@ -41,7 +41,7 @@ spec: ...@@ -41,7 +41,7 @@ spec:
args: args:
- '-c' - '-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: containers:
{{- if .Values.backup.gcs }} {{- if .Values.backup.gcs }}
- name: gsutil-cp - name: gsutil-cp
......
...@@ -20,6 +20,6 @@ spec: ...@@ -20,6 +20,6 @@ spec:
paths: paths:
- path: / - path: /
backend: backend:
serviceName: {{ template "influxdb.fullname" . }} serviceName: {{ include "influxdb.fullname" . }}
servicePort: 8086 servicePort: 8086
{{- end -}} {{- end -}}
...@@ -16,7 +16,7 @@ spec: ...@@ -16,7 +16,7 @@ spec:
{{- include "influxdb.selectorLabels" . | nindent 8 }} {{- include "influxdb.selectorLabels" . | nindent 8 }}
spec: spec:
containers: containers:
- name: {{ template "influxdb.fullname" . }}-set-auth - name: {{ include "influxdb.fullname" . }}-set-auth
image: "{{ .Values.setDefaultUser.image }}" image: "{{ .Values.setDefaultUser.image }}"
env: env:
- name: INFLUXDB_USER - name: INFLUXDB_USER
...@@ -25,7 +25,7 @@ spec: ...@@ -25,7 +25,7 @@ spec:
{{- if .Values.setDefaultUser.user.existingSecret }} {{- if .Values.setDefaultUser.user.existingSecret }}
name: {{ .Values.setDefaultUser.user.existingSecret -}} name: {{ .Values.setDefaultUser.user.existingSecret -}}
{{ else }} {{ else }}
name: {{ template "influxdb.fullname" . }}-auth name: {{ include "influxdb.fullname" . }}-auth
{{- end }} {{- end }}
key: influxdb-user key: influxdb-user
- name: INFLUXDB_PASSWORD - name: INFLUXDB_PASSWORD
...@@ -34,14 +34,14 @@ spec: ...@@ -34,14 +34,14 @@ spec:
{{- if .Values.setDefaultUser.user.existingSecret }} {{- if .Values.setDefaultUser.user.existingSecret }}
name: {{ .Values.setDefaultUser.user.existingSecret -}} name: {{ .Values.setDefaultUser.user.existingSecret -}}
{{ else }} {{ else }}
name: {{ template "influxdb.fullname" . }}-auth name: {{ include "influxdb.fullname" . }}-auth
{{- end }} {{- end }}
key: influxdb-password key: influxdb-password
args: args:
- "/bin/sh" - "/bin/sh"
- "-c" - "-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 \ --data-urlencode \
"q=CREATE USER \"${INFLUXDB_USER}\" WITH PASSWORD '${INFLUXDB_PASSWORD}' {{ .Values.setDefaultUser.user.privileges }}" "q=CREATE USER \"${INFLUXDB_USER}\" WITH PASSWORD '${INFLUXDB_PASSWORD}' {{ .Values.setDefaultUser.user.privileges }}"
restartPolicy: {{ .Values.setDefaultUser.restartPolicy }} 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