system-manager-wakasu
 1#!/usr/bin/env bash
 2
 3# Create session if it doesn't exists
 4NAME=$1
 5shift
 6SESSIONNAME=kubernix-${NAME}
 7KUBERNIX_ROOT=${HOME}/var/kubernix/${NAME}
 8tmux new-session -s "${SESSIONNAME}" -d || true
 9
10# Main window
11tmux send-keys -t "${SESSIONNAME}:0" "sudo kubernix --root=${KUBERNIX_ROOT} --nodes=3 --no-shell" C-m
12tmux split-window -t ${SESSIONNAME}:0 -p 66
13tmux rename-window -t ${SESSIONNAME}:0 kubernix
14tmux send-keys -t "${SESSIONNAME}:0" "export KUBECONFIG=${KUBERNIX_ROOT}/kubeconfig/admin.kubeconfig" C-m
15
16# Logs in other windows
17# cri-o logs
18tmux new-window -t ${SESSIONNAME}:1 -n cri-o tail -f ${KUBERNIX_ROOT}/crio/node-0/podman.log
19tmux split-window -t ${SESSIONNAME}:1 tail -f ${KUBERNIX_ROOT}/crio/node-1/podman.log
20tmux split-window -t ${SESSIONNAME}:1 tail -f ${KUBERNIX_ROOT}/crio/node-2/podman.log
21
22# kubelet
23tmux new-window -t ${SESSIONNAME}:2 -n kubelet tail -f ${KUBERNIX_ROOT}/kubelet/node-0/podman.log
24tmux split-window -t ${SESSIONNAME}:2 tail -f ${KUBERNIX_ROOT}/kubelet/node-1/podman.log
25tmux split-window -t ${SESSIONNAME}:2 tail -f ${KUBERNIX_ROOT}/kubelet/node-2/podman.log
26
27# apiserver & controller-manager
28tmux new-window -t ${SESSIONNAME}:3 -n k8s tail -f ${KUBERNIX_ROOT}/apiserver/kube-apiserver.log
29tmux split-window -t ${SESSIONNAME}:3 tail -f ${KUBERNIX_ROOT}/controllermanager/kube-controller-manager.log
30
31tmux select-window -t ${SESSIONNAME}:0