{{- $bl := empty .Values.influxURL }}
{{- if not $bl }}
Kapacitor can be accessed via port 9092 on the following DNS name from within your cluster:

- http://{{ template "kapacitor.fullname" . }}.{{ .Release.Namespace }}:9092

You can easily connect to the remote instance from a local kapacitor cli. Forward the api port to localhost:9092

- kubectl port-forward --namespace {{ .Release.Namespace }} $(kubectl get pods --namespace {{ .Release.Namespace }} -l app={{ template "kapacitor.fullname" . }} -o jsonpath='{ .items[0].metadata.name }') 9092:9092

You can also connect to the container running Kapacitor. To open a shell session in the pod run the following:

- kubectl exec -i -t --namespace {{ .Release.Namespace }} $(kubectl get pods --namespace {{ .Release.Namespace }} -l app={{ template "kapacitor.fullname" . }} -o jsonpath='{.items[0].metadata.name}') /bin/sh

To tail the logs for the Kapacitor pod run the following:

- kubectl logs -f --namespace {{ .Release.Namespace }} $(kubectl get pods --namespace {{ .Release.Namespace }} -l app={{ template "kapacitor.fullname" . }} -o jsonpath='{ .items[0].metadata.name }')

{{- if eq .Values.service.type "LoadBalancer" }}

To watch for the LoadBalancer IP or Hostname to populate run the following:

- kubectl get svc -w --namespace {{ .Release.Namespace }} -l app={{ template "kapacitor.fullname" . }}
{{- end }}
{{- end }}

{{- if empty .Values.influxURL }}
You have not set .Values.influxURL. Kapacitor needs an InfluxDB instance to create a subscription on. Please set that value to deploy kapacitor
{{- end }}