Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bitnami/external-dns:] Follow Helm rbac best practices #2589

Merged
merged 2 commits into from
May 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bitnami/external-dns/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
name: external-dns
version: 2.24.1
version: 3.0.0
appVersion: 0.7.1
description: ExternalDNS is a Kubernetes addon that configures public DNS servers with information about exposed Kubernetes services to make them discoverable.
keywords:
Expand Down
14 changes: 11 additions & 3 deletions bitnami/external-dns/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,10 @@ The following table lists the configurable parameters of the external-dns chart
| `service.loadBalancerIP` | IP address to assign to load balancer (if supported) | `""` |
| `service.loadBalancerSourceRanges` | List of IP CIDRs allowed access to load balancer (if supported) | `[]` |
| `service.annotations` | Annotations to add to service | `{}` |
| `serviceAccount.create` | Determine whether a Service Account should be created or it should reuse a exiting one. | `true` |
| `serviceAccount.name` | ServiceAccount to use. A name is generated using the external-dns.fullname template if it is not set | `nil` |
| `serviceAccount.annotations` | Additional Service Account annotations | `{}` |
| `rbac.create` | Weather to create & use RBAC resources or not | `true` |
| `rbac.serviceAccountCreate` | Determine whether a Service Account should be created or it should reuse a exiting one. | `true` |
| `rbac.serviceAccountName` | ServiceAccount to use. A name is generated using the external-dns.fullname template if it is not set | `nil` |
| `rbac.serviceAccountAnnotations` | Additional Service Account annotations | `{}` |
| `rbac.apiVersion` | Version of the RBAC API | `v1beta1` |
| `rbac.pspEnabled` | PodSecurityPolicy | `false` |
| `resources` | CPU/Memory resource requests/limits. | `{}` |
Expand Down Expand Up @@ -262,6 +262,14 @@ $ helm install my-release \

## Upgrading

### To 3.0.0

- The parameters below are renamed:
- `rbac.serviceAccountCreate` -> `serviceAccount.create`
- `rbac.serviceAccountName` -> `serviceAccount.name`
- `rbac.serviceAccountAnnotations` -> `serviceAccount.annotation`
- It is now possible to create serviceAccount, clusterRole and clusterRoleBinding manually and give the serviceAccount to the chart.

### To 2.0.0

Backwards compatibility is not guaranteed unless you modify the labels used on the chart's deployments.
Expand Down
6 changes: 3 additions & 3 deletions bitnami/external-dns/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -578,9 +578,9 @@ external-dns: ovh.applicationSecret
Return the ExternalDNS service account name
*/}}
{{- define "external-dns.serviceAccountName" -}}
{{- if .Values.rbac.serviceAccountName -}}
{{- printf "%s" (tpl .Values.rbac.serviceAccountName . ) -}}
{{- if .Values.serviceAccount.create -}}
{{ default (include "external-dns.fullname" .) .Values.serviceAccount.name }}
{{- else -}}
{{- printf "%s" (include "external-dns.fullname" . ) -}}
{{ default "default" .Values.serviceAccount.name }}
{{- end -}}
{{- end -}}
2 changes: 0 additions & 2 deletions bitnami/external-dns/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ spec:
{{- with .Values.tolerations }}
tolerations: {{ tpl (toYaml .) $ | nindent 8 }}
{{- end }}
{{- if .Values.rbac.create }}
serviceAccountName: {{ template "external-dns.serviceAccountName" . }}
{{- end }}
{{- if .Values.priorityClassName }}
priorityClassName: {{ .Values.priorityClassName | quote }}
{{- end }}
Expand Down
6 changes: 3 additions & 3 deletions bitnami/external-dns/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{{- if and .Values.rbac.create .Values.rbac.serviceAccountCreate -}}
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ template "external-dns.serviceAccountName" . }}
labels: {{ include "external-dns.labels" . | nindent 4 }}
{{- if .Values.rbac.serviceAccountAnnotations }}
annotations: {{ toYaml .Values.rbac.serviceAccountAnnotations | nindent 4 }}
{{- if .Values.serviceAccount.annotations }}
annotations: {{ toYaml .Values.serviceAccount.annotations | nindent 4 }}
{{- end }}
{{- end }}
25 changes: 12 additions & 13 deletions bitnami/external-dns/values-production.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
image:
registry: docker.io
repository: bitnami/external-dns
tag: 0.7.1-debian-10-r54
tag: 0.7.1-debian-10-r56
## Specify a imagePullPolicy
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
Expand Down Expand Up @@ -448,24 +448,23 @@ service:
##
annotations: {}

## RBAC parameteres
## https://kubernetes.io/docs/reference/access-authn-authz/rbac/
## ServiceAccount parameters
## https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
##
rbac:
serviceAccount:
create: true
## Determine whether a Service Account should be created
## or reuse a exiting one
##
serviceAccountCreate: true

## Service Account for pods
## https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
##
serviceAccountName:

name:
## Annotations for the Service Account
##
serviceAccountAnnotations: {}
annotations: {}

## RBAC parameteres (clusterRole and clusterRoleBinding)
## https://kubernetes.io/docs/reference/access-authn-authz/rbac/
##
rbac:
create: true
## RBAC API version
##
apiVersion: v1beta1
Expand Down
25 changes: 12 additions & 13 deletions bitnami/external-dns/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
image:
registry: docker.io
repository: bitnami/external-dns
tag: 0.7.1-debian-10-r54
tag: 0.7.1-debian-10-r56
## Specify a imagePullPolicy
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
Expand Down Expand Up @@ -447,24 +447,23 @@ service:
##
annotations: {}

## RBAC parameteres
## https://kubernetes.io/docs/reference/access-authn-authz/rbac/
## ServiceAccount parameters
## https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
##
rbac:
serviceAccount:
create: true
## Determine whether a Service Account should be created
## or reuse a exiting one
##
serviceAccountCreate: true

## Service Account for pods
## https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
##
serviceAccountName:

name:
## Annotations for the Service Account
##
serviceAccountAnnotations: {}
annotations: {}

## RBAC parameteres
## https://kubernetes.io/docs/reference/access-authn-authz/rbac/
##
rbac:
create: true
## RBAC API version
##
apiVersion: v1beta1
Expand Down