confluent-kubernetes-examples
confluent-kubernetes-examples copied to clipboard
Support for static IPs - LoadBalancer i.e. MetalLB
can you add example how can i specify static IPs for brokers when using LoadBalancer?
dynamic assignment is working with this config
CFK part of config
apiVersion: platform.confluent.io/v1beta1
kind: Kafka
...
listeners:
external:
externalAccess:
type: loadBalancer
loadBalancer:
domain: mydomain.com
metallb config
apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
namespace: metallb-system
name: config
labels:
zone: east
spec:
addresses:
- 192.168.1.200-192.168.1.250
apiVersion: metallb.io/v1beta1
kind: L2Advertisement
metadata:
name: first-advertisement
namespace: metallb-system
spec:
ipAddressPools:
- config
[root@master01 kafka]# kubectl get svc -n confluent | grep Load
kafka-0-lb LoadBalancer 10.43.157.33 192.168.1.201 9092:31329/TCP 3d5h
kafka-1-lb LoadBalancer 10.43.115.81 192.168.1.203 9092:31314/TCP 8h
kafka-2-lb LoadBalancer 10.43.211.63 192.168.1.204 9092:30269/TCP 8h
kafka-bootstrap-lb LoadBalancer 10.43.75.152 192.168.1.202 9092:30735/TCP 3d5h
but i want assigment like this kafka-bootstrap-lb 192.168.1.210 kafka-0-lb 192.168.1.200 kafka-1-lb 192.168.1.201 kafka-2-lb 192.168.1.202
manual workaround https://docs.redhat.com/en/documentation/openshift_container_platform/4.18/html/networking/load-balancing-with-metallb#request-specific-ip-address_configure-services-metallb
kubectl edit svc kafka-0-lb -n confluent add "loadBalancerIP: x.x.x.x" to the spec section i.e.
spec:
type: LoadBalancer
loadBalancerIP: x.x.x.x