From e406b49bd32a585ec67336403545fd7723cbace9 Mon Sep 17 00:00:00 2001 From: Martin Kremers Date: Fri, 26 Apr 2019 15:18:12 +0200 Subject: [PATCH] nginx chart: Allow annotations for the service to utilize i.e. external-dns --- bitnami/nginx/Chart.yaml | 2 +- bitnami/nginx/README.md | 1 + bitnami/nginx/templates/svc.yaml | 4 ++++ bitnami/nginx/values.yaml | 6 +++++- 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/bitnami/nginx/Chart.yaml b/bitnami/nginx/Chart.yaml index 40e01d658..227742486 100644 --- a/bitnami/nginx/Chart.yaml +++ b/bitnami/nginx/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: nginx -version: 3.0.0 +version: 3.1.0 appVersion: 1.16.0 description: Chart for the nginx server keywords: diff --git a/bitnami/nginx/README.md b/bitnami/nginx/README.md index c26e2cda7..0f5c959fb 100644 --- a/bitnami/nginx/README.md +++ b/bitnami/nginx/README.md @@ -66,6 +66,7 @@ The following tables lists the configurable parameters of the NGINX Open Source | `service.nodePorts.http` | Kubernetes http node port | `""` | | `service.externalTrafficPolicy` | Enable client source IP preservation | `Cluster` | | `service.loadBalancerIP` | LoadBalancer service IP address | `""` | +| `service.annotations` | Service annotations | `{}` | Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, diff --git a/bitnami/nginx/templates/svc.yaml b/bitnami/nginx/templates/svc.yaml index 8c7493ac6..fb6b9b613 100644 --- a/bitnami/nginx/templates/svc.yaml +++ b/bitnami/nginx/templates/svc.yaml @@ -7,6 +7,10 @@ metadata: chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" +{{- with .Values.service.annotations }} + annotations: +{{ toYaml . | indent 4 }} +{{- end }} spec: type: {{ .Values.service.type }} {{- if (or (eq .Values.service.type "LoadBalancer") (eq .Values.service.type "NodePort")) }} diff --git a/bitnami/nginx/values.yaml b/bitnami/nginx/values.yaml index 06bd77249..1025d5313 100644 --- a/bitnami/nginx/values.yaml +++ b/bitnami/nginx/values.yaml @@ -31,7 +31,11 @@ image: ## service: type: LoadBalancer - # HTTP Port + ## Provide optional annotations to the service i.e. for external-dns + # annotations: + # external-dns.alpha.kubernetes.io/hostname: yourservicename.k8s.yourcompany.com + ## + ## HTTP Port port: 80 ## ## loadBalancerIP: