Skip to content

Commit

Permalink
feat(chart): Added complex provider support
Browse files Browse the repository at this point in the history
Signed-off-by: Steve Hipwell <[email protected]>
  • Loading branch information
stevehipwell committed Dec 1, 2023
1 parent 832bcb5 commit e67a0a1
Show file tree
Hide file tree
Showing 8 changed files with 388 additions and 192 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/lint-test-chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,27 @@ jobs:
with:
fetch-depth: 0

- name: Install Helm Docs
uses: action-stars/install-tool-from-github-release@58e2dd20166c0eb19ab9ac4d0966c930a647ee69 # v0.2.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
owner: norwoodj
repository: helm-docs
arch_amd64: x86_64
os_linux: Linux
check_command: helm-docs --version
version: latest

- name: Run Helm Docs check
run: |
set -euo pipefail
helm-docs
if [[ -n "$(git status --porcelain --untracked-files=no)" ]]
then
echo "Documentation not up to date. Please run helm-docs and commit changes!" >&2
exit 1
fi
- name: Install Artifact Hub CLI
uses: action-stars/install-tool-from-github-release@58e2dd20166c0eb19ab9ac4d0966c930a647ee69 # v0.2.0
with:
Expand Down
197 changes: 115 additions & 82 deletions charts/external-dns/README.md

Large diffs are not rendered by default.

80 changes: 80 additions & 0 deletions charts/external-dns/README.md.gotmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{{ template "chart.header" . }}
{{ template "chart.deprecationWarning" . }}

{{ template "chart.badgesSection" . }}

{{ template "chart.description" . }}

{{ template "chart.homepageLine" . }}

{{ template "chart.maintainersSection" . }}

{{ template "chart.sourcesSection" . }}

## Installing the Chart

Before you can install the chart you will need to add the `external-dns` repo to [Helm](https://helm.sh/).

```shell
helm repo add external-dns https://kubernetes-sigs.github.io/external-dns/
```

After you've installed the repo you can install the chart.

```shell
helm upgrade --install {{ template "chart.name" . }} external-dns/{{ template "chart.name" . }} --version {{ template "chart.version" . }}
```

## Providers

Configuring the _ExternalDNS_ provider should be done via the `provider.name` value with provider specific configuration being set via the
`provider.<name>.<key>` values, where supported, and the `extraArgs` value. For legacy support `provider` can be set to the name of the
provider with all additional configuration being set via the `extraArgs` value.

### Providers with Specific Configuration Support

| Provider | Supported |
|------------------------|------------|
| `webhook` | ❌ |

## Namespaced Scoped Installation

external-dns supports running on a namespaced only scope, too.
If `namespaced=true` is defined, the helm chart will setup `Roles` and `RoleBindings` instead `ClusterRoles` and `ClusterRoleBindings`.

### Limited Supported

Not all sources are supported in namespaced scope, since some sources depends on cluster-wide resources.
For example: Source `node` isn't supported, since `kind: Node` has scope `Cluster`.
Sources like `istio-virtualservice` only work, if all resources like `Gateway` and `VirtualService` are present in the same
namespaces as `external-dns`.

The annotation `external-dns.alpha.kubernetes.io/endpoints-type: NodeExternalIP` is not supported.

If `namespaced` is set to `true`, please ensure that `sources` my only contains supported sources (Default: `service,ingress`).

### Support Matrix

| Source | Supported | Infos |
|------------------------|------------|------------------------|
| `ingress` | ✅ | |
| `istio-gateway` | ✅ | |
| `istio-virtualservice` | ✅ | |
| `crd` | ✅ | |
| `kong-tcpingress` | ✅ | |
| `openshift-route` | ✅ | |
| `skipper-routegroup` | ✅ | |
| `gloo-proxy` | ✅ | |
| `contour-httpproxy` | ✅ | |
| `service` | ⚠️️ | NodePort not supported |
| `node` | ❌ | |
| `pod` | ❌ | |


{{ template "chart.requirementsSection" . }}

{{ template "chart.valuesSection" . }}

----------------------------------------------

Autogenerated from chart metadata using [helm-docs](https://github.com/norwoodj/helm-docs/).
3 changes: 2 additions & 1 deletion charts/external-dns/ci/ci-values.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
provider: inmemory
provider:
name: inmemory
11 changes: 11 additions & 0 deletions charts/external-dns/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,14 @@ The image to use
{{- define "external-dns.image" -}}
{{- printf "%s:%s" .Values.image.repository (default (printf "v%s" .Chart.AppVersion) .Values.image.tag) }}
{{- end }}

{{/*
Provider name, Keeps backward compatibility on provider
*/}}
{{- define "external-dns.providerName" -}}
{{- if eq (typeOf .Values.provider) "string" }}
{{- .Values.provider }}
{{- else }}
{{- .Values.provider.name }}
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/external-dns/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ spec:
{{- range .Values.domainFilters }}
- --domain-filter={{ . }}
{{- end }}
- --provider={{ tpl .Values.provider $ }}
- --provider={{ include "external-dns.providerName" . }}
{{- range .Values.extraArgs }}
- {{ tpl . $ }}
{{- end }}
Expand Down
28 changes: 26 additions & 2 deletions charts/external-dns/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,19 @@
"type": "object",
"properties": {
"provider": {
"type": "string"
"anyOf": [
{
"type": "string"
},
{
"type": "object",
"properties": {
"name": {
"type": "string"
}
}
}
]
},
"extraArgs": {
"type": "array",
Expand All @@ -14,8 +26,20 @@
"secretConfiguration": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean"
},
"mountPath": {
"type": "string"
"type": [
"string",
"null"
]
},
"subPath": {
"type": [
"string",
"null"
]
},
"data": {
"type": "object",
Expand Down
Loading

0 comments on commit e67a0a1

Please sign in to comment.