Kubernetes - ServiceTopology


addressType: IPv4
apiVersion: discovery.k8s.io/v1beta1
endpoints:
- addresses:
- 10.42.252.197
conditions:
ready: true
targetRef:
kind: Pod
name: backend-api-684f76dc76-ld6j5
namespace: default
topology:
kubernetes.io/hostname: 18.202.26.110
- addresses:
- 10.42.54.133
conditions:
ready: true
targetRef:
kind: Pod
name: backend-api-684f76dc76-lhk8w
namespace: default
topology:
kubernetes.io/hostname: 34.249.47.196

KubeProxy ve Kubernetes Trafik Yonetimi

kubeproxy basic application flow
10.42.54.128/26 via 172.31.11.157 dev tunl0 proto bird onlink
10.42.160.192/26 via 172.31.3.146 dev tunl0 proto bird onlink
10.42.174.192/26 via 172.31.6.198 dev tunl0 proto bird onlink

Ancak;

ServiceTopology

Service Object:

apiVersion: v1
kind: Service
metadata:
name: swansea-city-api
spec:
selector:
run: swansea-city-api
ports:
- protocol: TCP
port: 80
targetPort: 5000
-A KUBE-SEP-J5INMQGMDOEPBX6T -p tcp -m tcp -j DNAT --to-destination 10.42.54.133:5000-A KUBE-SEP-K4E4PJN2BTDAZ5MF -s 10.42.174.197/32 -j KUBE-MARK-MASQ-A KUBE-SEP-K4E4PJN2BTDAZ5MF -p tcp -m tcp -j DNAT --to-destination 10.42.174.197:5000
apiVersion: v1
kind: Service
metadata:
name: swansea-city-api
spec:
selector:
run: swansea-city-api
ports:
- protocol: TCP
port: 80
targetPort: 5000
topologyKeys:
- "kubernetes.io/hostname"
node-2 uzerinden alinmis IPTABLE kurallari
swansea-city-api-684f76dc76-2qxm7 10.42.252.198   node-2
swansea-city-api-684f76dc76-j5nmb 10.42.174.198 node-3
swansea-city-api-684f76dc76-ld6j5 10.42.252.197 node-2
swansea-city-api-684f76dc76-lhk8w 10.42.54.133 node-3
swansea-city-api-684f76dc76-mw87c 10.42.174.197 node-4

Sonuc:

--feature-gates="ServiceTopology=true,EndpointSlice=true"

Kaynakca

--

--

--

PythonRubyLinux(❤)

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Emir Özbir

Emir Özbir

PythonRubyLinux(❤)

More from Medium

Ansible troubleshooting — Kubernetes K8s or OpenShift OCP 401 Unauthorized

Build Docker Images in Kubernetes POD Without Docker -Kaniko

Learn Kubernetes: Healthcheck

How to create and edit Kubernetes yaml files on the fly