Skip to content

Commit 1ac3866

Browse files
authored
Merge pull request #3764 from johngmyers/contour-cleanup
Remove flags and documentation for removed contour-ingressroute source
2 parents 92824f4 + 4a40346 commit 1ac3866

File tree

8 files changed

+14
-67
lines changed

8 files changed

+14
-67
lines changed

charts/external-dns/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ If `namespaced` is set to `true`, please ensure that `sources` my only contains
106106
| `ingress` || |
107107
| `istio-gateway` || |
108108
| `istio-virtualservice` || |
109-
| `contour-ingressroute` || |
110109
| `crd` || |
111110
| `kong-tcpingress` || |
112111
| `openshift-route` || |

charts/external-dns/templates/clusterrole.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,6 @@ rules:
4747
resources: ["httpproxies"]
4848
verbs: ["get","watch","list"]
4949
{{- end }}
50-
{{- if has "contour-ingressroute" .Values.sources }}
51-
- apiGroups: ["contour.heptio.com"]
52-
resources: ["ingressroutes"]
53-
verbs: ["get","watch","list"]
54-
{{- end }}
5550
{{- if has "crd" .Values.sources }}
5651
- apiGroups: ["externaldns.k8s.io"]
5752
resources: ["dnsendpoints"]

docs/tutorials/contour.md

Lines changed: 4 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
# Setting up External DNS with Contour
22

3-
This tutorial describes how to configure External DNS to use either the Contour `IngressRoute` or `HTTPProxy` source.
4-
The `IngressRoute` CRD is deprecated but still in-use in many clusters however it's recommended that you migrate to the `HTTPProxy` resource.
3+
This tutorial describes how to configure External DNS to use the Contour `HTTPProxy` source.
54
Using the `HTTPProxy` resource with External DNS requires Contour version 1.5 or greater.
65

76
### Example manifests for External DNS
87
#### Without RBAC
9-
Note that you don't need to enable both of the sources and if you don't enable `contour-ingressroute` you also don't need to configure the `contour-load-balancer` setting.
108

119
```yaml
1210
apiVersion: apps/v1
@@ -30,9 +28,7 @@ spec:
3028
args:
3129
- --source=service
3230
- --source=ingress
33-
- --source=contour-ingressroute # To enable IngressRoute support
34-
- --source=contour-httpproxy # To enable HTTPProxy support
35-
- --contour-load-balancer=custom-contour-namespace/custom-contour-lb # For IngressRoute ONLY: load balancer service to be used. Omit to use the default (heptio-contour/contour)
31+
- --source=contour-httpproxy
3632
- --domain-filter=external-dns-test.my-org.com # will make ExternalDNS see only the hosted zones matching provided domain, omit to process all available hosted zones
3733
- --provider=aws
3834
- --policy=upsert-only # would prevent ExternalDNS from deleting any records, omit to enable full synchronization
@@ -62,11 +58,6 @@ rules:
6258
- apiGroups: [""]
6359
resources: ["nodes"]
6460
verbs: ["list"]
65-
# This section is only for IngressRoute
66-
- apiGroups: ["contour.heptio.com"]
67-
resources: ["ingressroutes"]
68-
verbs: ["get","watch","list"]
69-
# This section is only for HTTPProxy
7061
- apiGroups: ["projectcontour.io"]
7162
resources: ["httpproxies"]
7263
verbs: ["get","watch","list"]
@@ -106,9 +97,7 @@ spec:
10697
args:
10798
- --source=service
10899
- --source=ingress
109-
- --source=contour-ingressroute # To enable IngressRoute support
110-
- --source=contour-httpproxy # To enable HTTPProxy support
111-
- --contour-load-balancer=custom-contour-namespace/custom-contour-lb # For IngressRoute ONLY: load balancer service to be used. Omit to use the default (heptio-contour/contour)
100+
- --source=contour-httpproxy
112101
- --domain-filter=external-dns-test.my-org.com # will make ExternalDNS see only the hosted zones matching provided domain, omit to process all available hosted zones
113102
- --provider=aws
114103
- --policy=upsert-only # would prevent ExternalDNS from deleting any records, omit to enable full synchronization
@@ -162,9 +151,8 @@ spec:
162151
EOF
163152
```
164153

