mirror of
https://gerrit.hackerspace.pl/hscloud
synced 2025-03-21 17:34:52 +00:00
tool: add calicoctl wrapper
This commit is contained in:
parent
0752971f8a
commit
a305bc9fb5
3 changed files with 31 additions and 2 deletions
|
@ -40,7 +40,13 @@ copy_go_binary(
|
|||
)
|
||||
|
||||
copy_go_binary(
|
||||
name = "calicoctl",
|
||||
name = "calicoctl.bin",
|
||||
src = "@com_github_projectcalico_calicoctl//calicoctl:calicoctl",
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
sh_binary(
|
||||
name = "calicoctl",
|
||||
srcs = ["calicoctl.sh"],
|
||||
data = [":calicoctl.bin"],
|
||||
)
|
||||
|
|
23
tools/calicoctl.sh
Executable file
23
tools/calicoctl.sh
Executable file
|
@ -0,0 +1,23 @@
|
|||
#!/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/kube-calico.key"
|
||||
ETCD_CERT_FILE="$hscloud_root/cluster/certs/kube-calico.crt"
|
||||
ETCD_CA_CERT_FILE="$hscloud_root/cluster/certs/ca.crt"
|
||||
|
||||
if [ ! -f "$ETCD_KEY_FILE" ] ; then
|
||||
secretstore decrypt "$hscloud_root/cluster/secrets/cipher/kube-calico.key" > "$ETCD_KEY_FILE"
|
||||
fi
|
||||
|
||||
export ETCD_ENDPOINTS
|
||||
export ETCD_KEY_FILE
|
||||
export ETCD_CERT_FILE
|
||||
export ETCD_CA_CERT_FILE
|
||||
calicoctl.bin "$@"
|
|
@ -9,4 +9,4 @@ cd "${hscloud_root}"
|
|||
|
||||
bazel build \
|
||||
//tools:kubectl //tools:kubecfg //tools:clustercfg //tools:secretstore \
|
||||
//tools:pass //tools:calicoctl
|
||||
//tools:pass //tools:calicoctl.bin
|
||||
|
|
Loading…
Add table
Reference in a new issue