From d47961e83a5b7f7c1363bb3f352efbe89a0e6ff2 Mon Sep 17 00:00:00 2001 From: Bradon Kanyid Date: Fri, 17 May 2024 01:05:14 -0700 Subject: [PATCH] `service.dnsService` also exposes DNS port of the kubernetes Service (#120) --- charts/localstack/README.md | 6 ++++-- charts/localstack/templates/service.yaml | 10 ++++++++++ charts/localstack/values.yaml | 4 ++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/charts/localstack/README.md b/charts/localstack/README.md index e2dcbf6..529780c 100644 --- a/charts/localstack/README.md +++ b/charts/localstack/README.md @@ -144,14 +144,16 @@ The following table lists the configurable parameters of the Localstack chart an |------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------| | `service.type` | Kubernetes Service type | `NodePort` | | `service.edgeService.targetPort` | Port number for Localstack edge service | `4566` | -| `service.externalServicePorts.start` | Start of the external service port range (included). service | `4510` | +| `service.externalServicePorts.start` | Start of the external service port range (included). service | `4510` | | `service.externalServicePorts.end` | End of the external service port range (excluded). service | `4560` | | `service.loadBalancerIP` | loadBalancerIP if Localstack service type is `LoadBalancer` | `nil` | +| `service.dnsService` | Expose the Service and Deployment's DNS port for TCP and UDP DNS traffic | `""` | +| `service.clusterIP` | Set a static clusterIP for the service. Useful for DNS delegation to the Localstack Service | `""` | | `ingress.enabled` | Enable the use of the ingress controller to access Localstack service | `false` | | `ingress.annotations` | Annotations for the Localstack Ingress | `{}` | | `ingress.hosts[0].host` | Hostname to your Localstack Ingress | `nil` | | `ingress.hosts[0].paths` | Path within the url structure | `[]` | -| `ingress.tls` | Exsisting TLS certificates for ingress | `[]` | +| `ingress.tls` | Existing TLS certificates for ingress | `[]` | ### Persistence Parameters diff --git a/charts/localstack/templates/service.yaml b/charts/localstack/templates/service.yaml index 9edd18b..52c2d3a 100644 --- a/charts/localstack/templates/service.yaml +++ b/charts/localstack/templates/service.yaml @@ -37,6 +37,16 @@ spec: {{- if and (or (eq $.Values.service.type "NodePort") (eq $.Values.service.type "LoadBalancer")) (not (empty .Values.service.edgeService.nodePort)) }} nodePort: {{ .Values.service.edgeService.nodePort }} {{- end }} + {{- if .Values.service.dnsService }} + - name: dns-tcp + port: 53 + containerPort: 53 + protocol: TCP + - name: dns-udp + port: 53 + containerPort: 53 + protocol: UDP + {{- end }} {{- range untilStep (.Values.service.externalServicePorts.start|int) (.Values.service.externalServicePorts.end|int) 1 }} - name: "external-service-port-{{ . }}" port: {{ . }} diff --git a/charts/localstack/values.yaml b/charts/localstack/values.yaml index 2720776..a06abc6 100644 --- a/charts/localstack/values.yaml +++ b/charts/localstack/values.yaml @@ -126,6 +126,10 @@ service: ## @param service.dnsService Enables or disables the exposure of the LocalStack DNS ## dnsService: false + ## @param service.clusterIP sets a static clusterIP. This is useful alongside the LocalStack DNS setup + ## see https://kubernetes.io/docs/tasks/administer-cluster/dns-custom-nameservers/#configuration-of-stub-domain-and-upstream-nameserver-using-coredns for an example of DNS delegation in Coredns + ## + clusterIP: "" ingress: enabled: false