Skip to content

Instantly share code, notes, and snippets.

@georgegoh
Last active October 3, 2018 07:20
Show Gist options
  • Save georgegoh/bc6f309d3f8595390894256d311bf5e4 to your computer and use it in GitHub Desktop.
Save georgegoh/bc6f309d3f8595390894256d311bf5e4 to your computer and use it in GitHub Desktop.
One-liner to get health of the Elasticsearch cluster from the first ES pod
#!/bin/sh
oc -n openshift-logging exec `oc -n openshift-logging get po -l component=es -o go-template='{{ (index .items 0).metadata.name }}'` \
-c elasticsearch \
-- curl -s \
--cacert /etc/elasticsearch/secret/admin-ca \
--cert /etc/elasticsearch/secret/admin-cert \
--key /etc/elasticsearch/secret/admin-key \
https://logging-es:9200/_cluster/health?pretty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment