Is it possible to configure Kibana instances with zone awareness? Meaning I want to deploy 2 instances or more on different zones.
The output command of kubectl get pod -o=custom-columns=NODE:.spec.nodeName,NAME:.metadata.name -n my-ns :
NODE NAME
knodeaz0b01 elasticsearch-es-default-0
knodeaz0b02 elasticsearch-es-default-1
knodeaz0a01 elasticsearch-es-default-2
knodeaz0a02 kibana-kb-856cb5b5cd-6l28x #in zone A
knodeaz0a01 kibana-kb-856cb5b5cd-vftjj # in same zone A
The label kubernetes.io/hostname is set to the same node name, I added the topology.kubernetes.io/region label but it worked only the first time, after applying the configuration it created a third pod in a different zone and delete one.
When I deleted all kibana instances and applied again the configuration with the two constraints, the two instances are created in same zones .
That is interesting. Could you check to make sure that the topologySpreadConstraints look correct in the resulting daemonSet that the ECK operator created? This sounds like the topologySpreadConstraints aren't being properly applied for some reason.
On the deletion, I would've expected that if a pod was to come up which violated the constraints, then it shouldn't have been scheduled and thrown an error is no other nodes were available that matched the constraints.
For some reason, it worked with podAntiAffinity, I applied the configuration 3 times and always getting the two instances of kibana running in separate zones :), here is the code that worked at the end:
Yeah, from what I've found affinity is currently more reliable in working/understanding and more feature mature. I think the one caution with affinity is in very large-scale Kubernetes deployments is has performance issues compared to topologySpreadConstraints. But unless your Kubernetes cluster is massive, I doubt there would be any noticeable difference.
There is no daemonSet for kibana
This was my mistake, the ECK operator makes a deployment for Kibana, not a daemonSet.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.