Skip to content

Commit

Permalink
Remove references to (now unused) Endpoints API
Browse files Browse the repository at this point in the history
  • Loading branch information
jnoordsij committed May 5, 2024
1 parent 15ab2b0 commit ad4429e
Show file tree
Hide file tree
Showing 68 changed files with 2 additions and 1,538 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ rules:
- ""
resources:
- services
- endpoints
- secrets
verbs:
- get
Expand Down
2 changes: 1 addition & 1 deletion docs/content/providers/kubernetes-crd.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ _Optional, Default: ""_

A label selector can be defined to filter on specific resource objects only,
this applies only to Traefik [Custom Resources](../routing/providers/kubernetes-crd.md#custom-resource-definition-crd)
and has no effect on Kubernetes `Secrets`, `Endpoints` and `Services`.
and has no effect on Kubernetes `Secrets`, `EndpointSlices` and `Services`.
If left empty, Traefik processes all resource objects in the configured namespaces.

See [label-selectors](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors) for details.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ rules:
- ""
resources:
- services
- endpoints
- secrets
- nodes
verbs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ rules:
- ""
resources:
- services
- endpoints
- secrets
verbs:
- get
Expand Down
3 changes: 0 additions & 3 deletions docs/content/routing/providers/kubernetes-ingress.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ which in turn will create the resulting routers, services, handlers, etc.
- ""
resources:
- services
- endpoints
- secrets
verbs:
- get
Expand Down Expand Up @@ -435,7 +434,6 @@ This way, any Ingress attached to this Entrypoint will have TLS termination by d
- ""
resources:
- services
- endpoints
- secrets
verbs:
- get
Expand Down Expand Up @@ -628,7 +626,6 @@ For more options, please refer to the available [annotations](#on-ingress).
- ""
resources:
- services
- endpoints
- secrets
verbs:
- get
Expand Down
1 change: 0 additions & 1 deletion integration/fixtures/k8s-conformance/01-rbac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ rules:
- ""
resources:
- services
- endpoints
- secrets
verbs:
- get
Expand Down
16 changes: 0 additions & 16 deletions pkg/provider/kubernetes/crd/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ type Client interface {
GetTLSStores() []*traefikv1alpha1.TLSStore
GetService(namespace, name string) (*corev1.Service, bool, error)
GetSecret(namespace, name string) (*corev1.Secret, bool, error)
GetEndpoints(namespace, name string) (*corev1.Endpoints, bool, error)
GetEndpointSlices(namespace, serviceName string) ([]*discoveryv1.EndpointSlice, bool, error)
GetNodes() ([]*corev1.Node, bool, error)
}
Expand Down Expand Up @@ -222,10 +221,6 @@ func (c *clientWrapper) WatchAll(namespaces []string, stopCh <-chan struct{}) (<
if err != nil {
return nil, err
}
_, err = factoryKube.Core().V1().Endpoints().Informer().AddEventHandler(eventHandler)
if err != nil {
return nil, err
}
_, err = factoryKube.Discovery().V1().EndpointSlices().Informer().AddEventHandler(eventHandler)
if err != nil {
return nil, err
Expand Down Expand Up @@ -451,17 +446,6 @@ func (c *clientWrapper) GetService(namespace, name string) (*corev1.Service, boo
return service, exist, err
}

// GetEndpoints returns the named endpoints from the given namespace.
func (c *clientWrapper) GetEndpoints(namespace, name string) (*corev1.Endpoints, bool, error) {
if !c.isWatchedNamespace(namespace) {
return nil, false, fmt.Errorf("failed to get endpoints %s/%s: namespace is not within watched namespaces", namespace, name)
}

endpoint, err := c.factoriesKube[c.lookupNamespace(namespace)].Core().V1().Endpoints().Lister().Endpoints(namespace).Get(name)
exist, err := translateNotFoundError(err)
return endpoint, exist, err
}

// GetEndpointSlices returns the endpointslices for service of provided name from the given namespace.
func (c *clientWrapper) GetEndpointSlices(namespace, serviceName string) ([]*discoveryv1.EndpointSlice, bool, error) {
if !c.isWatchedNamespace(namespace) {
Expand Down
96 changes: 0 additions & 96 deletions pkg/provider/kubernetes/crd/fixtures/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,6 @@ spec:
app: traefiklabs
task: whoami

---
kind: Endpoints
apiVersion: v1
metadata:
name: whoami
namespace: default

subsets:
- addresses:
- ip: 10.10.0.1
- ip: 10.10.0.2
ports:
- name: web
port: 80

---
kind: EndpointSlice
apiVersion: discovery.k8s.io/v1
Expand Down Expand Up @@ -62,21 +47,6 @@ spec:
app: traefiklabs
task: whoami2

---
kind: Endpoints
apiVersion: v1
metadata:
name: whoami2
namespace: default

subsets:
- addresses:
- ip: 10.10.0.3
- ip: 10.10.0.4
ports:
- name: web
port: 8080

---
kind: EndpointSlice
apiVersion: discovery.k8s.io/v1
Expand Down Expand Up @@ -113,21 +83,6 @@ spec:
app: traefiklabs
task: whoami2

---
kind: Endpoints
apiVersion: v1
metadata:
name: whoamitls
namespace: default

subsets:
- addresses:
- ip: 10.10.0.5
- ip: 10.10.0.6
ports:
- name: websecure
port: 8443

---
kind: EndpointSlice
apiVersion: discovery.k8s.io/v1
Expand Down Expand Up @@ -164,21 +119,6 @@ spec:
app: traefiklabs
task: whoami3

---
kind: Endpoints
apiVersion: v1
metadata:
name: whoami3
namespace: default

subsets:
- addresses:
- ip: 10.10.0.7
- ip: 10.10.0.8
ports:
- name: websecure2
port: 8443

---
kind: EndpointSlice
apiVersion: discovery.k8s.io/v1
Expand Down Expand Up @@ -214,20 +154,6 @@ spec:
app: traefiklabs
task: whoami-ipv6

---
kind: Endpoints
apiVersion: v1
metadata:
name: whoami-ipv6
namespace: default

subsets:
- addresses:
- ip: "2001:db8:85a3:8d3:1319:8a2e:370:7348"
ports:
- name: web
port: 8080

---
kind: EndpointSlice
apiVersion: discovery.k8s.io/v1
Expand Down Expand Up @@ -314,21 +240,6 @@ spec:
app: traefiklabs
task: whoami

---
kind: Endpoints
apiVersion: v1
metadata:
name: whoami-svc
namespace: cross-ns

subsets:
- addresses:
- ip: 10.10.0.1
- ip: 10.10.0.2
ports:
- name: web
port: 80

---
kind: EndpointSlice
apiVersion: discovery.k8s.io/v1
Expand Down Expand Up @@ -365,13 +276,6 @@ spec:
app: traefiklabs
task: whoami

---
kind: Endpoints
apiVersion: v1
metadata:
name: whoami-without-endpoints-subsets
namespace: default

---
kind: EndpointSlice
apiVersion: discovery.k8s.io/v1
Expand Down
Loading

0 comments on commit ad4429e

Please sign in to comment.