Skip to content

Instantly share code, notes, and snippets.

@georgegoh
Last active October 2, 2018 05:46
Show Gist options
  • Select an option

  • Save georgegoh/f0076bb967181c288bf1278a7e371aec to your computer and use it in GitHub Desktop.

Select an option

Save georgegoh/f0076bb967181c288bf1278a7e371aec to your computer and use it in GitHub Desktop.
Print the details of the PVCs attached to the Elasticsearch pods in OpenShift's EFK stack.
#!/bin/sh
ES_VOLS=`oc get pvc -l logging-infra=support -n openshift-logging -o jsonpath='{range .items[*]}{.spec.volumeName}{"\n"}'`
for pv in $ES_VOLS
do
oc get pv $pv -o jsonpath='{.spec.claimRef.name}{"\t"}{.spec.iscsi.portals}{"\t"}{.spec.iscsi.iqn}{"\n"}'
done
@georgegoh
Copy link
Copy Markdown
Author

Sample output:

logging-es-0    [10.77.6.226 10.77.6.225 10.77.6.227]   iqn.2016-12.org.gluster-block:<UUID>
logging-es-1    [10.77.6.226 10.77.6.225 10.77.6.227]   iqn.2016-12.org.gluster-block:<UUID>
logging-es-2    [10.77.6.226 10.77.6.225 10.77.6.227]   iqn.2016-12.org.gluster-block:<UUID>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment