Skip to content

Commit fcf46e7

Browse files
authored
Replace Bitnami Usage (#42)
* replaced bitnami usage * debugging * fixing tests * Update metadata and DNS record versions in test
1 parent b86a2be commit fcf46e7

File tree

10 files changed

+70
-71
lines changed

10 files changed

+70
-71
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.yaml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ name: "aws-eks-external-dns"
33
github_repo: "cloudposse-terraform-components/aws-eks-external-dns"
44
# Short description of this project
55
description: |-
6-
This component creates a Helm deployment for [external-dns](https://github.com/bitnami/bitnami-docker-external-dns) on a
7-
Kubernetes cluster. [external-dns](https://github.com/bitnami/bitnami-docker-external-dns) is a Kubernetes addon that
6+
This component creates a Helm deployment for [external-dns](https://github.com/kubernetes-sigs/external-dns) on a
7+
Kubernetes cluster. [external-dns](https://github.com/kubernetes-sigs/external-dns) is a Kubernetes addon that
88
configures public DNS servers with information about exposed Kubernetes services to make them discoverable.
99
1010
usage: |-
@@ -28,8 +28,8 @@ usage: |-
2828
enabled: true
2929
name: external-dns
3030
chart: external-dns
31-
chart_repository: https://charts.bitnami.com/bitnami
32-
chart_version: "6.33.0"
31+
chart_repository: https://kubernetes-sigs.github.io/external-dns/
32+
chart_version: "1.18.0"
3333
create_namespace: true
3434
kubernetes_namespace: external-dns
3535
resources:
@@ -43,13 +43,15 @@ usage: |-
4343
# For example, when using blue-green deployment pattern to update EKS cluster.
4444
txt_prefix: ""
4545
# You can use `chart_values` to set any other chart options. Treat `chart_values` as the root of the doc.
46-
# See documentation for latest chart version and list of chart_values: https://artifacthub.io/packages/helm/bitnami/external-dns
46+
# See documentation for latest chart version and list of chart_values: https://artifacthub.io/packages/helm/external-dns/external-dns
4747
#
4848
# # For example
4949
# ---
5050
# chart_values:
51-
# aws:
52-
# batchChangeSize: 1000
51+
# provider:
52+
# name: aws
53+
# extraArgs:
54+
# - --aws-batch-change-size=1000
5355
chart_values: {}
5456
# Extra hosted zones to lookup and support by component name
5557
dns_components:
@@ -65,11 +67,11 @@ usage: |-
6567
6668
references:
6769
- name: external-dns (Artifact Hub)
68-
url: https://artifacthub.io/packages/helm/bitnami/external-dns
69-
description: Helm chart for ExternalDNS by Bitnami
70-
- name: ExternalDNS (Bitnami Docker)
71-
url: https://github.com/bitnami/bitnami-docker-external-dns
72-
description: ExternalDNS addon container image and docs by Bitnami
70+
url: https://artifacthub.io/packages/helm/external-dns/external-dns
71+
description: Helm chart for ExternalDNS by Kubernetes SIGs
72+
- name: ExternalDNS (GitHub)
73+
url: https://github.com/kubernetes-sigs/external-dns
74+
description: ExternalDNS addon source code and documentation
7375
tags:
7476
- component/eks/external-dns
7577
- layer/eks

src/README.md

Lines changed: 12 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.tf

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ data "aws_partition" "current" {
2424
}
2525

2626
module "external_dns" {
27+
count = local.enabled ? 1 : 0
2728
source = "cloudposse/helm-release/aws"
2829
version = "0.10.1"
2930

@@ -57,7 +58,7 @@ module "external_dns" {
5758
]
5859

5960
effect = "Allow"
60-
resources = formatlist("arn:${join("", data.aws_partition.current.*.partition)}:route53:::hostedzone/%s", local.zone_ids)
61+
resources = formatlist("arn:${data.aws_partition.current[0].partition}:route53:::hostedzone/%s", local.zone_ids)
6162
},
6263
{
6364
sid = "GrantListHostedZonesListResourceRecordSets"
@@ -96,15 +97,14 @@ module "external_dns" {
9697
}) : "",
9798
# external-dns-specific values
9899
yamlencode({
99-
aws = {
100-
region = var.region
100+
provider = {
101+
name = "aws"
101102
}
102-
policy = var.policy
103-
publishInternalServices = var.publish_internal_services
104-
txtOwnerId = local.txt_owner
105-
txtPrefix = local.txt_prefix
106-
sources = local.sources
107-
domainFilters = local.zone_names
103+
policy = var.policy
104+
txtOwnerId = local.txt_owner
105+
txtPrefix = local.txt_prefix
106+
sources = local.sources
107+
domainFilters = local.zone_names
108108
}),
109109
# hardcoded values
110110
file("${path.module}/resources/values.yaml"),

src/outputs.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
output "metadata" {
2-
value = module.external_dns.metadata
2+
value = local.enabled ? module.external_dns[0].metadata : null
33
description = "Block status of the deployed release"
44
}

src/resources/values.yaml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
aws:
2-
evaluateTargetHealth: false
3-
rbac:
4-
## Service Account for pods
5-
## https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
6-
## RBAC API version
7-
apiVersion: v1
8-
## Podsecuritypolicy
9-
pspEnabled: false
10-
provider: aws
1+
# AWS provider configuration for external-dns
2+
# The official external-dns chart uses provider.name instead of the provider field
3+
# AWS-specific settings are configured via extraArgs
4+
extraArgs:
5+
# Add AWS-specific arguments here if needed
6+
# Example: --aws-batch-change-size=1000

src/variables.tf

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,7 @@ variable "dns_components" {
142142
default = []
143143
}
144144

145-
variable "publish_internal_services" {
146-
type = bool
147-
description = "Allow external-dns to publish DNS records for ClusterIP services"
148-
default = true
149-
}
145+
150146

151147
variable "policy" {
152148
type = string

test/component_test.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,23 @@ package test
22

33
import (
44
"context"
5-
"testing"
65
"fmt"
76
"strings"
7+
"testing"
88
"time"
9+
910
"github.com/cloudposse/test-helpers/pkg/atmos"
10-
"github.com/cloudposse/test-helpers/pkg/helm"
11-
awsHelper "github.com/cloudposse/test-helpers/pkg/aws"
1211
helper "github.com/cloudposse/test-helpers/pkg/atmos/component-helper"
12+
awsHelper "github.com/cloudposse/test-helpers/pkg/aws"
13+
"github.com/cloudposse/test-helpers/pkg/helm"
1314
awsTerratest "github.com/gruntwork-io/terratest/modules/aws"
1415
"github.com/gruntwork-io/terratest/modules/random"
1516

1617
"github.com/stretchr/testify/assert"
1718

1819
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
19-
"k8s.io/apimachinery/pkg/runtime/schema"
2020
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
21+
"k8s.io/apimachinery/pkg/runtime/schema"
2122

2223
"k8s.io/client-go/dynamic"
2324
)
@@ -65,15 +66,14 @@ func (s *ComponentSuite) TestBasic() {
6566

6667
metadata := metadataArray[0]
6768

68-
assert.Equal(s.T(), metadata.AppVersion, "0.14.0")
69+
assert.Equal(s.T(), metadata.AppVersion, "0.18.0")
6970
assert.Equal(s.T(), metadata.Chart, "external-dns")
7071
assert.NotNil(s.T(), metadata.FirstDeployed)
7172
assert.NotNil(s.T(), metadata.LastDeployed)
7273
assert.Equal(s.T(), metadata.Name, "external-dns")
7374
assert.Equal(s.T(), metadata.Namespace, namespace)
7475
assert.NotNil(s.T(), metadata.Values)
75-
assert.Equal(s.T(), metadata.Version, "6.33.0")
76-
76+
assert.Equal(s.T(), metadata.Version, "1.18.0")
7777

7878
config, err := awsHelper.NewK8SClientConfig(cluster)
7979
assert.NoError(s.T(), err)
@@ -97,13 +97,13 @@ func (s *ComponentSuite) TestBasic() {
9797
"apiVersion": "externaldns.k8s.io/v1alpha1",
9898
"kind": "DNSEndpoint",
9999
"metadata": map[string]interface{}{
100-
"name": dnsEndpointName,
100+
"name": dnsEndpointName,
101101
"namespace": namespace,
102102
},
103103
"spec": map[string]interface{}{
104104
"endpoints": []interface{}{
105105
map[string]interface{}{
106-
"dnsName": dnsRecordHostName,
106+
"dnsName": dnsRecordHostName,
107107
"recordTTL": 300,
108108
"recordType": "A",
109109
"targets": []interface{}{

test/fixtures/stacks/catalog/usecase/basic.yaml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ components:
1010
dns_gbl_primary_environment_name: ue2
1111
name: external-dns
1212
chart: external-dns
13-
chart_repository: https://charts.bitnami.com/bitnami
14-
chart_version: "6.33.0"
13+
chart_repository: https://kubernetes-sigs.github.io/external-dns/
14+
chart_version: "1.18.0"
1515
create_namespace: true
1616
kubernetes_namespace: external-dns
1717
resources:
@@ -25,16 +25,18 @@ components:
2525
# For example, when using blue-green deployment pattern to update EKS cluster.
2626
txt_prefix: ""
2727
# You can use `chart_values` to set any other chart options. Treat `chart_values` as the root of the doc.
28-
# See documentation for latest chart version and list of chart_values: https://artifacthub.io/packages/helm/bitnami/external-dns
28+
# See documentation for latest chart version and list of chart_values: https://artifacthub.io/packages/helm/external-dns/external-dns
2929
#
3030
# # For example
3131
# ---
3232
# chart_values:
33-
# aws:
34-
# batchChangeSize: 1000
33+
# provider:
34+
# name: aws
35+
# extraArgs:
36+
# - --aws-batch-change-size=1000
3537
chart_values:
36-
crd:
37-
create: true
38+
provider:
39+
name: aws
3840
sources:
3941
- crd
4042
- service

test/fixtures/stacks/catalog/usecase/disabled.yaml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ components:
1010
dns_gbl_primary_environment_name: ue2
1111
name: external-dns
1212
chart: external-dns
13-
chart_repository: https://charts.bitnami.com/bitnami
14-
chart_version: "6.33.0"
13+
chart_repository: https://kubernetes-sigs.github.io/external-dns/
14+
chart_version: "1.18.0"
1515
create_namespace: true
1616
kubernetes_namespace: external-dns
1717
resources:
@@ -25,13 +25,15 @@ components:
2525
# For example, when using blue-green deployment pattern to update EKS cluster.
2626
txt_prefix: ""
2727
# You can use `chart_values` to set any other chart options. Treat `chart_values` as the root of the doc.
28-
# See documentation for latest chart version and list of chart_values: https://artifacthub.io/packages/helm/bitnami/external-dns
28+
# See documentation for latest chart version and list of chart_values: https://artifacthub.io/packages/helm/external-dns/external-dns
2929
#
3030
# # For example
3131
# ---
3232
# chart_values:
33-
# aws:
34-
# batchChangeSize: 1000
33+
# provider:
34+
# name: aws
35+
# extraArgs:
36+
# - --aws-batch-change-size=1000
3537
chart_values: {}
3638
# Extra hosted zones to lookup and support by component name
37-
dns_components: []
39+
dns_components: []

0 commit comments

Comments
 (0)