summaryrefslogtreecommitdiffstats
path: root/scripts/opts.sh
blob: 2f76d8e66764b565b714a1e001dbbf8d1325f045 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
function get_gluster_pod {
    oc -n glusterfs get pods -l 'glusterfs=storage-pod' | grep Running | awk '{ print $1 }' | head -n 1
}

gpod=$(get_gluster_pod)

function gluster {
    oc -n glusterfs rsh po/$gpod gluster "$@"
}


function node {
    ip=$1
    shift
    
    ssh -xq root@192.168.26.$ip "$@"
}

function heketi {
    node 1 heketi-cli -s  http://heketi-storage.glusterfs.svc.cluster.local:8080 --user admin --secret "$(oc get secret heketi-storage-admin-secret -n glusterfs -o jsonpath='{.data.key}' | base64 -d)" "$@"
}