This commit is contained in:
Adolfo Delorenzo 2021-07-06 19:28:47 -06:00
parent d1cbb39ca1
commit 3321a59e23
2 changed files with 20 additions and 27 deletions

View File

@ -10,11 +10,6 @@
#apt-get update #apt-get update
#apt-get install docker-ce docker-ce-cli containerd.io -y #apt-get install docker-ce docker-ce-cli containerd.io -y
#Install kind kubernetes
# apt -y install golang-go
# GO111MODULE="on" go get sigs.k8s.io/kind@v0.11.1
# echo 'export PATH=$PATH:/root/go/bin' >> /root/.bashrc && source /root/.bashrc
#Install kubectl #Install kubectl
#apt update #apt update
#apt-get install -y apt-transport-https ca-certificates curl #apt-get install -y apt-transport-https ca-certificates curl
@ -23,42 +18,40 @@
#apt-get update #apt-get update
#apt-get install -y kubectl #apt-get install -y kubectl
#Create a kind cluster #Create a minikube
#cat <<EOF >> portainer.yaml #curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube_latest_amd64.deb
## a cluster with 3 control-plane nodes and 3 workers #dpkg -i minikube_latest_amd64.deb
#kind: Cluster
#apiVersion: kind.x-k8s.io/v1alpha4
#nodes:
#- role: control-plane
# extraPortMappings:
# - containerPort: 30778
# hostPort: 30778
#- role: worker
#- role: worker
#- role: worker
#EOF
#kind create cluster --config portainer.yaml
#Install the Metrics Server
#kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
#Install httpie #Install httpie
# apt -y install httpie #apt -y install httpie
#Install Portainer #Install Portainer
#docker volume create portainer_data #docker volume create portainer_data
#docker run -d -p 8000:8000 -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce #docker run -d -p 8000:8000 -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce
#Define Admin user and Password #Define Admin user and Password
#http POST http://localhost:9000/api/users/admin/init Username="portainer" Password="portainer" #http POST http://localhost:9000/api/users/admin/init Username="portainer" Password="portainer1234"
#Get the admin JWT token
#http POST :9000/api/auth Username="portainer" Password="portainer1234"
#jwt=`http POST :9000/api/auth Username="portainer" Password="portainer1234" | jq '.jwt' | sed 's/^.//' | sed 's/.$//'`
#Add local Docker endpoint #Add local Docker endpoint
#http --form POST :9000/api/endpoints \ #http --form POST :9000/api/endpoints \
#"Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwidXNlcm5hbWUiOiJwb3J0YWluZXIiLCJyb2xlIjoxLCJleHAiOjE2MjU2MzUxNzB9.RF6-DxP_HAdRwkpi3fPTr7YPjzTBsaioi9Au3njY0YI" \ #"Authorization: Bearer $jwt" \
#Name="docker" EndpointCreationType=1 #Name="docker" EndpointCreationType=1
#Add the portainer user to the docker group
usermod -aG docker portainer && newgrp docker
#Start minikube
sudo -u portainer minikube start
#Add the metrics server to the minikube cluster
sudo -u portainer minikube addons enable metrics-server
#Add Portainer Agent to the local kind Kubernetes cluster #Add Portainer Agent to the local kind Kubernetes cluster
curl -L https://downloads.portainer.io/portainer-agent-k8s-nodeport.yaml -o portainer-agent-k8s.yaml; kubectl apply -f portainer-agent-k8s.yaml # curl -L https://downloads.portainer.io/portainer-agent-k8s-nodeport.yaml -o portainer-agent-k8s.yaml; kubectl apply -f portainer-agent-k8s.yaml
#sleep 30 #sleep 30
#Add local Kubernetes endpoint #Add local Kubernetes endpoint

BIN
minikube_latest_amd64.deb Normal file

Binary file not shown.