X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=helm%2F3rdparty%2Finfluxdb%2Ftemplates%2Fservice.yaml;fp=helm%2F3rdparty%2Finfluxdb%2Ftemplates%2Fservice.yaml;h=daada35a963d087b45e6fca67fd10bf9240e80a2;hb=5b91760965953d3f08cede0d61f638b54c7397b8;hp=d226f2d117168b4b1c917e17a1aa59e72adb35e0;hpb=b6a7c14c6064aec767785c347a1e5a348329ac67;p=ric-plt%2Fric-dep.git diff --git a/helm/3rdparty/influxdb/templates/service.yaml b/helm/3rdparty/influxdb/templates/service.yaml index d226f2d..daada35 100644 --- a/helm/3rdparty/influxdb/templates/service.yaml +++ b/helm/3rdparty/influxdb/templates/service.yaml @@ -1,68 +1,40 @@ -################################################################################ -# Copyright (c) 2021 HCL Technolgies Limited. # -# # -# Licensed under the Apache License, Version 2.0 (the "License"); # -# you may not use this file except in compliance with the License. # -# You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software # -# distributed under the License is distributed on an "AS IS" BASIS, # -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # -# See the License for the specific language governing permissions and # -# limitations under the License. # -################################################################################ apiVersion: v1 kind: Service metadata: -{{- if .Values.service.annotations }} + name: {{ template "influxdb.fullname" . }} + labels: {{- include "influxdb.labels" . | nindent 4 }} +{{- with .Values.service.annotations }} annotations: -{{ toYaml .Values.service.annotations | indent 4 }} +{{ toYaml . | indent 4 }} {{- end }} - name: {{ include "common.fullname.influxdb" . }} - labels: - {{- include "common.influxdb.labels" . | nindent 4 }} spec: +{{- if (or (eq .Values.service.type "ClusterIP") (empty .Values.service.type)) }} + type: ClusterIP + {{- if .Values.service.clusterIP }} + clusterIP: {{ .Values.service.clusterIP }} + {{end}} +{{- else if eq .Values.service.type "LoadBalancer" }} type: {{ .Values.service.type }} - ports: - - name: api - port: {{ include "common.serviceport.influxdb.http.bind_address" . | default 8086 }} - targetPort: api - - name: rpc - port: {{ include "common.serviceport.influxdb.rpc.bind_address" . | default 8088 }} - targetPort: rpc - {{- if .Values.config.graphite.enabled }} - - name: graphite - port: {{ include "common.serviceport.influxdb.graphite.bind_address" . | default 2003 }} - targetPort: graphite - {{- end }} - {{- if .Values.config.collectd.enabled }} - - name: collectd - port: {{ include "common.serviceport.influxdb.collectd.bind_address" . | default 25826 }} - protocol: UDP - targetPort: collectd - {{- end }} - {{- if .Values.config.udp.enabled }} - - name: udp - port: {{ include "common.serviceport.influxdb.udp.bind_address" . | default 8089 }} - protocol: UDP - targetPort: udp - {{- end }} - {{- if .Values.config.opentsdb.enabled }} - - name: opentsdb - port: {{ include "common.serviceport.influxdb.opentsdb.bind_address" . | default 4242 }} - targetPort: opentsdb - {{- end }} - selector: - {{- include "common.influxdb.selectorLabels" . | nindent 4 }} -{{- if .Values.service.loadBalancerIP }} + {{- 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 }} -{{- if .Values.service.externalIPs }} - externalIPs: -{{ toYaml .Values.service.externalIPs | indent 4 }} -{{- end }} -{{- if .Values.service.externalTrafficPolicy }} - externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy }} + ports: + - name: {{ .Values.service.portName }} + port: {{ .Values.service.port }} + protocol: TCP + 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 }}