hscloud/cluster/tools/calicoctl.sh
Sergiusz Bazanski d81bf72d7f calico: upgrade to 3.14, fix calicoctl
We still use etcd as the data store (and as such didn't set up k8s CRDs
for Calico), but that's okay for now.

Change-Id: If6d66f505c6b40f2646ffae7d33d0d641d34a963
2020-05-28 16:47:16 +02:00

23 lines
722 B
Bash
Executable file

#!/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"
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"
if [ ! -f "$ETCD_KEY_FILE" ] ; then
secretstore decrypt "$hscloud_root/cluster/secrets/cipher/etcd-calico.key" > "$ETCD_KEY_FILE"
fi
export ETCD_ENDPOINTS
export ETCD_KEY_FILE
export ETCD_CERT_FILE
export ETCD_CA_CERT_FILE
calicoctl.bin "$@"