-
Notifications
You must be signed in to change notification settings - Fork 139
feat(extra): add external-dns as standalone extra package #1988
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
Open
mattia-eleuteri
wants to merge
1
commit into
cozystack:main
Choose a base branch
from
mattia-eleuteri:feature/external-dns-per-tenant
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2,120
−173
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| #!/usr/bin/env bats | ||
|
|
||
| @test "Create and Verify ExternalDNS with inmemory provider" { | ||
| name='test' | ||
| kubectl apply -f - <<EOF | ||
| apiVersion: apps.cozystack.io/v1alpha1 | ||
| kind: ExternalDNS | ||
| metadata: | ||
| name: ${name} | ||
| namespace: tenant-test | ||
| spec: | ||
| provider: inmemory | ||
| domainFilters: | ||
| - example.com | ||
| EOF | ||
|
|
||
| sleep 5 | ||
| kubectl -n tenant-test wait hr ${name} --timeout=120s --for=condition=ready | ||
| timeout 60 sh -ec "until kubectl -n tenant-test get deploy -l app.kubernetes.io/name=external-dns -o jsonpath='{.items[0].status.readyReplicas}' | grep -q '1'; do sleep 5; done" | ||
|
|
||
| kubectl -n tenant-test delete externaldns.apps.cozystack.io ${name} | ||
| } | ||
|
|
||
| @test "Create and Verify ExternalDNS with custom annotationPrefix" { | ||
| name='test-prefix' | ||
| kubectl apply -f - <<EOF | ||
| apiVersion: apps.cozystack.io/v1alpha1 | ||
| kind: ExternalDNS | ||
| metadata: | ||
| name: ${name} | ||
| namespace: tenant-test | ||
| spec: | ||
| provider: inmemory | ||
| annotationPrefix: custom-dns | ||
| domainFilters: | ||
| - example.org | ||
| EOF | ||
|
|
||
| sleep 5 | ||
| kubectl -n tenant-test wait hr ${name} --timeout=120s --for=condition=ready | ||
| timeout 60 sh -ec "until kubectl -n tenant-test get deploy -l app.kubernetes.io/name=external-dns -o jsonpath='{.items[0].status.readyReplicas}' | grep -q '1'; do sleep 5; done" | ||
|
|
||
| kubectl -n tenant-test delete externaldns.apps.cozystack.io ${name} | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
packages/core/platform/sources/external-dns-application.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| --- | ||
| apiVersion: cozystack.io/v1alpha1 | ||
| kind: PackageSource | ||
| metadata: | ||
| name: cozystack.external-dns-application | ||
| spec: | ||
| sourceRef: | ||
| kind: OCIRepository | ||
| name: cozystack-packages | ||
| namespace: cozy-system | ||
| path: / | ||
| variants: | ||
| - name: default | ||
| dependsOn: | ||
| - cozystack.networking | ||
| libraries: | ||
| - name: cozy-lib | ||
| path: library/cozy-lib | ||
| components: | ||
| - name: external-dns-system | ||
| path: system/external-dns | ||
| - name: external-dns | ||
| path: extra/external-dns | ||
| libraries: ["cozy-lib"] | ||
| - name: external-dns-rd | ||
| path: system/external-dns-rd | ||
| install: | ||
| namespace: cozy-system | ||
| releaseName: external-dns-rd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| apiVersion: v2 | ||
| name: external-dns | ||
| description: External DNS for automatic DNS record management | ||
| icon: /logos/external-dns.svg | ||
| type: application | ||
| version: 0.0.0 # Placeholder, the actual version will be automatically set during the build process | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| NAME=external-dns | ||
|
|
||
| include ../../../hack/package.mk | ||
|
|
||
| generate: | ||
| cozyvalues-gen -v values.yaml -s values.schema.json -r README.md | ||
| ../../../hack/update-crd.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| # External DNS | ||
|
|
||
| ## Parameters | ||
|
|
||
| ### Common parameters | ||
|
|
||
| | Name | Description | Type | Value | | ||
| | ------------------ | ---------------------------------------------------------------------------------- | ---------- | ------------- | | ||
| | `provider` | DNS provider name. | `string` | `{}` | | ||
| | `domainFilters` | List of domains this external-dns instance can manage. | `[]string` | `[]` | | ||
| | `policy` | How DNS records are synchronized. | `string` | `upsert-only` | | ||
| | `extraArgs` | Extra arguments for external-dns. | `[]string` | `[]` | | ||
| | `gatewayAPI` | Enable Gateway API HTTPRoute as a source for DNS records. | `bool` | `false` | | ||
| | `annotationPrefix` | Custom annotation prefix for external-dns (useful for running multiple instances). | `string` | `""` | | ||
|
|
||
|
|
||
| ### Cloudflare | ||
|
|
||
| | Name | Description | Type | Value | | ||
| | ------------ | -------------------------------- | -------- | ----------------------------------------------------------- | | ||
| | `cloudflare` | Cloudflare provider credentials. | `object` | `{"apiEmail":"","apiKey":"","apiToken":"","proxied":false}` | | ||
|
|
||
|
|
||
| ### AWS | ||
|
|
||
| | Name | Description | Type | Value | | ||
| | ----- | --------------------------------- | -------- | ------------------------------------------------------------------- | | ||
| | `aws` | AWS Route53 provider credentials. | `object` | `{"accessKeyId":"","region":"","secretAccessKey":"","zoneType":""}` | | ||
|
|
||
|
|
||
| ### Azure | ||
|
|
||
| | Name | Description | Type | Value | | ||
| | ------- | ------------------------------- | -------- | ---------------------------------------------------------------------------------------------- | | ||
| | `azure` | Azure DNS provider credentials. | `object` | `{"aadClientId":"","aadClientSecret":"","resourceGroup":"","subscriptionId":"","tenantId":""}` | | ||
|
|
||
|
|
||
|
|
||
| | Name | Description | Type | Value | | ||
| | -------- | -------------------------------------- | -------- | --------------------------------------- | | ||
| | `google` | Google Cloud DNS provider credentials. | `object` | `{"project":"","serviceAccountKey":""}` | | ||
|
|
||
|
|
||
| ### DigitalOcean | ||
|
|
||
| | Name | Description | Type | Value | | ||
| | -------------- | -------------------------------------- | -------- | -------------- | | ||
| | `digitalocean` | DigitalOcean DNS provider credentials. | `object` | `{"token":""}` | | ||
|
|
||
|
|
||
| ### Linode | ||
|
|
||
| | Name | Description | Type | Value | | ||
| | -------- | -------------------------------- | -------- | -------------- | | ||
| | `linode` | Linode DNS provider credentials. | `object` | `{"token":""}` | | ||
|
|
||
|
|
||
| ### OVH | ||
|
|
||
| | Name | Description | Type | Value | | ||
| | ----- | ----------------------------- | -------- | ----------------------------------------------------------------------------- | | ||
| | `ovh` | OVH DNS provider credentials. | `object` | `{"applicationKey":"","applicationSecret":"","consumerKey":"","endpoint":""}` | | ||
|
|
||
|
|
||
| ### Exoscale | ||
|
|
||
| | Name | Description | Type | Value | | ||
| | ---------- | ---------------------------------- | -------- | ------------------------------ | | ||
| | `exoscale` | Exoscale DNS provider credentials. | `object` | `{"apiKey":"","apiSecret":""}` | | ||
|
|
||
|
|
||
| ### GoDaddy | ||
|
|
||
| | Name | Description | Type | Value | | ||
| | --------- | --------------------------------- | -------- | ------------------------------ | | ||
| | `godaddy` | GoDaddy DNS provider credentials. | `object` | `{"apiKey":"","apiSecret":""}` | | ||
|
|
||
|
|
||
| ### Resources | ||
|
|
||
| | Name | Description | Type | Value | | ||
| | ------------------ | -------------------------------------------------------------------------------------------------------- | ---------- | ------ | | ||
| | `resources` | Explicit CPU and memory configuration. When omitted, the preset defined in `resourcesPreset` is applied. | `object` | `{}` | | ||
| | `resources.cpu` | CPU available to each replica. | `quantity` | `""` | | ||
| | `resources.memory` | Memory (RAM) available to each replica. | `quantity` | `""` | | ||
| | `resourcesPreset` | Default sizing preset used when `resources` is omitted. | `string` | `nano` | | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../../../library/cozy-lib |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| { | ||
| "comments": { | ||
| "format": "##" | ||
| }, | ||
| "tags": { | ||
| "param": "@param", | ||
| "section": "@section", | ||
| "descriptionStart": "@descriptionStart", | ||
| "descriptionEnd": "@descriptionEnd", | ||
| "skip": "@skip", | ||
| "extra": "@extra" | ||
| }, | ||
| "modifiers": { | ||
| "array": "array", | ||
| "object": "object", | ||
| "string": "string", | ||
| "nullable": "nullable", | ||
| "default": "default" | ||
| }, | ||
| "regexp": { | ||
| "paramsSectionTitle": "Parameters" | ||
| } | ||
| } |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
packages/extra/external-dns/templates/check-release-name.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| {{- if ne .Release.Name .Chart.Name }} | ||
| {{- fail (printf "The name of the release MUST BE %s" .Chart.Name) }} | ||
| {{- end -}} |
23 changes: 23 additions & 0 deletions
23
packages/extra/external-dns/templates/dashboard-resourcemap.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: Role | ||
| metadata: | ||
| name: {{ .Release.Name }}-dashboard-resources | ||
| rules: | ||
| - apiGroups: | ||
| - helm.toolkit.fluxcd.io | ||
| resources: | ||
| - helmreleases | ||
| resourceNames: | ||
| - {{ .Release.Name }} | ||
| verbs: ["get", "list", "watch"] | ||
| --- | ||
| kind: RoleBinding | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| metadata: | ||
| name: {{ .Release.Name }}-dashboard-resources | ||
| subjects: | ||
| {{ include "cozy-lib.rbac.subjectsForTenantAndAccessLevel" (list "admin" .Release.Namespace) }} | ||
| roleRef: | ||
| kind: Role | ||
| name: {{ .Release.Name }}-dashboard-resources | ||
| apiGroup: rbac.authorization.k8s.io |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: cozystack/cozystack
Length of output: 3762
Create missing
README.mdfile.The
make generatestep fails because the Makefile referencesREADME.mdvia the-rflag incozyvalues-gen, but the file doesn't exist. All otherpackages/extra/*charts have this file and use the same pattern. Create an initialREADME.mdfile (even if minimal) to resolve the pipeline failure.🧰 Tools
🪛 GitHub Actions: Pre-Commit Checks
[error] 1-1: make generate failed. README: open README.md: no such file or directory
🤖 Prompt for AI Agents