Unverified Commit 5151027d authored by tomklapka's avatar tomklapka Committed by GitHub

fix: influxdb ports, ingress resource (#566)

parent e293200e
apiVersion: v1
name: influxdb
version: 4.12.1
version: 4.12.2
appVersion: 1.8.10
description: Scalable datastore for metrics, events, and real-time analytics.
keywords:
......
......@@ -47,7 +47,7 @@ This command removes all the Kubernetes components associated with the chart and
The following table lists configurable parameters, their descriptions, and their default values stored in `values.yaml`.
| Parameter | Description | Default |
|---|---|---|
|---|---|----------------------------------------------------------------------|
| image.repository | Image repository url | influxdb |
| image.tag | Image tag | 1.8.0-alpine |
| image.pullPolicy | Image pull policy | IfNotPresent |
......@@ -74,11 +74,11 @@ The following table lists configurable parameters, their descriptions, and their
| ingress.enabled | Boolean flag to enable or disable ingress | false |
| ingress.tls | Boolean to enable or disable tls for ingress. If enabled provide a secret in `ingress.secretName` containing TLS private key and certificate. | false |
| ingress.secretName | Kubernetes secret containing TLS private key and certificate. It is `only` required if `ingress.tls` is enabled. | nil |
| ingress.hostname | Hostname for the ingress | influxdb.foobar.com |
| ingress.hostname | Hostname for the ingress | `""` |
| ingress.annotations | ingress annotations | nil |
| schedulerName | Use an [alternate scheduler](https://kubernetes.io/docs/tasks/administer-cluster/configure-multiple-schedulers/), e.g. "stork". | nil |
| nodeSelector | Node labels for pod assignment | {} |
| affinity | [Affinity](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity) for pod assignment | {|
| affinity | [Affinity](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity) for pod assignment | { |
| tolerations | [Tolerations](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/) for pod assignment | [] |
| securityContext | [securityContext](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/) for pod | {} |
| env | environment variables for influxdb container | {} |
......@@ -86,14 +86,14 @@ The following table lists configurable parameters, their descriptions, and their
| mountPoints | `volumeMount` stanza(s) to be used in the main container | nil |
| extraContainers | Additional containers to be added to the pod | {} |
| config.reporting_disabled | [Details](https://docs.influxdata.com/influxdb/v1.8/administration/config/#reporting-disabled-false) | false |
| config.rpc | RPC address for backup and storage | {} |
| config.rpc | RPC address for backup and storage | `bind-address: ":8088"` |
| config.meta | [Details](https://docs.influxdata.com/influxdb/v1.8/administration/config/#meta) | {} |
| config.data | [Details](https://docs.influxdata.com/influxdb/v1.8/administration/config/#data) | {} |
| config.coordinator | [Details](https://docs.influxdata.com/influxdb/v1.8/administration/config/#coordinator) | {} |
| config.retention | [Details](https://docs.influxdata.com/influxdb/v1.8/administration/config/#retention) | {} |
| config.shard_precreation | [Details](https://docs.influxdata.com/influxdb/v1.8/administration/config/#shard-precreation) | {} |
| config.monitor | [Details](https://docs.influxdata.com/influxdb/v1.8/administration/config/#monitor) | {} |
| config.http | [Details](https://docs.influxdata.com/influxdb/v1.8/administration/config/#http) | {} |
| config.http | [Details](https://docs.influxdata.com/influxdb/v1.8/administration/config/#http) | `enabled: true`<br/>`bind-address: ":8086"`<br/>`flux-enabled: true` |
| config.logging | [Details](https://docs.influxdata.com/influxdb/v1.8/administration/config/#logging) | {} |
| config.subscriber | [Details](https://docs.influxdata.com/influxdb/v1.8/administration/config/#subscriber) | {} |
| config.graphite | [Details](https://docs.influxdata.com/influxdb/v1.8/administration/config/#graphite) | {} |
......@@ -114,7 +114,7 @@ The following table lists configurable parameters, their descriptions, and their
| backup.podAnnotations | Annotations for backup cronjob pods | {} |
| backup.persistence.enabled | Boolean to enable and disable persistance | false |
| backup.persistence.storageClass | If set to "-", storageClassName: "", which disables dynamic provisioning. If undefined (the default) or set to null, no storageClassName spec is set, choosing the default provisioner. (gp2 on AWS, standard on GKE, AWS & OpenStack | |
| backup.persistence.annotations | Annotations for volumeClaimTemplates | nil |
| backup.persistence.annotations | Annotations for volumeClaimTemplates | {} |
| backup.persistence.accessMode | Access mode for the volume | ReadWriteOnce |
| backup.persistence.size | Storage size | 8Gi |
| backup.resources | Resources requests and limits for `backup` pods | `ephemeral-storage: 8Gi` |
......
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 {{ include "influxdb.httpPortNumber" . }} on the following DNS name from within your cluster:
http://{{ include "influxdb.fullname" . }}.{{ .Release.Namespace }}:{{ .Values.config.http.bind_address | default 8086 }}
http://{{ include "influxdb.fullname" . }}.{{ .Release.Namespace }}:{{ include "influxdb.httpPortNumber" . }}
You can connect to the remote instance with the 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={{ include "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:{{ include "influxdb.httpPortNumber" . }}
You can also connect to the influx CLI from inside the container. To open a shell session in the InfluxDB pod, run the following:
......
......@@ -61,3 +61,28 @@ Create the name of the service account to use
{{ default "default" .Values.serviceAccount.name }}
{{- end -}}
{{- end -}}
{{/*
Define ports for kubernetes.
*/}}
{{- define "influxdb.rpcPortNumber" -}}
{{ default 8088 (regexReplaceAll ":([0-9]+)" (index .Values "config" "rpc" "bind-address") "${1}") }}
{{- end -}}
{{- define "influxdb.metaPortNumber" -}}
{{ default 8091 (regexReplaceAll ":([0-9]+)" (index .Values "config" "meta" "bind-address") "${1}") }}
{{- end -}}
{{- define "influxdb.httpPortNumber" -}}
{{ default 8086 (regexReplaceAll ":([0-9]+)" (index .Values "config" "http" "bind-address") "${1}") }}
{{- end -}}
{{- define "influxdb.graphitePortNumber" -}}
{{ default 2003 (regexReplaceAll ":([0-9]+)" (index .Values "config" "graphite" "bind-address") "${1}") }}
{{- end -}}
{{- define "influxdb.collectdPortNumber" -}}
{{ default 25826 (regexReplaceAll ":([0-9]+)" (index .Values "config" "collectd" "bind-address") "${1}") }}
{{- end -}}
{{- define "influxdb.opentsdbPortNumber" -}}
{{ default 4242 (regexReplaceAll ":([0-9]+)" (index .Values "config" "opentsdb" "bind-address") "${1}") }}
{{- end -}}
{{- define "influxdb.udpPortNumber" -}}
{{ default 8089 (regexReplaceAll ":([0-9]+)" (index .Values "config" "udp" "bind-address") "${1}") }}
{{- end -}}
......@@ -67,7 +67,7 @@ spec:
- '-c'
- |
influxd backup \
-host {{ include "influxdb.fullname" . }}.{{ .Release.Namespace }}.svc:{{ .Values.config.rpc.bind_address | default 8088 }} \
-host {{ include "influxdb.fullname" . }}.{{ .Release.Namespace }}.svc:{{ include "influxdb.rpcPortNumber" . }} \
-portable /backup/"$(date +%Y%m%d%H%M%S)"
resources:
{{- toYaml .Values.backup.resources | nindent 14 }}
......
......@@ -6,8 +6,8 @@ metadata:
{{- include "influxdb.labels" . | nindent 4 }}
data:
influxdb.conf: |+
reporting-disabled = {{ .Values.config.reporting_disabled | default false }}
bind-address = ":{{ .Values.config.rpc.bind_address | default 8088 }}"
reporting-disabled = {{ .Values.config.reporting_disabled }}
bind-address = "{{ index .Values "config" "rpc" "bind-address"| default (printf ":%s" (include "influxdb.rpcPortNumber" . ))}}"
[meta]
dir = "/var/lib/influxdb/meta"
......
{{- if .Values.ingress.enabled -}}
{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }}
{{- if .Values.ingress.enabled }}
apiVersion: networking.k8s.io/v1
{{- else }}
apiVersion: networking.k8s.io/v1beta1
{{- end }}
kind: Ingress
metadata:
name: {{ include "influxdb.fullname" . }}
labels:
{{- include "influxdb.labels" . | nindent 4 }}
{{- if .Values.ingress.annotations }}
annotations:
{{ toYaml .Values.ingress.annotations | indent 4 }}
{{ toYaml .Values.ingress.annotations | indent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.tls }}
tls:
......@@ -22,21 +20,18 @@ spec:
ingressClassName: {{ .Values.ingress.className }}
{{- end }}
rules:
{{- if .Values.ingress.hostname }}
- host: {{ .Values.ingress.hostname }}
http:
{{- else }}
- http:
{{- end }}
paths:
- path: {{ .Values.ingress.path }}
{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }}
pathType: Prefix
{{- end }}
backend:
{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }}
service:
name: {{ include "influxdb.fullname" . }}
port:
number: 8086
{{- else }}
serviceName: {{ include "influxdb.fullname" . }}
servicePort: 8086
{{- end }}
{{- end -}}
number: {{ include "influxdb.httpPortNumber" . }}
{{- end }}
......@@ -8,8 +8,8 @@ metadata:
app.kubernetes.io/component: meta
data:
influxdb-meta.conf: |+
reporting-disabled = {{ .Values.config.reporting_disabled | default false }}
bind-address = ":{{ .Values.config.meta.bind_address | default 8091 }}"
reporting-disabled = {{ .Values.config.reporting_disabled }}
bind-address = "{{ index .Values "config" "meta" "bind-address" | default (printf ":%s" (include "influxdb.metaPortNumber" .))}}"
[enterprise]
license-key = {{ .Values.enterprise.licensekey | quote }}
......
......@@ -17,7 +17,7 @@ spec:
publishNotReadyAddresses: true
ports:
- name: meta
port: {{ .Values.config.meta.bind_address | default 8091 }}
port: {{ include "influxdb.metaPortNumber" . }}
targetPort: meta
selector:
{{- include "influxdb.selectorLabels" . | nindent 4 }}
......
......@@ -38,11 +38,11 @@ spec:
{{ toYaml .Values.enterprise.meta.resources | indent 10 }}
ports:
- name: udp
containerPort: {{ .Values.config.udp.bind_address | default 8089 }}
containerPort: {{ include "influxdb.udpPortNumber" . }}
- name: rpc
containerPort: {{ .Values.config.rpc.bind_address | default 8088 }}
containerPort: {{ include "influxdb.rpcPortNumber" . }}
- name: meta
containerPort: {{ .Values.config.meta.bind_address | default 8091 }}
containerPort: {{ include "influxdb.metaPortNumber" . }}
{{- if .Values.env }}
env:
{{ toYaml .Values.env | indent 10 }}
......
......@@ -12,34 +12,34 @@ spec:
type: {{ .Values.service.type }}
ports:
- name: api
port: {{ .Values.config.http.bind_address | default 8086 }}
port: {{ include "influxdb.httpPortNumber" . }}
targetPort: api
{{- if (and (or (eq .Values.service.type "NodePort") (eq .Values.service.type "LoadBalancer")) (not (empty .Values.service.nodePorts.http))) }}
nodePort: {{ .Values.service.nodePorts.http | int }}
{{- end }}
- name: rpc
port: {{ .Values.config.rpc.bind_address | default 8088 }}
port: {{ include "influxdb.rpcPortNumber" . }}
targetPort: rpc
{{- if .Values.config.graphite.enabled }}
- name: graphite
port: {{ .Values.config.graphite.bind_address | default 2003 }}
port: {{ include "influxdb.graphitePortNumber" . }}
targetPort: graphite
{{- end }}
{{- if .Values.config.collectd.enabled }}
- name: collectd
port: {{ .Values.config.collectd.bind_address | default 25826 }}
port: {{ include "influxdb.collectdPortNumber" . }}
protocol: UDP
targetPort: collectd
{{- end }}
{{- if .Values.config.udp.enabled }}
- name: udp
port: {{ .Values.config.udp.bind_address | default 8089 }}
port: {{ include "influxdb.udpPortNumber" . }}
protocol: UDP
targetPort: udp
{{- end }}
{{- if .Values.config.opentsdb.enabled }}
- name: opentsdb
port: {{ .Values.config.opentsdb.bind_address | default 4242 }}
port: {{ include "influxdb.opentsdbPortNumber" . }}
targetPort: opentsdb
{{- end }}
selector:
......
......@@ -62,30 +62,30 @@ spec:
{{- end }}
ports:
- name: api
containerPort: {{ .Values.config.http.bind_address | default 8086 }}
containerPort: {{ include "influxdb.httpPortNumber" . }}
{{- if .Values.config.graphite.enabled }}
- name: graphite
containerPort: {{ .Values.config.graphite.bind_address | default 2003 }}
containerPort: {{ include "influxdb.graphitePortNumber" . }}
{{- end }}
{{- if .Values.config.collectd.enabled }}
- name: collectd
containerPort: {{ .Values.config.collectd.bind_address | default 25826 }}
containerPort: {{ include "influxdb.collectdPortNumber" . }}
protocol: UDP
{{- end }}
{{- if .Values.config.udp.enabled }}
- name: udp
containerPort: {{ .Values.config.udp.bind_address | default 8089 }}
containerPort: {{ include "influxdb.udpPortNumber" . }}
protocol: UDP
{{- end }}
{{- if .Values.config.opentsdb.enabled }}
- name: opentsdb
containerPort: {{ .Values.config.opentsdb.bind_address | default 4242 }}
containerPort: {{ include "influxdb.opentsdbPortNumber" . }}
{{- end }}
- name: rpc
containerPort: {{ .Values.config.rpc.bind_address | default 8088 }}
containerPort: {{ include "influxdb.rpcPortNumber" . }}
{{- if .Values.enterprise.enabled }}
- name: meta
containerPort: {{ .Values.config.meta.bind_address | default 8091 }}
containerPort: {{ include "influxdb.metaPortNumber" . }}
{{- end }}
{{- if or .Values.env .Values.setDefaultUser.enabled }}
env:
......@@ -187,10 +187,12 @@ spec:
volumeClaimTemplates:
- metadata:
name: {{ include "influxdb.fullname" . }}-data
{{- if .Values.persistence.annotations }}
annotations:
{{- range $key, $value := .Values.persistence.annotations }}
{{ $key }}: "{{ $value }}"
{{- end }}
{{- end }}
spec:
accessModes:
- {{ .Values.persistence.accessMode | quote}}
......
......@@ -71,7 +71,7 @@ persistence:
## GKE, AWS & OpenStack)
##
# storageClass: "-"
annotations:
annotations: {}
accessMode: ReadWriteOnce
size: 8Gi
......@@ -140,11 +140,10 @@ ingress:
enabled: false
tls: false
# secretName: my-tls-cert # only needed if tls above is true
hostname: influxdb.foobar.com
className: null
hostname: ""
className: nginx
annotations: {}
# kubernetes.io/ingress.class: "nginx"
# kubernetes.io/tls-acme: "true"
# nginx.ingress.kubernetes.io/rewrite-target: $1
path: /
......@@ -204,14 +203,18 @@ envFromSecret: {}
## ref: https://docs.influxdata.com/influxdb/v1.8/administration/config
config:
reporting_disabled: false
rpc: {}
rpc:
bind-address: ":8088"
meta: {}
data: {}
coordinator: {}
retention: {}
shard_precreation: {}
monitor: {}
http: {}
http:
enabled: true
bind-address: ":8086"
flux-enabled: true
logging: {}
subscriber: {}
graphite: {}
......
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