Remove flags and documentation for removed contour-ingressroute source

This commit is contained in:
John Gardiner Myers 2023-07-04 12:09:05 -07:00
parent 92824f4f9b
commit 4a40346d42
8 changed files with 14 additions and 67 deletions

View File

@ -106,7 +106,6 @@ If `namespaced` is set to `true`, please ensure that `sources` my only contains
| `ingress` | ✅ | | | `ingress` | ✅ | |
| `istio-gateway` | ✅ | | | `istio-gateway` | ✅ | |
| `istio-virtualservice` | ✅ | | | `istio-virtualservice` | ✅ | |
| `contour-ingressroute` | ✅ | |
| `crd` | ✅ | | | `crd` | ✅ | |
| `kong-tcpingress` | ✅ | | | `kong-tcpingress` | ✅ | |
| `openshift-route` | ✅ | | | `openshift-route` | ✅ | |

View File

@ -47,11 +47,6 @@ rules:
resources: ["httpproxies"] resources: ["httpproxies"]
verbs: ["get","watch","list"] verbs: ["get","watch","list"]
{{- end }} {{- end }}
{{- if has "contour-ingressroute" .Values.sources }}
- apiGroups: ["contour.heptio.com"]
resources: ["ingressroutes"]
verbs: ["get","watch","list"]
{{- end }}
{{- if has "crd" .Values.sources }} {{- if has "crd" .Values.sources }}
- apiGroups: ["externaldns.k8s.io"] - apiGroups: ["externaldns.k8s.io"]
resources: ["dnsendpoints"] resources: ["dnsendpoints"]

View File

@ -1,12 +1,10 @@
# Setting up External DNS with Contour # Setting up External DNS with Contour
This tutorial describes how to configure External DNS to use either the Contour `IngressRoute` or `HTTPProxy` source. This tutorial describes how to configure External DNS to use the Contour `HTTPProxy` source.
The `IngressRoute` CRD is deprecated but still in-use in many clusters however it's recommended that you migrate to the `HTTPProxy` resource.
Using the `HTTPProxy` resource with External DNS requires Contour version 1.5 or greater. Using the `HTTPProxy` resource with External DNS requires Contour version 1.5 or greater.
### Example manifests for External DNS ### Example manifests for External DNS
#### Without RBAC #### Without RBAC
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.
```yaml ```yaml
apiVersion: apps/v1 apiVersion: apps/v1
@ -30,9 +28,7 @@ spec:
args: args:
- --source=service - --source=service
- --source=ingress - --source=ingress
- --source=contour-ingressroute # To enable IngressRoute support - --source=contour-httpproxy
- --source=contour-httpproxy # To enable HTTPProxy support
- --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)
- --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 - --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
- --provider=aws - --provider=aws
- --policy=upsert-only # would prevent ExternalDNS from deleting any records, omit to enable full synchronization - --policy=upsert-only # would prevent ExternalDNS from deleting any records, omit to enable full synchronization
@ -62,11 +58,6 @@ rules:
- apiGroups: [""] - apiGroups: [""]
resources: ["nodes"] resources: ["nodes"]
verbs: ["list"] verbs: ["list"]
# This section is only for IngressRoute
- apiGroups: ["contour.heptio.com"]
resources: ["ingressroutes"]
verbs: ["get","watch","list"]
# This section is only for HTTPProxy
- apiGroups: ["projectcontour.io"] - apiGroups: ["projectcontour.io"]
resources: ["httpproxies"] resources: ["httpproxies"]
verbs: ["get","watch","list"] verbs: ["get","watch","list"]
@ -106,9 +97,7 @@ spec:
args: args:
- --source=service - --source=service
- --source=ingress - --source=ingress
- --source=contour-ingressroute # To enable IngressRoute support - --source=contour-httpproxy
- --source=contour-httpproxy # To enable HTTPProxy support
- --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)
- --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 - --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
- --provider=aws - --provider=aws
- --policy=upsert-only # would prevent ExternalDNS from deleting any records, omit to enable full synchronization - --policy=upsert-only # would prevent ExternalDNS from deleting any records, omit to enable full synchronization
@ -162,9 +151,8 @@ spec:
EOF EOF
``` ```
Then create either a `HTTPProxy` or an `IngressRoute` Then create an `HTTPProxy`:
#### HTTPProxy
``` ```
$ kubectl apply -f - <<EOF $ kubectl apply -f - <<EOF
apiVersion: projectcontour.io/v1 apiVersion: projectcontour.io/v1
@ -186,27 +174,6 @@ spec:
EOF EOF
``` ```
#### IngressRoute
```
$ kubectl apply -f - <<EOF
apiVersion: contour.heptio.com/v1beta1
kind: IngressRoute
metadata:
labels:
app: kuard
name: kuard
namespace: default
spec:
virtualhost:
fqdn: kuard.example.com
routes:
- match: /
services:
- name: kuard
port: 80
EOF
```
#### Access the sample service using `curl` #### Access the sample service using `curl`
```bash ```bash
$ curl -i http://kuard.example.com/healthy $ curl -i http://kuard.example.com/healthy

