Kubernetes endpoints

Using endpoints, you can easily use services (traefik, nodeport, loadbalancer, etc.) to connect external resources

The following is an example of traefik connecting PostgreSQL

endpoint.yaml

apiVersion: v1
kind: Endpoints
metadata:
  name: postgre-endpoint
  namespace: postgre
subsets:
  - addresses:
      - ip: 10.10.20.135
    ports:
      - port: 5432

create service

apiVersion: v1
kind: Service
metadata:
  name: postgre-endpoint
  namespace: postgre
spec:
  ports:
    - port: 5432
      protocol: TCP
      targetPort: 5432

IngressRoute

apiVersion: traefik.containo.us/v1alpha1
kind: IngressRouteTCP
metadata:
  name: postgre-endpoint
  namespace: postgre
spec:
  entryPoints:
    - postgre
  routes:
  - match: HostSNI(`*`)
    services:
    - name: postgre-endpoint
      port: 5432
Send a Message