Cluster information:
Kubernetes version: 1.18.2
Cloud being used: bare-metal
Installation method: kubeadm
Host OS: ubuntu 18.04
CNI and version: calico
CRI and version:
hi.
I want to start cluster with Service Topology.
I read:
Service Topology - Kubernetes EndpointSlices - Kubernetes
and
Enabling EndpointSlices - Kubernetes
I enabled startup options for the service kube-proxy:
–feature-gates=EndpointSliceProxying=true
and created service:
dns.yaml:
apiVersion: v1
kind: Service
metadata:
name: kube-dns2
spec:
ports:
- name: dns
port: 53
protocol: UDP
targetPort: 53
selector:
k8s-app: kube-dns
topologyKeys:
- "kubernetes.io/hostname"
# kubectl get svc kube-dns2 -n kube-system
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kube-dns2 ClusterIP 10.106.3.98 <none> 53/UDP 14h
Automatically created endpointslice:
# kubectl describe endpointslice kube-dns2-b8rp4 -n kube-system
Name: kube-dns2-b8rp4
Namespace: kube-system
Labels: endpointslice.kubernetes.io/managed-by=endpointslice-controller.k8s.io
kubernetes.io/service-name=kube-dns2
Annotations: endpoints.kubernetes.io/last-change-trigger-time: 2020-04-21T23:34:13Z
AddressType: IPv4
Ports:
Name Port Protocol
---- ---- --------
dns 53 UDP
Endpoints:
- Addresses: 10.244.148.214
Conditions:
Ready: true
Hostname: <unset>
TargetRef: Pod/coredns-6cfdfcf764-d4rjd
Topology: kubernetes.io/hostname=kuber-01
- Addresses: 10.244.40.27
Conditions:
Ready: true
Hostname: <unset>
TargetRef: Pod/coredns-6cfdfcf764-m5gf8
Topology: kubernetes.io/hostname=kuber-04
- Addresses: 10.244.235.166
Conditions:
Ready: true
Hostname: <unset>
TargetRef: Pod/coredns-6cfdfcf764-vwfgh
Topology: kubernetes.io/hostname=kuber-06
- Addresses: 10.244.235.182
Conditions:
Ready: true
Hostname: <unset>
TargetRef: Pod/coredns-6cfdfcf764-qrs5n
Topology: kubernetes.io/hostname=kuber-06
I use ipvs for kube-proxy
On the node in the ipvsadm -ln command listing
UDP 10.106.3.98:53 rr
-> 10.244.40.27:53 Masq 1 0 0
-> 10.244.40.54:53 Masq 1 0 0
-> 10.244.97.70:53 Masq 1 0 0
-> 10.244.97.75:53 Masq 1 0 0
-> 10.244.97.76:53 Masq 1 0 0
-> 10.244.97.78:53 Masq 1 0 0
-> 10.244.106.1:53 Masq 1 0 0
-> 10.244.106.2:53 Masq 1 0 0
-> 10.244.106.24:53 Masq 1 0 0
-> 10.244.106.50:53 Masq 1 0 0
How can I use the created service? Ipvs rules are created for proxying requests to all my pods, I want the request to be sent only to the local dns
I read that kube-proxy should switch from using endpoint to endpointslice when using the option --feature-gates=EndpointSliceProxying=true. but it does not work
I will be happy for any help or manual for using Service Topology or EndpointSlices .