Skip to content

Commit

Permalink
Merge pull request #7597 from sapcc/d073579/unbound-maintenance
Browse files Browse the repository at this point in the history
[unbound] split the unbound service in two and don't use named ports
  • Loading branch information
vssldmtrv authored Dec 30, 2024
2 parents 6e355a0 + 270b82f commit 8080b4e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 23 deletions.
9 changes: 0 additions & 9 deletions system/unbound/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,6 @@ spec:
{{ toYaml .Values.resources.unbound | indent 10 }}
securityContext:
privileged: true
ports:
{{- range $.Values.unbound.externalPorts | required "externalPorts missing" }}
- name: dns-tcp-{{.}}
containerPort: {{.}}
protocol: TCP
- name: dns-udp-{{.}}
containerPort: {{.}}
protocol: UDP
{{- end }}
volumeMounts:
- name: unbound-conf
mountPath: /etc/unbound
Expand Down
27 changes: 13 additions & 14 deletions system/unbound/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
{{- range tuple "udp" "tcp"}}
{{- $proto := . }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ .Values.unbound.name }}
name: {{ $.Values.unbound.name }}-{{ $proto }}
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "{{.Values.unbound.port_unbound_exporter}}"
prometheus.io/targets: {{ required ".Values.alerts.prometheus missing" .Values.alerts.prometheus | quote }}
prometheus.io/port: "{{$.Values.unbound.port_unbound_exporter}}"
prometheus.io/targets: {{ required "$.Values.alerts.prometheus missing" $.Values.alerts.prometheus | quote }}
parrot.sap.cc/announce: 'true'
service.alpha.kubernetes.io/reject-traffic-on-external-ip: "false"
spec:
type: LoadBalancer
externalTrafficPolicy: Local
selector:
app: {{ .Values.unbound.name }}
app: {{ $.Values.unbound.name }}
type: dns
ports:
{{- range $.Values.unbound.externalPorts | required ".Values.unbound.externalPorts missing" }}
- name: dns-tcp-{{.}}
protocol: TCP
ports:
{{- range $.Values.unbound.externalPorts | required "$.Values.unbound.externalPorts missing" }}
- name: dns-{{ $proto }}-{{.}}
protocol: {{ $proto | upper }}
port: {{.}}
targetPort: dns-tcp-{{.}}
- name: dns-udp-{{.}}
protocol: UDP
port: {{.}}
targetPort: dns-udp-{{.}}
{{- end }}
externalIPs:
{{- required "A valid .Values.unbound.externalIPs required!" .Values.unbound.externalIPs | toYaml | nindent 2 }}
{{- required "A valid $.Values.unbound.externalIPs required!" $.Values.unbound.externalIPs | toYaml | nindent 2 }}
{{- end }}

0 comments on commit 8080b4e

Please sign in to comment.