2019-01-18 01:34:20 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# A wrapper around the real calicoctl to configure etcd access...
|
|
|
|
|
|
|
|
if [ -z "$hscloud_root" ]; then
|
|
|
|
echo 2>&1 "Please source env.sh"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
ETCD_ENDPOINTS="https://bc01n01.hswaw.net:2379,https://bc01n01.hswaw.net:2379,https://bc01n01.hswaw.net:2379"
|
2020-05-28 16:38:52 +02:00
|
|
|
ETCD_KEY_FILE="$hscloud_root/cluster/secrets/plain/etcd-calico.key"
|
|
|
|
ETCD_CERT_FILE="$hscloud_root/cluster/certs/etcd-calico.cert"
|
|
|
|
ETCD_CA_CERT_FILE="$hscloud_root/cluster/certs/ca-etcd.crt"
|
2019-01-18 01:34:20 +01:00
|
|
|
|
|
|
|
if [ ! -f "$ETCD_KEY_FILE" ] ; then
|
2020-05-28 16:38:52 +02:00
|
|
|
secretstore decrypt "$hscloud_root/cluster/secrets/cipher/etcd-calico.key" > "$ETCD_KEY_FILE"
|
2019-01-18 01:34:20 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
export ETCD_ENDPOINTS
|
|
|
|
export ETCD_KEY_FILE
|
|
|
|
export ETCD_CERT_FILE
|
|
|
|
export ETCD_CA_CERT_FILE
|
|
|
|
calicoctl.bin "$@"
|