Add loadbalancersourceranges to ssh service #105
@ -8,8 +8,16 @@ metadata:
|
||||
{{- toYaml .Values.service.ssh.annotations | nindent 4 }}
|
||||
spec:
|
||||
type: {{ .Values.service.ssh.type }}
|
||||
{{- if and .Values.service.ssh.loadBalancerIP (eq .Values.service.ssh.type "LoadBalancer") }}
|
||||
{{- if eq .Values.service.ssh.type "LoadBalancer" }}
|
||||
|
||||
{{- if .Values.service.ssh.loadBalancerIP }}
|
||||
techknowlogick
commented
Can you wrap a conditional around Can you wrap a conditional around `loadBalancerSourceRanges` in case the array is empty?
|
||||
loadBalancerIP: {{ .Values.service.ssh.loadBalancerIP }}
|
||||
{{- end -}}
|
||||
{{- if .Values.service.ssh.loadBalancerSourceRanges }}
|
||||
loadBalancerSourceRanges:
|
||||
{{- range .Values.service.ssh.loadBalancerSourceRanges }}
|
||||
- {{ . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if and .Values.service.ssh.clusterIP (eq .Values.service.ssh.type "ClusterIP") }}
|
||||
clusterIP: {{ .Values.service.ssh.clusterIP }}
|
||||
|
@ -29,6 +29,7 @@ service:
|
||||
#nodePort:
|
||||
#externalTrafficPolicy:
|
||||
#externalIPs:
|
||||
loadBalancerSourceRanges: []
|
||||
annotations:
|
||||
|
||||
ingress:
|
||||
|
Loading…
Reference in New Issue
Block a user
The "and" seems to be wrong here.
I think it would be better, if we make one if to check if type == loadBalancer.
Including two other ifs to check if sourceRanges and/or an ip is provided.
Something like this:
thanks for the feedback @luhahn I've pushed the changes
This will now only trigger, if loadBalancerIP is set AND type == LoadBalancer.
I guess you would want to use loadBalancerSourceRanges with and without a loadBalancerIP.
Please split the if above like that:
@luhahn if I'm not mistaken, loadBalancerSourceRanges is only effective for LoadBancer type services, so there is no need to use it if the service type is not LoadBalancer
It doesn't say so specifically but that is my uderstanding from the documentatoin
Yes, I know. But currently your loadBalancerSourceRanges would only apply if also a loadBalancerIP is given.
Please have a closer look at my suggested if.
Oh, I see! Many thanks for your detailed explanation, I reckon that's way better. I've just pushed the commit :)