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

fix: influxdb ports, ingress resource (#566)

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