View File

@ -140,7 +140,6 @@ func main() {
CFAPIEndpoint: cfg.CFAPIEndpoint, CFAPIEndpoint: cfg.CFAPIEndpoint,
CFUsername: cfg.CFUsername, CFUsername: cfg.CFUsername,
CFPassword: cfg.CFPassword, CFPassword: cfg.CFPassword,
ContourLoadBalancerService: cfg.ContourLoadBalancerService,
GlooNamespace: cfg.GlooNamespace, GlooNamespace: cfg.GlooNamespace,
SkipperRouteGroupVersion: cfg.SkipperRouteGroupVersion, SkipperRouteGroupVersion: cfg.SkipperRouteGroupVersion,
RequestTimeout: cfg.RequestTimeout, RequestTimeout: cfg.RequestTimeout,

View File

@ -47,7 +47,6 @@ type Config struct {
KubeConfig string KubeConfig string
RequestTimeout time.Duration RequestTimeout time.Duration
DefaultTargets []string DefaultTargets []string
ContourLoadBalancerService string
GlooNamespace string GlooNamespace string
SkipperRouteGroupVersion string SkipperRouteGroupVersion string
Sources []string Sources []string
@ -214,7 +213,6 @@ var defaultConfig = &Config{
KubeConfig: "", KubeConfig: "",
RequestTimeout: time.Second * 30, RequestTimeout: time.Second * 30,
DefaultTargets: []string{}, DefaultTargets: []string{},
ContourLoadBalancerService: "heptio-contour/contour",
GlooNamespace: "gloo-system", GlooNamespace: "gloo-system",
SkipperRouteGroupVersion: "zalando.org/v1", SkipperRouteGroupVersion: "zalando.org/v1",
Sources: nil, Sources: nil,
@ -408,9 +406,6 @@ func (cfg *Config) ParseFlags(args []string) error {
app.Flag("cf-username", "The username to log into the cloud foundry API").Default(defaultConfig.CFUsername).StringVar(&cfg.CFUsername) app.Flag("cf-username", "The username to log into the cloud foundry API").Default(defaultConfig.CFUsername).StringVar(&cfg.CFUsername)
app.Flag("cf-password", "The password to log into the cloud foundry API").Default(defaultConfig.CFPassword).StringVar(&cfg.CFPassword) app.Flag("cf-password", "The password to log into the cloud foundry API").Default(defaultConfig.CFPassword).StringVar(&cfg.CFPassword)
// Flags related to Contour
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)
// Flags related to Gloo // Flags related to Gloo
app.Flag("gloo-namespace", "Gloo namespace. (default: gloo-system)").Default("gloo-system").StringVar(&cfg.GlooNamespace) app.Flag("gloo-namespace", "Gloo namespace. (default: gloo-system)").Default("gloo-system").StringVar(&cfg.GlooNamespace)
@ -418,7 +413,7 @@ func (cfg *Config) ParseFlags(args []string) error {
app.Flag("skipper-routegroup-groupversion", "The resource version for skipper routegroup").Default(source.DefaultRoutegroupVersion).StringVar(&cfg.SkipperRouteGroupVersion) app.Flag("skipper-routegroup-groupversion", "The resource version for skipper routegroup").Default(source.DefaultRoutegroupVersion).StringVar(&cfg.SkipperRouteGroupVersion)
// Flags related to processing source // Flags related to processing source
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") 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")
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) 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)
app.Flag("namespace", "Limit sources of endpoints to a specific namespace (default: all namespaces)").Default(defaultConfig.Namespace).StringVar(&cfg.Namespace) app.Flag("namespace", "Limit sources of endpoints to a specific namespace (default: all namespaces)").Default(defaultConfig.Namespace).StringVar(&cfg.Namespace)
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) 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)

