Skip to content

Backend "imported"

Victor Cuadrado Juan edited this page Feb 26, 2020 · 1 revision

You can re-use an already running Kubernetes cluster in catapult, most of the make targets require only a kubeconfig.

Simply provide a kubeconfig to the "imported" backend:

$> CLUSTER_NAME=<your-cluster-name> BACKEND=imported KUBECFG=<abs path to kubeconfig> make k8s

From now on you can call the other make targets regularly, by doing:

$> CLUSTER_NAME=<your-cluster-name> make foo

As usual, if you want to do manual stuff, install direnv, and do

$> cd build<your-cluster-name>
$> direnv allow # loads all variables

and then kubectl, cf and the like.

For some of the targets though, you need info that is outside of the cluster to be saved in a configmap. You would need to run:

# Create k8s configmap
PUBLIC_IP=<public ip of the CAP cluster, not the k8s cluster. Usually an ip of a worker>
ROOTFS=overlay-xfs
NFS_SERVER_IP=<as the tin says>
NFS_PATH=<same>
DOMAIN="$PUBLIC_IP".<nip.io, or the like>

if ! kubectl get configmap -n kube-system 2>/dev/null | grep -qi cap-values; then
    kubectl create configmap -n kube-system cap-values \
            --from-literal=public-ip="${PUBLIC_IP}" \
            --from-literal=domain="${DOMAIN}" \
            --from-literal=garden-rootfs-driver="${ROOTFS}" \
            --from-literal=nfs-server-ip="${NFS_SERVER_IP}" \
            --from-literal=nfs-path="${NFS_PATH}" \
            --from-literal=platform=custom
fi

Deleting the setup

$> CLUSTER_NAME=<your-cluster-name> BACKEND=<yourbackend> make clean

or

$> rm -rf build<your-cluster-name>

Note Since catapult doesn't know about the deployment of the cluster, you might need to delete it on your own.

Clone this wiki locally