initial commit
All checks were successful
Build and Publish TechDocs / build-and-publish (push) Successful in 1m15s
All checks were successful
Build and Publish TechDocs / build-and-publish (push) Successful in 1m15s
Change-Id: I2e2564a72b6be9af536235fc3795fd788fd9257b
This commit is contained in:
91
haproxy/templates/service.yaml
Normal file
91
haproxy/templates/service.yaml
Normal file
@@ -0,0 +1,91 @@
|
||||
{{/*
|
||||
Copyright 2020 HAProxy Technologies LLC
|
||||
|
||||
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:
|
||||
name: {{ include "haproxy.fullname" . }}
|
||||
namespace: {{ include "haproxy.namespace" . }}
|
||||
labels:
|
||||
{{- include "haproxy.labels" . | nindent 4 }}
|
||||
{{- range $key, $value := .Values.service.labels }}
|
||||
{{ $key }}: {{ $value | quote }}
|
||||
{{- end }}
|
||||
annotations:
|
||||
{{- range $key, $value := .Values.service.annotations }}
|
||||
{{ $key }}: {{ $value | quote }}
|
||||
{{- end }}
|
||||
spec:
|
||||
type: {{ .Values.service.type }}
|
||||
selector:
|
||||
{{- include "haproxy.selectorLabels" . | nindent 4 }}
|
||||
{{- if .Values.service.externalTrafficPolicy }}
|
||||
externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy }}
|
||||
{{- end }}
|
||||
{{- if .Values.service.internalTrafficPolicy }}
|
||||
internalTrafficPolicy: {{ .Values.service.internalTrafficPolicy }}
|
||||
{{- end }}
|
||||
{{- with .Values.service.clusterIP }}
|
||||
clusterIP: {{ . | quote}}
|
||||
{{- end }}
|
||||
{{- with .Values.service.loadBalancerIP }}
|
||||
loadBalancerIP: {{ . | quote }}
|
||||
{{- end }}
|
||||
{{- with .Values.service.loadBalancerSourceRanges }}
|
||||
loadBalancerSourceRanges:
|
||||
{{- toYaml . | nindent 2 }}
|
||||
{{- end }}
|
||||
{{- if .Values.service.ipFamilies }}
|
||||
ipFamilies:
|
||||
{{- toYaml .Values.service.ipFamilies | nindent 2 }}
|
||||
{{- end }}
|
||||
{{- if .Values.service.ipFamilyPolicy }}
|
||||
ipFamilyPolicy: {{ .Values.service.ipFamilyPolicy | quote }}
|
||||
{{- end }}
|
||||
{{- with .Values.service.externalIPs }}
|
||||
externalIPs:
|
||||
{{- toYaml . | nindent 2 }}
|
||||
{{- end }}
|
||||
{{- if or .Values.containerPorts .Values.service.additionalPorts .Values.service.rawAdditionalPorts }}
|
||||
{{- $nodePorts := .Values.service.nodePorts }}
|
||||
{{- $servicePortType := .Values.service.type }}
|
||||
ports:
|
||||
{{- with .Values.containerPorts }}
|
||||
{{- range $key, $port := . }}
|
||||
- name: {{ $key }}
|
||||
protocol: TCP
|
||||
port: {{ $port }}
|
||||
targetPort: {{ $key }}
|
||||
{{- if and (hasKey $nodePorts $key) (eq $servicePortType "NodePort") }}
|
||||
nodePort: {{ get $nodePorts $key }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- with .Values.service.additionalPorts }}
|
||||
{{- range $key, $port := . }}
|
||||
- name: {{ $key }}
|
||||
protocol: TCP
|
||||
port: {{ $port }}
|
||||
targetPort: {{ $key }}
|
||||
{{- if and (hasKey $nodePorts $key) (eq $servicePortType "NodePort") }}
|
||||
nodePort: {{ get $nodePorts $key }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- with .Values.service.rawAdditionalPorts }}
|
||||
{{- toYaml . | nindent 2 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user