Commit 19ad8acd authored by Kevin Schumacher's avatar Kevin Schumacher Committed by Dhilip

[stable/kapacitor] #1785 namespace defined templates with chart name (#2137)

parent 266cea40
name: kapacitor name: kapacitor
version: 0.3.1 version: 0.4.0
description: InfluxDB's native data processing engine. It can process both stream and batch data from InfluxDB. description: InfluxDB's native data processing engine. It can process both stream
and batch data from InfluxDB.
keywords: keywords:
- kapacitor - kapacitor
- stream - stream
...@@ -8,7 +9,7 @@ keywords: ...@@ -8,7 +9,7 @@ keywords:
- timeseries - timeseries
home: https://www.influxdata.com/time-series-platform/kapacitor/ home: https://www.influxdata.com/time-series-platform/kapacitor/
sources: sources:
- https://github.com/influxdata/kapacitor - https://github.com/influxdata/kapacitor
maintainers: maintainers:
- name: Jack Zampolin - name: Jack Zampolin
email: jack@influxdb.com email: jack@influxdb.com
......
...@@ -2,25 +2,25 @@ ...@@ -2,25 +2,25 @@
{{- if not $bl }} {{- if not $bl }}
Kapacitor can be accessed via port 9092 on the following DNS name from within your cluster: Kapacitor can be accessed via port 9092 on the following DNS name from within your cluster:
- http://{{ template "fullname" . }}.{{ .Release.Namespace }}:9092 - 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 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 "fullname" . }} -o jsonpath='{ .items[0].metadata.name }') 9092: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: 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 "fullname" . }} -o jsonpath='{.items[0].metadata.name}') /bin/sh - 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: 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 "fullname" . }} -o jsonpath='{ .items[0].metadata.name }') - 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" }} {{- if eq .Values.service.type "LoadBalancer" }}
To watch for the LoadBalancer IP or Hostname to populate run the following: To watch for the LoadBalancer IP or Hostname to populate run the following:
- kubectl get svc -w --namespace {{ .Release.Namespace }} -l app={{ template "fullname" . }} - kubectl get svc -w --namespace {{ .Release.Namespace }} -l app={{ template "kapacitor.fullname" . }}
{{- end }} {{- end }}
{{- end }} {{- end }}
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
{{/* {{/*
Expand the name of the chart. Expand the name of the chart.
*/}} */}}
{{- define "name" -}} {{- define "kapacitor.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}} {{- end -}}
...@@ -10,7 +10,7 @@ Expand the name of the chart. ...@@ -10,7 +10,7 @@ Expand the name of the chart.
Create a default fully qualified app name. Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}} */}}
{{- define "fullname" -}} {{- define "kapacitor.fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}} {{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}} {{- end -}}
...@@ -3,18 +3,18 @@ ...@@ -3,18 +3,18 @@
apiVersion: extensions/v1beta1 apiVersion: extensions/v1beta1
kind: Deployment kind: Deployment
metadata: metadata:
name: {{ template "fullname" . }} name: {{ template "kapacitor.fullname" . }}
labels: labels:
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}" release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}" heritage: "{{ .Release.Service }}"
app: {{ template "fullname" . }} app: {{ template "kapacitor.fullname" . }}
spec: spec:
replicas: 1 replicas: 1
template: template:
metadata: metadata:
labels: labels:
app: {{ template "fullname" . }} app: {{ template "kapacitor.fullname" . }}
spec: spec:
containers: containers:
- name: {{ .Chart.Name }} - name: {{ .Chart.Name }}
...@@ -22,7 +22,7 @@ spec: ...@@ -22,7 +22,7 @@ spec:
imagePullPolicy: {{ .Values.image.pullPolicy }} imagePullPolicy: {{ .Values.image.pullPolicy }}
env: env:
- name: KAPACITOR_HOSTNAME - name: KAPACITOR_HOSTNAME
value: {{ template "fullname" . }}.{{ .Release.Namespace }} value: {{ template "kapacitor.fullname" . }}.{{ .Release.Namespace }}
- name: KAPACITOR_INFLUXDB_0_URLS_0 - name: KAPACITOR_INFLUXDB_0_URLS_0
value: {{ .Values.influxURL }} value: {{ .Values.influxURL }}
{{- range $key, $val := .Values.envVars }} {{- range $key, $val := .Values.envVars }}
...@@ -40,7 +40,7 @@ spec: ...@@ -40,7 +40,7 @@ spec:
- name: data - name: data
{{- if .Values.persistence.enabled }} {{- if .Values.persistence.enabled }}
persistentVolumeClaim: persistentVolumeClaim:
claimName: {{ template "fullname" . }} claimName: {{ template "kapacitor.fullname" . }}
{{- else }} {{- else }}
emptyDir: {} emptyDir: {}
{{- end }} {{- end }}
......
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
kind: PersistentVolumeClaim kind: PersistentVolumeClaim
apiVersion: v1 apiVersion: v1
metadata: metadata:
name: {{ template "fullname" . }} name: {{ template "kapacitor.fullname" . }}
labels: labels:
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}" release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}" heritage: "{{ .Release.Service }}"
app: {{ template "fullname" . }} app: {{ template "kapacitor.fullname" . }}
spec: spec:
accessModes: accessModes:
- {{ .Values.persistence.accessMode | quote }} - {{ .Values.persistence.accessMode | quote }}
......
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
name: {{ template "fullname" . }} name: {{ template "kapacitor.fullname" . }}
labels: labels:
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}" release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}" heritage: "{{ .Release.Service }}"
app: {{ template "fullname" . }} app: {{ template "kapacitor.fullname" . }}
spec: spec:
type: {{ .Values.service.type }} type: {{ .Values.service.type }}
ports: ports:
...@@ -14,4 +14,4 @@ spec: ...@@ -14,4 +14,4 @@ spec:
targetPort: 9092 targetPort: 9092
name: api name: api
selector: selector:
app: {{ template "fullname" . }} app: {{ template "kapacitor.fullname" . }}
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