View File

@ -35,7 +35,6 @@ var (
APIServerURL: "", APIServerURL: "",
KubeConfig: "", KubeConfig: "",
RequestTimeout: time.Second * 30, RequestTimeout: time.Second * 30,
ContourLoadBalancerService: "heptio-contour/contour",
GlooNamespace: "gloo-system", GlooNamespace: "gloo-system",
SkipperRouteGroupVersion: "zalando.org/v1", SkipperRouteGroupVersion: "zalando.org/v1",
Sources: []string{"service"}, Sources: []string{"service"},
@ -136,7 +135,6 @@ var (
APIServerURL: "http://127.0.0.1:8080", APIServerURL: "http://127.0.0.1:8080",
KubeConfig: "/some/path", KubeConfig: "/some/path",
RequestTimeout: time.Second * 77, RequestTimeout: time.Second * 77,
ContourLoadBalancerService: "heptio-contour-other/contour-other",
GlooNamespace: "gloo-not-system", GlooNamespace: "gloo-not-system",
SkipperRouteGroupVersion: "zalando.org/v2", SkipperRouteGroupVersion: "zalando.org/v2",
Sources: []string{"service", "ingress", "connector"}, Sources: []string{"service", "ingress", "connector"},
@ -267,7 +265,6 @@ func TestParseFlags(t *testing.T) {
"--server=http://127.0.0.1:8080", "--server=http://127.0.0.1:8080",
"--kubeconfig=/some/path", "--kubeconfig=/some/path",
"--request-timeout=77s", "--request-timeout=77s",
"--contour-load-balancer=heptio-contour-other/contour-other",
"--gloo-namespace=gloo-not-system", "--gloo-namespace=gloo-not-system",
"--skipper-routegroup-groupversion=zalando.org/v2", "--skipper-routegroup-groupversion=zalando.org/v2",
"--source=service", "--source=service",

View File

@ -67,7 +67,6 @@ type Config struct {
CFAPIEndpoint string CFAPIEndpoint string
CFUsername string CFUsername string
CFPassword string CFPassword string
ContourLoadBalancerService string
GlooNamespace string GlooNamespace string
SkipperRouteGroupVersion string SkipperRouteGroupVersion string
RequestTimeout time.Duration RequestTimeout time.Duration

View File

@ -162,7 +162,7 @@ func (suite *ByNamesTestSuite) TestAllInitialized() {
}: "IngressRouteUDPList", }: "IngressRouteUDPList",
}), nil) }), nil)
sources, err := ByNames(context.TODO(), mockClientGenerator, []string{"service", "ingress", "istio-gateway", "contour-httpproxy", "kong-tcpingress", "f5-virtualserver", "traefik-proxy", "fake"}, minimalConfig) sources, err := ByNames(context.TODO(), mockClientGenerator, []string{"service", "ingress", "istio-gateway", "contour-httpproxy", "kong-tcpingress", "f5-virtualserver", "traefik-proxy", "fake"}, &Config{})
suite.NoError(err, "should not generate errors") suite.NoError(err, "should not generate errors")
suite.Len(sources, 8, "should generate all eight sources") suite.Len(sources, 8, "should generate all eight sources")
} }
@ -171,7 +171,7 @@ func (suite *ByNamesTestSuite) TestOnlyFake() {
mockClientGenerator := new(MockClientGenerator) mockClientGenerator := new(MockClientGenerator)
mockClientGenerator.On("KubeClient").Return(fakeKube.NewSimpleClientset(), nil) mockClientGenerator.On("KubeClient").Return(fakeKube.NewSimpleClientset(), nil)
sources, err := ByNames(context.TODO(), mockClientGenerator, []string{"fake"}, minimalConfig) sources, err := ByNames(context.TODO(), mockClientGenerator, []string{"fake"}, &Config{})
suite.NoError(err, "should not generate errors") suite.NoError(err, "should not generate errors")
suite.Len(sources, 1, "should generate fake source") suite.Len(sources, 1, "should generate fake source")
suite.Nil(mockClientGenerator.kubeClient, "client should not be created") suite.Nil(mockClientGenerator.kubeClient, "client should not be created")
@ -181,7 +181,7 @@ func (suite *ByNamesTestSuite) TestSourceNotFound() {
mockClientGenerator := new(MockClientGenerator) mockClientGenerator := new(MockClientGenerator)
mockClientGenerator.On("KubeClient").Return(fakeKube.NewSimpleClientset(), nil) mockClientGenerator.On("KubeClient").Return(fakeKube.NewSimpleClientset(), nil)
sources, err := ByNames(context.TODO(), mockClientGenerator, []string{"foo"}, minimalConfig) sources, err := ByNames(context.TODO(), mockClientGenerator, []string{"foo"}, &Config{})
suite.Equal(err, ErrSourceNotFound, "should return source not found") suite.Equal(err, ErrSourceNotFound, "should return source not found")
suite.Len(sources, 0, "should not returns any source") suite.Len(sources, 0, "should not returns any source")
} }
@ -190,16 +190,16 @@ func (suite *ByNamesTestSuite) TestKubeClientFails() {
mockClientGenerator := new(MockClientGenerator) mockClientGenerator := new(MockClientGenerator)
mockClientGenerator.On("KubeClient").Return(nil, errors.New("foo")) mockClientGenerator.On("KubeClient").Return(nil, errors.New("foo"))
_, err := ByNames(context.TODO(), mockClientGenerator, []string{"service"}, minimalConfig) _, err := ByNames(context.TODO(), mockClientGenerator, []string{"service"}, &Config{})
suite.Error(err, "should return an error if kubernetes client cannot be created") suite.Error(err, "should return an error if kubernetes client cannot be created")
_, err = ByNames(context.TODO(), mockClientGenerator, []string{"ingress"}, minimalConfig) _, err = ByNames(context.TODO(), mockClientGenerator, []string{"ingress"}, &Config{})
suite.Error(err, "should return an error if kubernetes client cannot be created") suite.Error(err, "should return an error if kubernetes client cannot be created")
_, err = ByNames(context.TODO(), mockClientGenerator, []string{"istio-gateway"}, minimalConfig) _, err = ByNames(context.TODO(), mockClientGenerator, []string{"istio-gateway"}, &Config{})
suite.Error(err, "should return an error if kubernetes client cannot be created") suite.Error(err, "should return an error if kubernetes client cannot be created")
_, err = ByNames(context.TODO(), mockClientGenerator, []string{"kong-tcpingress"}, minimalConfig) _, err = ByNames(context.TODO(), mockClientGenerator, []string{"kong-tcpingress"}, &Config{})
suite.Error(err, "should return an error if kubernetes client cannot be created") suite.Error(err, "should return an error if kubernetes client cannot be created")
} }
@ -209,17 +209,13 @@ func (suite *ByNamesTestSuite) TestIstioClientFails() {
mockClientGenerator.On("IstioClient").Return(nil, errors.New("foo")) mockClientGenerator.On("IstioClient").Return(nil, errors.New("foo"))
mockClientGenerator.On("DynamicKubernetesClient").Return(nil, errors.New("foo")) mockClientGenerator.On("DynamicKubernetesClient").Return(nil, errors.New("foo"))
_, err := ByNames(context.TODO(), mockClientGenerator, []string{"istio-gateway"}, minimalConfig) _, err := ByNames(context.TODO(), mockClientGenerator, []string{"istio-gateway"}, &Config{})
suite.Error(err, "should return an error if istio client cannot be created") suite.Error(err, "should return an error if istio client cannot be created")
_, err = ByNames(context.TODO(), mockClientGenerator, []string{"contour-httpproxy"}, minimalConfig) _, err = ByNames(context.TODO(), mockClientGenerator, []string{"contour-httpproxy"}, &Config{})
suite.Error(err, "should return an error if contour client cannot be created") suite.Error(err, "should return an error if contour client cannot be created")
} }
func TestByNames(t *testing.T) { func TestByNames(t *testing.T) {
suite.Run(t, new(ByNamesTestSuite)) suite.Run(t, new(ByNamesTestSuite))
} }
var minimalConfig = &Config{
ContourLoadBalancerService: "heptio-contour/contour",
}