Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

Commit

Permalink
Update Ingress manifests for Dex and Gangway
Browse files Browse the repository at this point in the history
Since `ingress_hosts` from contour configuration is removed, now we have
added a new annotation for external-dns to pickup and add it
automatically to DNS entries.

external-dns default source is changes to `ingress`.

Signed-off-by: knrt10 <kautilya@kinvolk.io>
  • Loading branch information
knrt10 committed Jun 22, 2020
1 parent d1a0ce4 commit 00a5066
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
4 changes: 2 additions & 2 deletions docs/configuration-reference/components/external-dns.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ component "external-dns" {
}
# Optional arguments.
sources = ["service"]
sources = ["ingress"]
namespace = "external-dns"
policy = "upsert-only"
metrics = false
Expand All @@ -58,7 +58,7 @@ Example:

| Argument | Description | Default | Required |
|-----------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------|:--------------:|:--------:|
| `sources` | Kubernetes resources type to be observed for new DNS entries by ExternalDNS. | ["service"] | false |
| `sources` | Kubernetes resources type to be observed for new DNS entries by ExternalDNS. | ["ingress"] | false |
| `namespace` | Namespace to install ExternalDNS. | "external-dns" | false |
| `policy` | Modify how DNS records are sychronized between sources and providers (options: sync, upsert-only). | "upsert-only" | false |
| `metrics` | Enable metrics collection by Prometheus. Needs [Prometheus Operator component](prometheus-operator.md) installed. | false | false |
Expand Down
1 change: 1 addition & 0 deletions pkg/components/dex/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ metadata:
cert-manager.io/cluster-issuer: {{ .CertManagerClusterIssuer }}
meta.helm.sh/release-name: dex
meta.helm.sh/release-namespace: dex
external-dns.alpha.kubernetes.io/hostname: {{ .IngressHost }}
spec:
tls:
- hosts:
Expand Down
2 changes: 1 addition & 1 deletion pkg/components/external-dns/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ type component struct {
func newComponent() *component {
return &component{
Namespace: "external-dns",
Sources: []string{"service"},
Sources: []string{"ingress"},
AwsConfig: AwsConfig{
ZoneType: "public",
},
Expand Down
13 changes: 7 additions & 6 deletions pkg/components/external-dns/component_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ func TestDefaultValues(t *testing.T) {
if c.Metrics {
t.Fatal("Default Metrics value should be false.")
}
if len(c.Sources) != 1 || c.Sources[0] != "service" {
t.Fatal("Default sources should be service only.")

if len(c.Sources) != 1 || c.Sources[0] != "ingress" {
t.Fatal("Default sources should be ingress only.")
}
if c.Policy != "upsert-only" {
t.Fatal("Default policy should be upsert-only.")
Expand All @@ -66,7 +67,7 @@ func TestAwsConfigWithoutProvidingCredentials(t *testing.T) {
c := newComponent()
config := `
component "external-dns" {
sources = ["service"]
sources = ["ingress"]
metrics = false
policy = "upsert-only"
owner_id = "test-owner"
Expand Down Expand Up @@ -96,7 +97,7 @@ func TestAwsConfigBySettingEnvVariables(t *testing.T) {
c := newComponent()
config := `
component "external-dns" {
sources = ["service"]
sources = ["ingress"]
metrics = false
policy = "upsert-only"
owner_id = "test-owner"
Expand Down Expand Up @@ -133,7 +134,7 @@ func TestAwsConfigBySettingEmptyEnvVariables(t *testing.T) {
c := newComponent()
config := `
component "external-dns" {
sources = ["service"]
sources = ["ingress"]
metrics = false
policy = "upsert-only"
owner_id = "test-owner"
Expand Down Expand Up @@ -169,7 +170,7 @@ func TestAwsConfigBySettingConfigFields(t *testing.T) {
c := newComponent()
config := `
component "external-dns" {
sources = ["service"]
sources = ["ingress"]
metrics = false
policy = "upsert-only"
owner_id = "test-owner"
Expand Down
1 change: 1 addition & 0 deletions pkg/components/gangway/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ metadata:
kubernetes.io/ingress.class: contour
meta.helm.sh/release-name: gangway
meta.helm.sh/release-namespace: gangway
external-dns.alpha.kubernetes.io/hostname: {{ .IngressHost }}
spec:
tls:
- secretName: gangway
Expand Down

0 comments on commit 00a5066

Please sign in to comment.