MIT License
MacWindowsLinux Docker Cluster
Virtual Box NAT ****
ssh demo@VM_IP # default pwd 123456
sudo passwd root
su -
Root
ifconfig | grep 1
sudo apt-get update -y
sudo apt-get install \
ca-certificates \
curl \
gnupg \
lsb-release net-tools -y
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update -y
sudo apt-get install docker-ce docker-ce-cli containerd.io -y
sudo docker run hello-world
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update -y
sudo apt-get install python3-pip -y
sudo apt-get install python3.8 -y
apt-cache madison docker-ce # find version
sudo apt-get install docker-ce=<VERSION_STRING> docker-ce-cli=<VERSION_STRING> containerd.io
k3d
wget -q -O - https://raw.githubusercontent.com/rancher/k3d/main/install.sh | bash
kubectl
command linecurl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
chmod +x kubectl
mkdir -p ~/.local/bin/kubectl
mv ./kubectl ~/.local/bin/kubectl
source from https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/
git clone https://github.com/louis70109/cloud_edge_summit_chatops.git
VM GitHub
SHA
ssh-keygen
cat .ssh/id_rsa.pub
GitHub settings
cd cloud_edge_summit_chatops/
k3d cluster create testcluster --agents 1 -p "31110-31112:31110-31112@server:0"
kubectl create ns kube-ops
kubectl apply -f prometheus/
kubectl apply -f api/
prometheus/
: Metricsapi/
: APIcd bot_proxy/
mv .env.example .env # vim to edit it
pip3 install -r requirements.txt --user
python3 api.py
NodeJS, ngrok NodeJS https://nodejs.org/zh-tw/download/
npx ngrok http --authtoken 'YOUR_NGROK_TOKEN' -region=ap --host-header=rewrite IP:8000
refs: https://ngrok.com/docs
Bash Item API Deployment
while [ 1 ]
do
curl IP:31110/items; sleep 1s
curl -X POST IP:31110/items; sleep 1s
curl -X POST IP:31110/items\?name=1; sleep 1s
done
chatbot
lens k9s Cluster k9s
namespace -n
kubectl get pods -n kube-ops
kubectl get svc -n kube-ops
Mac brew k3d kubectl
brew install k3d
brew install kubectl