diff --git a/stable/external-dns/.helmignore b/stable/external-dns/.helmignore new file mode 100644 index 0000000000..f0c1319444 --- /dev/null +++ b/stable/external-dns/.helmignore @@ -0,0 +1,21 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*~ +# Various IDEs +.project +.idea/ +*.tmproj diff --git a/stable/external-dns/Chart.yaml b/stable/external-dns/Chart.yaml new file mode 100644 index 0000000000..f9958f5e88 --- /dev/null +++ b/stable/external-dns/Chart.yaml @@ -0,0 +1,9 @@ +apiVersion: v1 +description: Configure external DNS servers (AWS Route53, Google CloudDNS and others) for Kubernetes Ingresses and Services +name: external-dns +version: 0.1.0 +appVersion: 0.4.2 +home: https://github.com/kubernetes-incubator/external-dns +sources: + - https://github.com/kubernetes-incubator/external-dns +engine: gotpl diff --git a/stable/external-dns/README.md b/stable/external-dns/README.md new file mode 100644 index 0000000000..fabde5e6af --- /dev/null +++ b/stable/external-dns/README.md @@ -0,0 +1,56 @@ +# external-dns + +## Chart Details + +This chart will do the following: + +* Create a deployment of [external-dns] within your Kubernetes Cluster. + +Currently this uses the [Zalando] hosted container, if this is a concern follow the steps in the [external-dns] documentation to compile the binary and make a container. Where the chart pulls the image from is fully configurable. + +## Notes + +You probably want to make sure the nodes have IAM permissions to modify the R53 entries. More on this later. + +## Installing the Chart + +To install the chart with the release name `my-release`: + +```bash +$ helm install --name my-release stable/external-dns +``` + +## Configuration + +The following tables lists the configurable parameters of the external-dns chart and their default values. + + +| Parameter | Description | Default | +| ---------------------- | -------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ | +| `domainFilters` | Limit possible target zones by domain suffixes (optional). | `[]` | +| `extraArgs` | Optional object of extra args, as `name`: `value` pairs. Where the name is the command line arg to external-dns. | `{}` | +| `image.name` | Container image name (Including repository name if not `hub.docker.com`). | `registry.opensource.zalan.do/teapot/external-dns` | +| `image.pullPolicy` | Container pull policy. | `IfNotPresent` | +| `image.tag` | Container image tag. | `v0.4.2` | +| `podAnnotations` | Additional annotations to apply to the pod. | `{}` | +| `policy` | Modify how DNS records are sychronized between sources and providers (options: sync, upsert-only ). | `upsert-only` | +| `provider` | The DNS provider where the DNS records will be created (options: aws, google, azure, cloudflare, digitalocean, inmemory ). | `aws` | +| `rbac.create` | If true, create & use RBAC resources | `false` | +| `rbac.serviceAccountName` | existing ServiceAccount to use (ignored if rbac.create=true) | `default` | +| `resources` | CPU/Memory resource requests/limits. | `{}` | +| `sources` | List of resource types to monitor, possible values are fake, service or ingress. | `[service, ingress]` | + + +Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. + +Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example, + +```bash +$ helm install --name my-release -f values.yaml stable/external-dns +``` + +> **Tip**: You can use the default [values.yaml](values.yaml) + +[external-dns]: https://github.com/kubernetes-incubator/external-dns +[Zalando]: https://zalando.github.io/ +[getting-started]: https://github.com/kubernetes-incubator/external-dns/blob/master/README.md#getting-started diff --git a/stable/external-dns/templates/NOTES.txt b/stable/external-dns/templates/NOTES.txt new file mode 100644 index 0000000000..8962778590 --- /dev/null +++ b/stable/external-dns/templates/NOTES.txt @@ -0,0 +1,3 @@ +To verify that external-dns has started, run: + + kubectl --namespace={{ .Release.Namespace }} get pods -l "app={{ template "name" . }},release={{ .Release.Name }}" diff --git a/stable/external-dns/templates/_helpers.tpl b/stable/external-dns/templates/_helpers.tpl new file mode 100644 index 0000000000..c3d2510bf9 --- /dev/null +++ b/stable/external-dns/templates/_helpers.tpl @@ -0,0 +1,23 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +*/}} +{{- define "external-dns.fullname" -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* Generate basic labels */}} +{{- define "external-dns.labels" }} +app: {{ template "name" . }} +heritage: {{.Release.Service }} +release: {{.Release.Name }} +{{- end }} diff --git a/stable/external-dns/templates/deployment.yaml b/stable/external-dns/templates/deployment.yaml new file mode 100644 index 0000000000..f0fa582b88 --- /dev/null +++ b/stable/external-dns/templates/deployment.yaml @@ -0,0 +1,36 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + labels: {{ include "external-dns.labels" . | indent 4 }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + name: {{ template "external-dns.fullname" . }} +spec: + template: + metadata: + labels: {{ include "external-dns.labels" . | indent 8 }} + {{- if .Values.podAnnotations }} + annotations: +{{ toYaml .Values.podAnnotations | indent 8}} + {{- end }} + spec: + containers: + - name: {{ template "name" . }} + image: "{{.Values.image.name}}:{{ .Values.image.tag }}" + imagePullPolicy: "{{ .Values.image.pullPolicy }}" + args: + - --provider={{ .Values.provider }} + - --policy={{ .Values.policy }} + {{- range .Values.domainFilters }} + - --domain-filter={{ . }} + {{- end }} + {{- range .Values.sources }} + - --source={{ . }} + {{- end }} + {{- range $key, $value := .Values.extraArgs }} + - --{{ $key }}={{ $value }} + {{- end }} + {{- if .Values.resources }} + resources: +{{ toYaml .Values.resources | indent 12 }} + {{- end }} + serviceAccountName: {{ if .Values.rbac.create }}{{ template "external-dns.fullname" . }}{{ else }}"{{ .Values.rbac.serviceAccountName }}"{{ end }} diff --git a/stable/external-dns/templates/serviceaccount.yaml b/stable/external-dns/templates/serviceaccount.yaml new file mode 100644 index 0000000000..936ed7580e --- /dev/null +++ b/stable/external-dns/templates/serviceaccount.yaml @@ -0,0 +1,8 @@ +{{- if .Values.rbac.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + labels: {{ include "external-dns.labels" . | indent 4 }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + name: {{ template "external-dns.fullname" . }} +{{- end }} diff --git a/stable/external-dns/values.yaml b/stable/external-dns/values.yaml new file mode 100644 index 0000000000..69bd641030 --- /dev/null +++ b/stable/external-dns/values.yaml @@ -0,0 +1,43 @@ +## Details about the image to be pulled. +image: + name: registry.opensource.zalan.do/teapot/external-dns + tag: v0.4.2 + pullPolicy: IfNotPresent + +## This controls which types of resource external-dns should 'watch' for new +## DNS entries. +sources: + - service + - ingress + +## The DNS provider where the DNS records will be created (options: aws, google, inmemory, azure ) +provider: aws + +## Limit possible target zones by domain suffixes (optional) +domainFilters: [] + +## Modify how DNS records are sychronized between sources and providers (options: sync, upsert-only ) +policy: upsert-only + +## Annotations to be added to pods +## +podAnnotations: {} + +extraArgs: {} + +## CPU and Memory limit and request for external-dns +resources: {} +# limits: +# memory: 50Mi +# requests: +# memory: 50Mi +# cpu: 10m + +rbac: + ## If true, create & use RBAC resources + ## + create: false + + ## Ignored if rbac.create is true + ## + serviceAccountName: default