apiVersion: v1
kind: Service
metadata:
  name: whoamiudp
  namespace: default

spec:
  ports:
    - name: myapp
      port: 8000
  selector:
    app: traefiklabs
    task: whoamiudp

---
kind: EndpointSlice
apiVersion: discovery.k8s.io/v1
metadata:
  name: whoamiudp-abc
  namespace: default
  labels:
    kubernetes.io/service-name: whoamiudp

addressType: IPv4
ports:
  - name: myapp
    port: 8000
endpoints:
  - addresses:
      - 10.10.0.1
      - 10.10.0.2
    conditions:
      ready: true

---
apiVersion: v1
kind: Service
metadata:
  name: whoamiudp2
  namespace: default

spec:
  ports:
    - name: myapp2
      port: 8080
  selector:
    app: traefiklabs
    task: whoamiudp2

---
kind: EndpointSlice
apiVersion: discovery.k8s.io/v1
metadata:
  name: whoamiudp2-abc
  namespace: default
  labels:
    kubernetes.io/service-name: whoamiudp2

addressType: IPv4
ports:
  - name: myapp2
    port: 8080
endpoints:
  - addresses:
      - 10.10.0.3
      - 10.10.0.4
    conditions:
      ready: true

---
apiVersion: v1
kind: Service
metadata:
  name: whoamiudp3
  namespace: ns3

spec:
  ports:
    - name: myapp3
      port: 8083
  selector:
    app: traefiklabs
    task: whoamiudp3

---
kind: EndpointSlice
apiVersion: discovery.k8s.io/v1
metadata:
  name: whoamiudp3-abc
  namespace: ns3
  labels:
    kubernetes.io/service-name: whoamiudp3

addressType: IPv4
ports:
  - name: myapp3
    port: 8083
endpoints:
  - addresses:
      - 10.10.0.7
      - 10.10.0.8
    conditions:
      ready: true

---
kind: EndpointSlice
apiVersion: discovery.k8s.io/v1
metadata:
  name: whoamiudp3-abc
  namespace: ns4
  labels:
    kubernetes.io/service-name: whoamiudp3

addressType: IPv4
ports:
  - name: myapp4
    port: 8084
endpoints:
  - addresses:
      - 10.10.0.9
      - 10.10.0.10
    conditions:
      ready: true

---
apiVersion: v1
kind: Service
metadata:
  name: whoamiudp-ipv6
  namespace: default

spec:
  ports:
    - name: myapp-ipv6
      port: 8080
  selector:
    app: traefiklabs
    task: whoamiudp-ipv6

---
kind: EndpointSlice
apiVersion: discovery.k8s.io/v1
metadata:
  name: whoamiudp-ipv6-abc
  namespace: default
  labels:
    kubernetes.io/service-name: whoamiudp-ipv6

addressType: IPv6
ports:
  - name: myapp-ipv6
    port: 8080
endpoints:
  - addresses:
      - "fd00:10:244:0:1::3"
    conditions:
      ready: true

---
apiVersion: v1
kind: Service
metadata:
  name: whoamiudp-cross-ns
  namespace: cross-ns

spec:
  ports:
    - name: myapp
      port: 8000
  selector:
    app: traefiklabs
    task: whoamiudp

---
apiVersion: v1
kind: Service
metadata:
  name: external-svc-udp
  namespace: default
spec:
  externalName: external.domain
  type: ExternalName

---
apiVersion: v1
kind: Service
metadata:
  name: external.service.with.port.udp
  namespace: default
spec:
  externalName: external.domain
  type: ExternalName
  ports:
    - name: http
      protocol: TCP
      port: 80

---
kind: EndpointSlice
apiVersion: discovery.k8s.io/v1
metadata:
  name: whoamiudp-cross-ns-abc
  namespace: cross-ns
  labels:
    kubernetes.io/service-name: whoamiudp-cross-ns

addressType: IPv4
ports:
  - name: myapp
    port: 8000
endpoints:
  - addresses:
      - 10.10.0.1
      - 10.10.0.2
    conditions:
      ready: true

---
apiVersion: v1
kind: Service
metadata:
  name: whoamiudp-without-endpointslice-endpoints
  namespace: default

spec:
  ports:
    - name: myapp
      port: 8000

  selector:
    app: traefiklabs
    task: whoamiudp

---
kind: EndpointSlice
apiVersion: discovery.k8s.io/v1
metadata:
  name: whoamiudp-without-endpointslice-endpoints-abc
  namespace: default
  labels:
    kubernetes.io/service-name: whoamiudp-without-endpointslice-endpoints

addressType: IPv4
endpoints: []

---
apiVersion: v1
kind: Service
metadata:
  name: native-svc-udp
  namespace: default

spec:
  ports:
    - name: udp
      protocol: UDP
      port: 8000
  type: ClusterIP
  clusterIP: 10.10.0.1

---
apiVersion: v1
kind: Service
metadata:
  name: native-disabled-svc-udp
  namespace: default
spec:
  ports:
    - name: udp
      protocol: UDP
      port: 8000
  type: ClusterIP
  clusterIP: 10.10.0.1

---
kind: EndpointSlice
apiVersion: discovery.k8s.io/v1
metadata:
  name: native-disabled-udp-abc
  namespace: default
  labels:
    kubernetes.io/service-name: native-disabled-svc-udp
addressType: IPv4
ports:
  - name: udp
    protocol: UDP
    port: 8000
endpoints:
  - addresses:
      - 10.10.0.30
      - 10.10.0.31
    conditions:
      ready: true

---
apiVersion: v1
kind: Service
metadata:
  name: nodeport-svc-udp
  namespace: default

spec:
  ports:
    - name: myapp
      port: 8000
      nodePort: 32456
  type: NodePort
  clusterIP: 10.10.0.1
