== kbmaster == apt update apt -y install curl apt-add-repository apt -y install docker.io systemctl enable docker curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add apt-add-repository "deb http://apt.kubernetes.io/ kubernetes-xenial main" apt -y install kubeadm kubeadm init --pod-network-cidr=10.244.0.0/16 mkdir -p $HOME/.kube sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config sudo chown $(id -u):$(id -g) $HOME/.kube/config kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml kubectl get pods --all-namespaces echo “[WARNING] get join command” echo “Command after join new node: kubectl get nodes” kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/master/aio/deploy/recommended/kubernetes-dashboard.yaml kubectl proxy --address 0.0.0.0 -p 80 --accept-hosts='^143.106.16.*$,^xaveco.lab.ic.unicamp.br$' --disable-filter=true kubectl apply -f https://www.ic.unicamp.br/~william/howto/dashboard-adminuser.yaml kubectl apply -f https://www.ic.unicamp.br/~william/howto/role-adminuser.yaml kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep admin-user | awk '{print $1}') == kbnode == apt update apt -y install curl apt-add-repository apt -y install docker.io systemctl enable docker curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add apt-add-repository "deb http://apt.kubernetes.io/ kubernetes-xenial main" echo “execute join command” == Get Token == kubectl get secrets -o jsonpath="{.items[?(@.metadata.annotations['kubernetes\.io/service-account\.name']=='default')].data.token}"|base64 --decode kubectl config set newconfig kubectl proxy # URL: http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/#/node?namespace=default Create kubeconfig file with kubectl [[http://docs.shippable.com/deploy/tutorial/create-kubeconfig-for-self-hosted-kubernetes-cluster/|http://docs.shippable.com/deploy/tutorial/create-kubeconfig-for-self-hosted-kubernetes-cluster/]] apiVersion: v1 clusters: - cluster: insecure-skip-tls-verify: true server: https://server.x.x:8443 name: minikube contexts: - context: cluster: minikube user: minikube name: minikube current-context: minikube kind: Config preferences: {} users: - name: minikube user: client-certificate: /home/william/.minikube/profiles/minikube/client.crt client-key: /home/william/.minikube/profiles/minikube/client.key Dashboard: [[https://kubernetes.io/docs/tasks/access-application-cluster/web-ui-dashboard/|https://kubernetes.io/docs/tasks/access-application-cluster/web-ui-dashboard/]] http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/ Como eh link [[http://localhost:8001/api/v1/namespaces/istio-system/services/http:kiali:9090/proxy/|http://localhost:8001/api/v1/namespaces/istio-system/services/http:kiali:9090/proxy/]] == Minikube kvm2 == curl -LO https://storage.googleapis.com/minikube/releases/latest/docker-machine-driver-kvm2 chmod +x docker-machine-driver-kvm2 sudo mv docker-machine-driver-kvm2 /usr/local/bin/ docker-machine-driver-kvm2 version minikube config set vm-driver kvm2 cat .minikube/config/ minikube start --nodes 2 # or # minikube start --nodes 2 --vm-driver kvm2 == nginx ingress baremetal == kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v0.47.0/deploy/static/provider/baremetal/deploy.yaml kubectl get all -n ingress-nginx kubectl edit deployment.apps/ingress-nginx-controller -n ingress-nginx and redeploy or kubectl edit replicaset.apps/ingress-nginx-controller-XXXXXXXXXX -n ingress-nginx Others options: [[https://kubernetes.github.io/ingress-nginx/deploy/baremetal/|https://kubernetes.github.io/ingress-nginx/deploy/baremetal/]] UI K8S https://medium.com/geekculture/yakd-yet-another-kubernetes-dashboard-7766bd071f30 https://engineering.indeedblog.com/blog/2020/11/k8dash-indeeds-open-source-kubernetes-dashboard/ https://williamlam.com/2020/04/useful-interactive-terminal-and-graphical-ui-tools-for-kubernetes.html https://opensource.com/article/20/6/kubernetes-lens