git clone https://github.com/kubemacs/kubemacs
# be sure and fork to your own user
cd kubemacs
git remote add dev [email protected]:bernokl/kubemacs.git
# to work on a branch based on a PR
git fetch origin refs/pull/6/head
git checkout -b devcycle FETCH_HEAD
# submodules point to other repos and mounth them within our repo
# google cloud builds (for our PRs) are not supported... yet
git submodule init
git submodule update
Now you can work on your the existing PR in a local branch.
ss --listening --numeric --tcp | grep -v :: | awk '{print $1, $4}' | sort
ss --listening --numeric --udp | grep -v :: | awk '{print $1, $4}' | sort
grep hostPort: kind-cluster-config.yaml
# create registry container unless it already exists
KIND_LOCAL_REGISTRY_NAME="kind-registry"
KIND_LOCAL_REGISTRY_PORT="5000"
docker pull registry:2
running="$(docker inspect -f '{{.State.Running}}' "${KIND_LOCAL_REGIESTRY_NAME}" 2>/dev/null || true)"
if [ "${running}" != 'true' ]; then
docker run \
-d --restart=always -p "${KIND_LOCAL_REGISTRY_PORT}:5000" --name "${KIND_LOCAL_REGISTRY_NAME}" \
registry:2
fi
# needs another var to not ask questions
KUBEMACS_USER=berno
export KUBEMACS_IMAGE=gcr.io/kubemacs/kubemacs:${KUBEMACS_USER}-dev2
docker build -t $KUBEMACS_IMAGE .
export DOCKER_HOST=localhost:2375
# KUBEMACS_IMAGE=gcr.io/kubemacs/kubemacs:pr-N # for any kubemacs/kubemacs PR
# -e KUBEMACS_DOCKER_INIT_CONTAINER_NAME="kubemacs-docker-init" \
winpty docker run \
--name kubemacs-docker-init \
-e HOST_UID="$(id -u)" \
-e KUBEMACS_GIT_EMAIL='[email protected]' \
-e KUBEMACS_GIT_NAME='Hippie Hacker (ii)' \
-e KUBEMACS_TIMEZONE='Pacific/Auckland' \
-e KUBEMACS_IMAGE=$KUBEMACS_IMAGE \
-e KUBEMACS_HOST_KUBECONFIG_NAME="kind-${KUBEMACS_USER}.kubemacs.configname" \
-e KIND_LOCAL_REGISTRY_ENABLE="true" \
-e KIND_LOCAL_REGISTRY_NAME="kind-registry" \
-e KIND_LOCAL_REGISTRY_PORT="5000" \
-e DOCKER_HOST="host.docker.internal:2375" \
-e KUBEMACS_KIND_NAME="${KUBEMACS_USER}.kubemacs.kindname" \
-e KUBEMACS_INIT_DEFAULT_REPOS='https://github.com/cncf/apisnoop [email protected]:ii/hours.git' \
-e KUBEMACS_INIT_DEFAULT_REPOS_FOLDER='Projects' \
-e KUBEMACS_INIT_DEFAULT_DIR='Projects/apisnoop' \
-e KUBEMACS_INIT_DEBUG='true' \
-e KUBEMACS_INIT_ORG_FILE='Projects/apisnoop/deployment/k8s/local/tilt.org' \
-e KUBEMACS_INIT_DEBUG=true \
-v "c:\\.kube":/tmp/.kube \
--user root \
--network host \
-it \
--rm \
--privileged \
$KUBEMACS_IMAGE \
docker-init.sh
# -v /var/run/docker.sock:/var/run/docker.sock \
##+begin_src tmate :session foo:bar
kubectl exec -it kubemacs-0 -- tmate -S /tmp/ii.default.target.iisocket at
docker exec hh-kubemacs-control-plane kubectl get pod/kubemacs-0 --kubeconfig=/etc/kubernetes/admin.conf -o yaml
docker exec hh-kubemacs-control-plane kubectl describe pod/kubemacs-0 --kubeconfig=/etc/kubernetes/admin.conf
docker exec kubemacs-init kubectl config view
# docker exec kubemacs-init cat /root/.kube/config
KIND_CLUSTER_NAME=$(kind get clusters | tail -1) # assuming we only have one
docker exec ${KIND_CLUSTER_NAME}-control-plane kubectl config view --kubeconfig /etc/kubernetes/admin.conf
export KUBECONFIG=~/.kube/kind-berno.kubemacs.configname
kubectl exec kubemacs-0 kubectl config view
export KUBECONFIG=~/.kube/kind-berno.kubemacs.configname
kubectl config view
docker exec hh-kubemacs-control-plane kubectl logs kubemacs-0 --kubeconfig=/etc/kubernetes/admin.conf