mirror of
https://github.com/kubernetes-sigs/external-dns.git
synced 2025-08-05 17:16:59 +02:00
Remove flags and documentation for removed contour-ingressroute source
This commit is contained in:
parent
92824f4f9b
commit
4a40346d42
@ -106,7 +106,6 @@ If `namespaced` is set to `true`, please ensure that `sources` my only contains
|
||||
| `ingress` | ✅ | |
|
||||
| `istio-gateway` | ✅ | |
|
||||
| `istio-virtualservice` | ✅ | |
|
||||
| `contour-ingressroute` | ✅ | |
|
||||
| `crd` | ✅ | |
|
||||
| `kong-tcpingress` | ✅ | |
|
||||
| `openshift-route` | ✅ | |
|
||||
|
@ -47,11 +47,6 @@ rules:
|
||||
resources: ["httpproxies"]
|
||||
verbs: ["get","watch","list"]
|
||||
{{- end }}
|
||||
{{- if has "contour-ingressroute" .Values.sources }}
|
||||
- apiGroups: ["contour.heptio.com"]
|
||||
resources: ["ingressroutes"]
|
||||
verbs: ["get","watch","list"]
|
||||
{{- end }}
|
||||
{{- if has "crd" .Values.sources }}
|
||||
- apiGroups: ["externaldns.k8s.io"]
|
||||
resources: ["dnsendpoints"]
|
||||
|
@ -1,12 +1,10 @@
|
||||
# Setting up External DNS with Contour
|
||||
|
||||
This tutorial describes how to configure External DNS to use either the Contour `IngressRoute` or `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.
|
||||
This tutorial describes how to configure External DNS to use the Contour `HTTPProxy` source.
|
||||
Using the `HTTPProxy` resource with External DNS requires Contour version 1.5 or greater.
|
||||
|
||||
### Example manifests for External DNS
|
||||
#### 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
|
||||
apiVersion: apps/v1
|
||||
@ -30,9 +28,7 @@ spec:
|
||||
args:
|
||||
- --source=service
|
||||
- --source=ingress
|
||||
- --source=contour-ingressroute # To enable IngressRoute support
|
||||
- --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)
|
||||
- --source=contour-httpproxy
|
||||
- --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
|
||||
- --policy=upsert-only # would prevent ExternalDNS from deleting any records, omit to enable full synchronization
|
||||
@ -62,11 +58,6 @@ rules:
|
||||
- apiGroups: [""]
|
||||
resources: ["nodes"]
|
||||
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"]
|
||||
resources: ["httpproxies"]
|
||||
verbs: ["get","watch","list"]
|
||||
@ -106,9 +97,7 @@ spec:
|
||||
args:
|
||||
- --source=service
|
||||
- --source=ingress
|
||||
- --source=contour-ingressroute # To enable IngressRoute support
|
||||
- --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)
|
||||
- --source=contour-httpproxy
|
||||
- --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
|
||||
- --policy=upsert-only # would prevent ExternalDNS from deleting any records, omit to enable full synchronization
|
||||
@ -162,9 +151,8 @@ spec:
|
||||
EOF
|
||||
```
|
||||
|
||||
Then create either a `HTTPProxy` or an `IngressRoute`
|
||||
Then create an `HTTPProxy`:
|
||||
|
||||
#### HTTPProxy
|
||||
```
|
||||
$ kubectl apply -f - <<EOF
|
||||
apiVersion: projectcontour.io/v1
|
||||
@ -186,27 +174,6 @@ spec:
|
||||
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`
|
||||
```bash
|
||||
$ curl -i http://kuard.example.com/healthy
|
||||
|
1
main.go
1
main.go
@ -140,7 +140,6 @@ func main() {
|
||||
CFAPIEndpoint: cfg.CFAPIEndpoint,
|
||||
CFUsername: cfg.CFUsername,
|
||||
CFPassword: cfg.CFPassword,
|
||||
ContourLoadBalancerService: cfg.ContourLoadBalancerService,
|
||||
GlooNamespace: cfg.GlooNamespace,
|
||||
SkipperRouteGroupVersion: cfg.SkipperRouteGroupVersion,
|
||||
RequestTimeout: cfg.RequestTimeout,
|
||||
|
@ -47,7 +47,6 @@ type Config struct {
|
||||
KubeConfig string
|
||||
RequestTimeout time.Duration
|
||||
DefaultTargets []string
|
||||
ContourLoadBalancerService string
|
||||
GlooNamespace string
|
||||
SkipperRouteGroupVersion string
|
||||
Sources []string
|
||||
@ -214,7 +213,6 @@ var defaultConfig = &Config{
|
||||
KubeConfig: "",
|
||||
RequestTimeout: time.Second * 30,
|
||||
DefaultTargets: []string{},
|
||||
ContourLoadBalancerService: "heptio-contour/contour",
|
||||
GlooNamespace: "gloo-system",
|
||||
SkipperRouteGroupVersion: "zalando.org/v1",
|
||||
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-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
|
||||
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)
|
||||
|
||||
// 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("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)
|
||||
|
@ -35,7 +35,6 @@ var (
|
||||
APIServerURL: "",
|
||||
KubeConfig: "",
|
||||
RequestTimeout: time.Second * 30,
|
||||
ContourLoadBalancerService: "heptio-contour/contour",
|
||||
GlooNamespace: "gloo-system",
|
||||
SkipperRouteGroupVersion: "zalando.org/v1",
|
||||
Sources: []string{"service"},
|
||||
@ -136,7 +135,6 @@ var (
|
||||
APIServerURL: "http://127.0.0.1:8080",
|
||||
KubeConfig: "/some/path",
|
||||
RequestTimeout: time.Second * 77,
|
||||
ContourLoadBalancerService: "heptio-contour-other/contour-other",
|
||||
GlooNamespace: "gloo-not-system",
|
||||
SkipperRouteGroupVersion: "zalando.org/v2",
|
||||
Sources: []string{"service", "ingress", "connector"},
|
||||
@ -267,7 +265,6 @@ func TestParseFlags(t *testing.T) {
|
||||
"--server=http://127.0.0.1:8080",
|
||||
"--kubeconfig=/some/path",
|
||||
"--request-timeout=77s",
|
||||
"--contour-load-balancer=heptio-contour-other/contour-other",
|
||||
"--gloo-namespace=gloo-not-system",
|
||||
"--skipper-routegroup-groupversion=zalando.org/v2",
|
||||
"--source=service",
|
||||
|
@ -67,7 +67,6 @@ type Config struct {
|
||||
CFAPIEndpoint string
|
||||
CFUsername string
|
||||
CFPassword string
|
||||
ContourLoadBalancerService string
|
||||
GlooNamespace string
|
||||
SkipperRouteGroupVersion string
|
||||
RequestTimeout time.Duration
|
||||
|
@ -162,7 +162,7 @@ func (suite *ByNamesTestSuite) TestAllInitialized() {
|
||||
}: "IngressRouteUDPList",
|
||||
}), 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.Len(sources, 8, "should generate all eight sources")
|
||||
}
|
||||
@ -171,7 +171,7 @@ func (suite *ByNamesTestSuite) TestOnlyFake() {
|
||||
mockClientGenerator := new(MockClientGenerator)
|
||||
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.Len(sources, 1, "should generate fake source")
|
||||
suite.Nil(mockClientGenerator.kubeClient, "client should not be created")
|
||||
@ -181,7 +181,7 @@ func (suite *ByNamesTestSuite) TestSourceNotFound() {
|
||||
mockClientGenerator := new(MockClientGenerator)
|
||||
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.Len(sources, 0, "should not returns any source")
|
||||
}
|
||||
@ -190,16 +190,16 @@ func (suite *ByNamesTestSuite) TestKubeClientFails() {
|
||||
mockClientGenerator := new(MockClientGenerator)
|
||||
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")
|
||||
|
||||
_, 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")
|
||||
|
||||
_, 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")
|
||||
|
||||
_, 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")
|
||||
}
|
||||
|
||||
@ -209,17 +209,13 @@ func (suite *ByNamesTestSuite) TestIstioClientFails() {
|
||||
mockClientGenerator.On("IstioClient").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")
|
||||
|
||||
_, 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")
|
||||
}
|
||||
|
||||
func TestByNames(t *testing.T) {
|
||||
suite.Run(t, new(ByNamesTestSuite))
|
||||
}
|
||||
|
||||
var minimalConfig = &Config{
|
||||
ContourLoadBalancerService: "heptio-contour/contour",
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user