Note: To start with kubernetes install docker as we will use the docker driver
To Download kubernetes on MacOS:
Install kubectl binary with curl
-
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/darwin/arm64/kubectl"
-
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/darwin/arm64/kubectl.sha256"
-
echo "$(cat kubectl.sha256) kubectl" | shasum -a 256 --check
-
chmod +x ./kubectl
-
sudo mv ./kubectl /usr/local/bin/kubectl
-
sudo chown root: /usr/local/bin/kubectl
-
kubectl version --client --output=yaml
-
rm kubectl kubectl.sha256
To Download kubernetes on Windows:
-
curl.exe -LO "https://dl.k8s.io/release/v1.28.0/bin/windows/amd64/kubectl.exe"
-
curl.exe -LO "https://dl.k8s.io/v1.28.0/bin/windows/amd64/kubectl.exe.sha256"
-
CertUtil -hashfile kubectl.exe SHA256
-
type kubectl.exe.sha256
-
kubectl version --client --output=yaml
-
kubectl cluster-info
You will get the response: The connection to the server server-name:port was refused - did you specify the right host or port?
- kubectl cluster-info dump
Install minikube:
visit to download: https://minikube.sigs.k8s.io/docs/start/
Run minikube:
-
minikube start
-
kubectl get pot -A
-
minikube dashboard
Service:
-
kubectl create deployment hello-minikube --image=kicbase/echo-server:1.0
-
kubectl expose deployment hello-minikube --type=NodePort --port=8080
-
kubectl get services hello-minikube
-
kubectl port-forward service/hello-minikube 7080:8080
Tada! Your application is now available at http://localhost:7080/.
Some commands to manage cluster
- minikube pause
- minikube unpause
- minikube stop
- minikube config set memory 2048
- minikube addons list
- minikube delete --all
- minikube start -p aged --kubernetes-version=v1.16.1