Skip to content

Instantly share code, notes, and snippets.

@Hermsi1337
Created April 27, 2020 08:44
Show Gist options
  • Save Hermsi1337/75acc6382aa7ceb29904f0900007aed4 to your computer and use it in GitHub Desktop.
Save Hermsi1337/75acc6382aa7ceb29904f0900007aed4 to your computer and use it in GitHub Desktop.
Disable basic-auth via init-container when deploying elasticsearch via the cloud-on-k8s operator
#!/usr/bin/env bash
set -x
set -euo pipefail
# download yq-binary and only start as soon as the binary is present
until curl \
-L -o yq \
https://github.com/mikefarah/yq/releases/download/3.1.2/yq_linux_amd64 \
; do sleep 1 ; done
chmod +x yq
mv /usr/share/elasticsearch/config/elasticsearch.yml /usr/share/elasticsearch/config/elasticsearch.yml.orig
# replace true to false in elasticsearch config: xpack.security.enabled
./yq w --tag '!!str' /usr/share/elasticsearch/config/elasticsearch.yml.orig 'xpack.security.enabled' false > /usr/share/elasticsearch/config/elasticsearch.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment