Google Cloud Kubernetes Elasticsearch Cluster mit internem Load Balancer konfigurieren

English Deutsch

Google Cloud offers a convenient way of installing an ElasticSearch cluster on top of a Google Cloud Kubernetes cluster. However, the documentation tells you to expose the ElasticSearch instance using

kubectl-patch-elasticsearch-lb.sh
kubectl patch service/"elasticsearch-elasticsearch-svc" \
  --namespace "default" \
  --patch '{"spec": {"type": "LoadBalancer"}}'

Dieser Befehl wird ElasticSearch jedoch einer externen IP aussetzen, die es in der Standardkonfiguration öffentlich zugänglich macht.

Here’s the equivalent command that will expose ElasticSearch to an internal load balancer with an internal IP address that will only be available from Google Cloud.

kubectl-patch-elasticsearch-internal-lb.sh
kubectl patch service/"elasticsearch-elasticsearch-svc" \
  --namespace "default" \
  --patch '{"spec": {"type": "LoadBalancer"}, "metadata": {"annotations": {"cloud.google.com/load-balancer-type": "Internal"}}}'

Du musst möglicherweise den Namen deines Services (elasticsearch-elasticsearch-svc in diesem Beispiel) und möglicherweise deinen Namespace ersetzen.


Check out similar posts by category: Cloud, ElasticSearch, Kubernetes