165-
Then create either a `HTTPProxy` or an `IngressRoute`
154+
Then create an `HTTPProxy`:
166155

167-
#### HTTPProxy
168156
```
169157
$ kubectl apply -f - <<EOF
170158
apiVersion: projectcontour.io/v1
@@ -186,27 +174,6 @@ spec:
186174
EOF
187175
```
188176

189-
#### IngressRoute
190-
```
191-
$ kubectl apply -f - <<EOF
192-
apiVersion: contour.heptio.com/v1beta1
193-
kind: IngressRoute
194-
metadata:
195-
labels:
196-
app: kuard
197-
name: kuard
198-
namespace: default
199-
spec:
200-
virtualhost:
201-
fqdn: kuard.example.com
202-
routes:
203-
- match: /
204-
services:
205-
- name: kuard
206-
port: 80
207-
EOF
208-
```
209-
210177
#### Access the sample service using `curl`
211178
```bash
212179
$ curl -i http://kuard.example.com/healthy

main.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ func main() {
140140
CFAPIEndpoint: cfg.CFAPIEndpoint,
141141
CFUsername: cfg.CFUsername,
142142
CFPassword: cfg.CFPassword,
143-
ContourLoadBalancerService: cfg.ContourLoadBalancerService,
144143
GlooNamespace: cfg.GlooNamespace,
145144
SkipperRouteGroupVersion: cfg.SkipperRouteGroupVersion,
146145
RequestTimeout: cfg.RequestTimeout,

pkg/apis/externaldns/types.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ type Config struct {
4747
KubeConfig string
4848
RequestTimeout time.Duration
4949
DefaultTargets []string
50-
ContourLoadBalancerService string
5150
GlooNamespace string
5251
SkipperRouteGroupVersion string
5352
Sources []string
@@ -214,7 +213,6 @@ var defaultConfig = &Config{
214213
KubeConfig: "",
215214
RequestTimeout: time.Second * 30,
216215
DefaultTargets: []string{},
217-
ContourLoadBalancerService: "heptio-contour/contour",
218216
GlooNamespace: "gloo-system",
219217
SkipperRouteGroupVersion: "zalando.org/v1",
220218
Sources: nil,
@@ -408,17 +406,14 @@ func (cfg *Config) ParseFlags(args []string) error {
408406
app.Flag("cf-username", "The username to log into the cloud foundry API").Default(defaultConfig.CFUsername).StringVar(&cfg.CFUsername)
409407
app.Flag("cf-password", "The password to log into the cloud foundry API").Default(defaultConfig.CFPassword).StringVar(&cfg.CFPassword)
410408

411-
// Flags related to Contour
412-
app.Flag("contour-load-balancer", "The fully-qualified name of the Contour load balancer service. (default: heptio-contour/contour)").Default("heptio-contour/contour").StringVar(&cfg.ContourLoadBalancerService)
413-
414409
// Flags related to Gloo
415410
app.Flag("gloo-namespace", "Gloo namespace. (default: gloo-system)").Default("gloo-system").StringVar(&cfg.GlooNamespace)
416411

417412
// Flags related to Skipper RouteGroup
418413
app.Flag("skipper-routegroup-groupversion", "The resource version for skipper routegroup").Default(source.DefaultRoutegroupVersion).StringVar(&cfg.SkipperRouteGroupVersion)
419414

420415
// Flags related to processing source
421-
app.Flag("source", "The resource types that are queried for endpoints; specify multiple times for multiple sources (required, options: service, ingress, node, fake, connector, gateway-httproute, gateway-grpcroute, gateway-tlsroute, gateway-tcproute, gateway-udproute, istio-gateway, istio-virtualservice, cloudfoundry, contour-ingressroute, contour-httpproxy, gloo-proxy, crd, empty, skipper-routegroup, openshift-route, ambassador-host, kong-tcpingress, f5-virtualserver, traefik-proxy)").Required().PlaceHolder("source").EnumsVar(&cfg.Sources, "service", "ingress", "node", "pod", "gateway-httproute", "gateway-grpcroute", "gateway-tlsroute", "gateway-tcproute", "gateway-udproute", "istio-gateway", "istio-virtualservice", "cloudfoundry", "contour-ingressroute", "contour-httpproxy", "gloo-proxy", "fake", "connector", "crd", "empty", "skipper-routegroup", "openshift-route", "ambassador-host", "kong-tcpingress", "f5-virtualserver", "traefik-proxy")
416+
app.Flag("source", "The resource types that are queried for endpoints; specify multiple times for multiple sources (required, options: service, ingress, node, fake, connector, gateway-httproute, gateway-grpcroute, gateway-tlsroute, gateway-tcproute, gateway-udproute, istio-gateway, istio-virtualservice, cloudfoundry, contour-httpproxy, gloo-proxy, crd, empty, skipper-routegroup, openshift-route, ambassador-host, kong-tcpingress, f5-virtualserver, traefik-proxy)").Required().PlaceHolder("source").EnumsVar(&cfg.Sources, "service", "ingress", "node", "pod", "gateway-httproute", "gateway-grpcroute", "gateway-tlsroute", "gateway-tcproute", "gateway-udproute", "istio-gateway", "istio-virtualservice", "cloudfoundry", "contour-httpproxy", "gloo-proxy", "fake", "connector", "crd", "empty", "skipper-routegroup", "openshift-route", "ambassador-host", "kong-tcpingress", "f5-virtualserver", "traefik-proxy")
422417
app.Flag("openshift-router-name", "if source is openshift-route then you can pass the ingress controller name. Based on this name external-dns will select the respective router from the route status and map that routerCanonicalHostname to the route host while creating a CNAME record.").StringVar(&cfg.OCPRouterName)
423418
app.Flag("namespace", "Limit sources of endpoints to a specific namespace (default: all namespaces)").Default(defaultConfig.Namespace).StringVar(&cfg.Namespace)
424419
app.Flag("annotation-filter", "Filter sources managed by external-dns via annotation using label selector semantics (default: all sources)").Default(defaultConfig.AnnotationFilter).StringVar(&cfg.AnnotationFilter)

pkg/apis/externaldns/types_test.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ var (
3535
APIServerURL: "",
3636
KubeConfig: "",
3737
RequestTimeout: time.Second * 30,
38-
ContourLoadBalancerService: "heptio-contour/contour",
3938
GlooNamespace: "gloo-system",
4039
SkipperRouteGroupVersion: "zalando.org/v1",
4140
Sources: []string{"service"},
@@ -136,7 +135,6 @@ var (
136135
APIServerURL: "http://127.0.0.1:8080",
137136
KubeConfig: "/some/path",
138137
RequestTimeout: time.Second * 77,
139-
ContourLoadBalancerService: "heptio-contour-other/contour-other",
140138
GlooNamespace: "gloo-not-system",
141139
SkipperRouteGroupVersion: "zalando.org/v2",
142140
Sources: []string{"service", "ingress", "connector"},
@@ -267,7 +265,6 @@ func TestParseFlags(t *testing.T) {
267265
"--server=http://127.0.0.1:8080",
268266
"--kubeconfig=/some/path",
269267
"--request-timeout=77s",
270-
"--contour-load-balancer=heptio-contour-other/contour-other",
271268
"--gloo-namespace=gloo-not-system",
272269
"--skipper-routegroup-groupversion=zalando.org/v2",
273270
"--source=service",

source/store.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ type Config struct {
6767
CFAPIEndpoint string
6868
CFUsername string
6969
CFPassword string
70-
ContourLoadBalancerService string
7170
GlooNamespace string
7271
SkipperRouteGroupVersion string
7372
RequestTimeout time.Duration

source/store_test.go

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ func (suite *ByNamesTestSuite) TestAllInitialized() {
162162
}: "IngressRouteUDPList",
163163
}), nil)
164164

165-
sources, err := ByNames(context.TODO(), mockClientGenerator, []string{"service", "ingress", "istio-gateway", "contour-httpproxy", "kong-tcpingress", "f5-virtualserver", "traefik-proxy", "fake"}, minimalConfig)
165+
sources, err := ByNames(context.TODO(), mockClientGenerator, []string{"service", "ingress", "istio-gateway", "contour-httpproxy", "kong-tcpingress", "f5-virtualserver", "traefik-proxy", "fake"}, &Config{})
166166
suite.NoError(err, "should not generate errors")
167167
suite.Len(sources, 8, "should generate all eight sources")
168168
}
@@ -171,7 +171,7 @@ func (suite *ByNamesTestSuite) TestOnlyFake() {
171171
mockClientGenerator := new(MockClientGenerator)
172172
mockClientGenerator.On("KubeClient").Return(fakeKube.NewSimpleClientset(), nil)
173173

174-
sources, err := ByNames(context.TODO(), mockClientGenerator, []string{"fake"}, minimalConfig)
174+
sources, err := ByNames(context.TODO(), mockClientGenerator, []string{"fake"}, &Config{})
175175
suite.NoError(err, "should not generate errors")
176176
suite.Len(sources, 1, "should generate fake source")
177177
suite.Nil(mockClientGenerator.kubeClient, "client should not be created")
@@ -181,7 +181,7 @@ func (suite *ByNamesTestSuite) TestSourceNotFound() {
181181
mockClientGenerator := new(MockClientGenerator)
182182
mockClientGenerator.On("KubeClient").Return(fakeKube.NewSimpleClientset(), nil)
183183

184-
sources, err := ByNames(context.TODO(), mockClientGenerator, []string{"foo"}, minimalConfig)
184+
sources, err := ByNames(context.TODO(), mockClientGenerator, []string{"foo"}, &Config{})
185185
suite.Equal(err, ErrSourceNotFound, "should return source not found")
186186
suite.Len(sources, 0, "should not returns any source")
187187
}
@@ -190,16 +190,16 @@ func (suite *ByNamesTestSuite) TestKubeClientFails() {
190190
mockClientGenerator := new(MockClientGenerator)
191191
mockClientGenerator.On("KubeClient").Return(nil, errors.New("foo"))
192192

193-
_, err := ByNames(context.TODO(), mockClientGenerator, []string{"service"}, minimalConfig)
193+
_, err := ByNames(context.TODO(), mockClientGenerator, []string{"service"}, &Config{})
194194
suite.Error(err, "should return an error if kubernetes client cannot be created")
195195

196-
_, err = ByNames(context.TODO(), mockClientGenerator, []string{"ingress"}, minimalConfig)
196+
_, err = ByNames(context.TODO(), mockClientGenerator, []string{"ingress"}, &Config{})
197197
suite.Error(err, "should return an error if kubernetes client cannot be created")
198198

199-
_, err = ByNames(context.TODO(), mockClientGenerator, []string{"istio-gateway"}, minimalConfig)
199+
_, err = ByNames(context.TODO(), mockClientGenerator, []string{"istio-gateway"}, &Config{})
200200
suite.Error(err, "should return an error if kubernetes client cannot be created")
201201

202-
_, err = ByNames(context.TODO(), mockClientGenerator, []string{"kong-tcpingress"}, minimalConfig)
202+
_, err = ByNames(context.TODO(), mockClientGenerator, []string{"kong-tcpingress"}, &Config{})
203203
suite.Error(err, "should return an error if kubernetes client cannot be created")
204204
}
205205

@@ -209,17 +209,13 @@ func (suite *ByNamesTestSuite) TestIstioClientFails() {
209209
mockClientGenerator.On("IstioClient").Return(nil, errors.New("foo"))
210210
mockClientGenerator.On("DynamicKubernetesClient").Return(nil, errors.New("foo"))
211211

212-
_, err := ByNames(context.TODO(), mockClientGenerator, []string{"istio-gateway"}, minimalConfig)
212+
_, err := ByNames(context.TODO(), mockClientGenerator, []string{"istio-gateway"}, &Config{})
213213
suite.Error(err, "should return an error if istio client cannot be created")
214214

215-
_, err = ByNames(context.TODO(), mockClientGenerator, []string{"contour-httpproxy"}, minimalConfig)
215+
_, err = ByNames(context.TODO(), mockClientGenerator, []string{"contour-httpproxy"}, &Config{})
216216
suite.Error(err, "should return an error if contour client cannot be created")
217217
}
218218

219219
func TestByNames(t *testing.T) {
220220
suite.Run(t, new(ByNamesTestSuite))
221221
}
222-
223-
var minimalConfig = &Config{
224-
ContourLoadBalancerService: "heptio-contour/contour",
225-
}

0 commit comments

Comments
 (0)