From dfbf088fcc59e897d71371dbefcc79167c51b199 Mon Sep 17 00:00:00 2001 From: Ryan Holt Date: Thu, 7 May 2020 15:13:14 -0400 Subject: [PATCH 1/5] enable support for static load balancer ips in service Signed-off-by: Ryan Holt --- Chart.yaml | 2 +- README.md | 1 + templates/service.yaml | 3 +++ values.yaml | 1 + 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Chart.yaml b/Chart.yaml index a3ac066..5250050 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -2,4 +2,4 @@ apiVersion: v1 appVersion: "1.0" description: A Helm chart to deploy PowerDNS to Kubernetes name: pdns -version: 0.1.0 +version: 0.1.1 diff --git a/README.md b/README.md index 08f5cce..edf7e0f 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,7 @@ The command removes all the Kubernetes components associated with the chart and | `image.tag` | Image tag. | `4.1.2`| | `image.pullPolicy` | Image pull policy | `IfNotPresent` | | `service.type` | Kubernetes service type | `ClusterIP` | +| `service.loadBalancerIP` | Kubernetes static IP for service | `` | | `ingress.enabled` | Enables Ingress | `false` | | `ingress.annotations` | Ingress annotations | `{}` | | `ingress.path` | Custom path | `/` diff --git a/templates/service.yaml b/templates/service.yaml index 4210327..71f6c13 100644 --- a/templates/service.yaml +++ b/templates/service.yaml @@ -9,6 +9,9 @@ metadata: heritage: {{ .Release.Service }} spec: type: {{ .Values.service.type }} + {{- if .Values.service.loadBalancerIP }} + loadBalancerIP: {{ .Values.service.loadBalancerIP }} + {{- end }} ports: - port: 8081 targetPort: 8081 diff --git a/values.yaml b/values.yaml index adb35c5..83d08b7 100644 --- a/values.yaml +++ b/values.yaml @@ -20,6 +20,7 @@ image: service: type: ClusterIP + loadBalancerIP: ingress: enabled: true From e8d26c4937b2059d03f96387a8dc2c5205a07471 Mon Sep 17 00:00:00 2001 From: Ryan Holt Date: Sun, 17 May 2020 10:33:13 -0400 Subject: [PATCH 2/5] update apiVersion to v1 Signed-off-by: Ryan Holt --- templates/deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/deployment.yaml b/templates/deployment.yaml index 911a731..64eb86f 100644 --- a/templates/deployment.yaml +++ b/templates/deployment.yaml @@ -1,4 +1,4 @@ -apiVersion: apps/v1beta2 +apiVersion: apps/v1 kind: Deployment metadata: name: {{ template "pdns.fullname" . }} From 841506ca5090b6198c39703b8e783aa91c666ecf Mon Sep 17 00:00:00 2001 From: Ryan Holt Date: Sun, 17 May 2020 10:39:01 -0400 Subject: [PATCH 3/5] change mariadb chart to bitnami Signed-off-by: Ryan Holt --- requirements.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.yaml b/requirements.yaml index 50ce735..7903a26 100644 --- a/requirements.yaml +++ b/requirements.yaml @@ -1,5 +1,5 @@ dependencies: - name: mariadb - version: 2.1.1 - repository: https://kubernetes-charts.storage.googleapis.com/ + version: 7.4.2 + repository: https://charts.bitnami.com/bitnami condition: mariadb.enabled From cbdda43b67ecd20745f59f87859911e1c5f20d36 Mon Sep 17 00:00:00 2001 From: Ryan Holt Date: Sun, 17 May 2020 11:33:38 -0400 Subject: [PATCH 4/5] enable annotations and services for both TCP and UDP Signed-off-by: Ryan Holt --- Chart.yaml | 2 +- README.md | 1 + templates/{service.yaml => service-tcp.yaml} | 10 ++++---- templates/service-udp.yaml | 26 ++++++++++++++++++++ values.yaml | 1 + 5 files changed, 34 insertions(+), 6 deletions(-) rename templates/{service.yaml => service-tcp.yaml} (81%) create mode 100644 templates/service-udp.yaml diff --git a/Chart.yaml b/Chart.yaml index 5250050..9d38a86 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -2,4 +2,4 @@ apiVersion: v1 appVersion: "1.0" description: A Helm chart to deploy PowerDNS to Kubernetes name: pdns -version: 0.1.1 +version: 0.1.2 diff --git a/README.md b/README.md index edf7e0f..1a749f7 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,7 @@ The command removes all the Kubernetes components associated with the chart and | `image.pullPolicy` | Image pull policy | `IfNotPresent` | | `service.type` | Kubernetes service type | `ClusterIP` | | `service.loadBalancerIP` | Kubernetes static IP for service | `` | +| `service.annotations` | Kubernetes annotations for service | `` | | `ingress.enabled` | Enables Ingress | `false` | | `ingress.annotations` | Ingress annotations | `{}` | | `ingress.path` | Custom path | `/` diff --git a/templates/service.yaml b/templates/service-tcp.yaml similarity index 81% rename from templates/service.yaml rename to templates/service-tcp.yaml index 71f6c13..15d78bf 100644 --- a/templates/service.yaml +++ b/templates/service-tcp.yaml @@ -1,12 +1,16 @@ apiVersion: v1 kind: Service metadata: - name: {{ template "pdns.fullname" . }} + name: {{ template "pdns.fullname" . }}-tcp labels: app: {{ template "pdns.name" . }} chart: {{ template "pdns.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} +{{- with .Values.service.annotations }} + annotations: +{{ toYaml . | indent 4 }} +{{- end }} spec: type: {{ .Values.service.type }} {{- if .Values.service.loadBalancerIP }} @@ -17,10 +21,6 @@ spec: targetPort: 8081 protocol: TCP name: api - - port: 53 - targetPort: 53 - protocol: UDP - name: dns-udp - port: 53 targetPort: 53 protocol: TCP diff --git a/templates/service-udp.yaml b/templates/service-udp.yaml new file mode 100644 index 0000000..b32a4d1 --- /dev/null +++ b/templates/service-udp.yaml @@ -0,0 +1,26 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ template "pdns.fullname" . }}-udp + labels: + app: {{ template "pdns.name" . }} + chart: {{ template "pdns.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +{{- with .Values.service.annotations }} + annotations: +{{ toYaml . | indent 4 }} +{{- end }} +spec: + type: {{ .Values.service.type }} + {{- if .Values.service.loadBalancerIP }} + loadBalancerIP: {{ .Values.service.loadBalancerIP }} + {{- end }} + ports: + - port: 53 + targetPort: 53 + protocol: UDP + name: dns-udp + selector: + app: {{ template "pdns.name" . }} + release: {{ .Release.Name }} diff --git a/values.yaml b/values.yaml index 83d08b7..8e3fd03 100644 --- a/values.yaml +++ b/values.yaml @@ -21,6 +21,7 @@ image: service: type: ClusterIP loadBalancerIP: + annotations: ingress: enabled: true From 1a412503df4ce5ec3ce954cc7ac718ecd4b1f9d6 Mon Sep 17 00:00:00 2001 From: Ryan Holt Date: Sun, 17 May 2020 11:36:27 -0400 Subject: [PATCH 5/5] fix ingress to look at correct service Signed-off-by: Ryan Holt --- templates/ingress.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/ingress.yaml b/templates/ingress.yaml index 6928573..d3e3b73 100644 --- a/templates/ingress.yaml +++ b/templates/ingress.yaml @@ -32,7 +32,7 @@ spec: paths: - path: {{ $ingressPath }} backend: - serviceName: {{ $fullName }} + serviceName: {{ $fullName }}-tcp servicePort: api {{- end }} {{- end }}