Unverified Commit 70eb8749 authored by Yurii Matsiuk's avatar Yurii Matsiuk Committed by GitHub

Add service type and ingressClass to influxdb2 (#257)

parent 6e5f64e3
...@@ -5,7 +5,7 @@ name: influxdb2 ...@@ -5,7 +5,7 @@ name: influxdb2
description: A Helm chart for InfluxDB v2 description: A Helm chart for InfluxDB v2
home: https://www.influxdata.com/products/influxdb-overview/influxdb-2-0/ home: https://www.influxdata.com/products/influxdb-overview/influxdb-2-0/
type: application type: application
version: 1.0.13 version: 1.0.14
maintainers: maintainers:
- name: rawkode - name: rawkode
email: rawkode@influxdata.com email: rawkode@influxdata.com
......
...@@ -10,6 +10,9 @@ metadata: ...@@ -10,6 +10,9 @@ metadata:
{{- toYaml . | nindent 4 }} {{- toYaml . | nindent 4 }}
{{- end }} {{- end }}
spec: spec:
{{- if .Values.ingress.ingressClassName }}
ingressClassName: {{ .Values.ingress.ingressClassName }}
{{- end -}}
{{- if .Values.ingress.tls }} {{- if .Values.ingress.tls }}
tls: tls:
- hosts: - hosts:
...@@ -23,5 +26,5 @@ spec: ...@@ -23,5 +26,5 @@ spec:
- path: {{ .Values.ingress.path }} - path: {{ .Values.ingress.path }}
backend: backend:
serviceName: {{ include "influxdb.fullname" . }} serviceName: {{ include "influxdb.fullname" . }}
servicePort: http servicePort: {{ .Values.service.portName }}
{{- end -}} {{- end -}}
...@@ -3,11 +3,37 @@ kind: Service ...@@ -3,11 +3,37 @@ kind: Service
metadata: metadata:
name: {{ template "influxdb.fullname" . }} name: {{ template "influxdb.fullname" . }}
labels: {{- include "influxdb.labels" . | nindent 4 }} labels: {{- include "influxdb.labels" . | nindent 4 }}
{{- with .Values.service.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec: spec:
{{- if (or (eq .Values.service.type "ClusterIP") (empty .Values.service.type)) }}
type: ClusterIP type: ClusterIP
{{- if .Values.service.clusterIP }}
clusterIP: {{ .Values.service.clusterIP }}
{{end}}
{{- else if eq .Values.service.type "LoadBalancer" }}
type: {{ .Values.service.type }}
{{- if .Values.service.loadBalancerIP }}
loadBalancerIP: {{ .Values.service.loadBalancerIP }}
{{- end }}
{{- if .Values.service.loadBalancerSourceRanges }}
loadBalancerSourceRanges:
{{ toYaml .Values.service.loadBalancerSourceRanges | indent 4 }}
{{- end -}}
{{- else }}
type: {{ .Values.service.type }}
{{- end }}
ports: ports:
- port: {{ .Values.service.port }} - name: {{ .Values.service.portName }}
targetPort: http port: {{ .Values.service.port }}
protocol: TCP protocol: TCP
name: http targetPort: {{ .Values.service.targetPort }}
{{ if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePort))) }}
nodePort: {{.Values.service.nodePort}}
{{ end }}
{{- if .Values.extraExposePorts }}
{{- tpl (toYaml .Values.extraExposePorts) . | indent 4 }}
{{- end }}
selector: {{- include "influxdb.selectorLabels" . | nindent 4 }} selector: {{- include "influxdb.selectorLabels" . | nindent 4 }}
...@@ -33,7 +33,7 @@ spec: ...@@ -33,7 +33,7 @@ spec:
image: "{{ .Values.image.repository }}:v{{ .Chart.AppVersion }}" image: "{{ .Values.image.repository }}:v{{ .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }} imagePullPolicy: {{ .Values.image.pullPolicy }}
ports: ports:
- name: http - name: {{ .Values.service.portName }}
containerPort: 8086 containerPort: 8086
protocol: TCP protocol: TCP
{{- if .Values.securityContext }} {{- if .Values.securityContext }}
......
...@@ -58,10 +58,18 @@ persistence: ...@@ -58,10 +58,18 @@ persistence:
size: 50Gi size: 50Gi
service: service:
type: ClusterIP
port: 80 port: 80
targetPort: 8086
annotations: {}
labels: {}
portName: http
ingress: ingress:
enabled: false enabled: false
# For Kubernetes >= 1.18 you should specify the ingress-controller via the field ingressClassName
# See https://kubernetes.io/blog/2020/04/02/improvements-to-the-ingress-api-in-kubernetes-1.18/#specifying-the-class-of-an-ingress
# ingressClassName: nginx
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: influxdb.foobar.com
......
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