-
-
Notifications
You must be signed in to change notification settings - Fork 0
Container Orchestrator Kubernetes
- Kubernetes
- kubectl
- minikube
- microk8s
Kubernetes: The orchestrator
kubectl: The orchestator cli
minikube: Allow to have a local cluster with a single node (used to test kubernetes locally)
microk8s: Allows to define a multicluster kubernetes node on linux ubuntu running on both bare metal, VM or on windows WSL2
kubectl version
kubectl --help
minikube version
minikube --helpThe basic commands to monitor your cluster -official-
kubectl get deployments
kubectl get nodes
kubectl get services
kubectl get pods
kubectl get storageclass
# Delete resources
kubectl delete --all storageclass
kubectl delete --all services
kubectl delete --all pods
kubectl delete --all deployments
kubectl delete --all nodes
kubectl get service --watch
kubectl get service qrcode-backend-service --watchHow to create a namespace
kubectl create namespace genocsHow to run a deployment
kubectl apply -f azure-vote.yamlHow to run single image (will be removed)
kubectl run kuberneteters-boocamp --image=gcr.io/google-samples/kuberneters-bootcamp:v1 --port=8080
kubectl run genocs-qrcode2 --image=genocs/qrcode:latest --port=8083The following procedure can be used both on bare metal VM or WSL2
The procedure has been validated on Ubuntu 20.04
Check snap
snap list
snap refresh microk8s -edgekubectl create clusterrolebinding add-on-cluster-admin --clusterrole=cluster-admin --serviceaccount=kube-system:kubeconfig-sa
$TOKENNAME=`kubectl -n kube-system get serviceaccount/kubeconfig-sa -o jsonpath='{.secrets[0].name}'`
kubectl -n kube-system get secret $TOKENNAME -o jsonpath='{.data.token}'How to get the token
token=$(microk8s kubectl -n kube-system get secret | grep default-token | cut -d " " -f1)
microk8s kubectl -n kube-system describe secret $tokenHow to check the list of services and forward the post to allow access to the dashboard from windows host
microk8s kubectl get services -A
microk8s kubectl -n kube-system port-forward --address 0.0.0.0 service/kubernetes-dashboard 5000:443
redis-server-7db4b86f-frmnl
kubectl port-forward genocs-solomon-frontend-68bd5f656c-7xxzr 5002:5002- Install the dashboard plugin
- Get the daskboard login token
- Run the daskboard
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0/aio/deploy/recommended.yaml
kubectl -n kube-system describe secret token
kubectl proxyTo run the dashboard
minikube dashboard (--url)The dashboard URL
http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/(. | #/login)
wsl hostname -I
microk8s status
microk8s kubectl get all --all-namespaces
microk8s kubectl apply -f qrcode.yamlmicrok8s kubectl get services -A
microk8s kubectl -n kube-system port-forward --address 0.0.0.0 service/kubernetes-dashboard 5000:443
kubectl port-forward 'service name' 5002:5002az group create --name RG-k8 --location eastus
az aks create --resource-group RG-k8 --name genocsAKSCluster --node-count 1 --enable-addons monitoring --generate-ssh-keys
az aks get-credentials --resource-group RG-k8 --name genocsAKSCluster
kubectl get nodes
az acr list --resource-group RG-k8 --query "[].{acrLoginServer:loginServer}" --output table
az aks create --resource-group RG-k8 --name genocsAKSCluster --node-count 1 --enable-addons monitoring --generate-ssh-keys --attach-acr genocsContainerRegistry
kubectl get service solomonbesearch --watch
az login
az acr login --name 'acrName'
az acr login --name genocsContainerRegistry-
Setup the project
- Describe the idea
- Identify the product shape
-
Project management
- Define the MVP (Minimum Viable Product)
- Identify the KPIs (Key Performance Indicators)
- Define the process
- Identify and define the roadmap, checkpoints, deadlines
-
Implement the solution
- Patterns and practices
- Technologial Stack
- Tools, languages, libraries and services
-
Operations maintenance support and feedback
- Strategical organization
- Pratical implementation