k8s

https://kodekloud.com/courses/kubernetes-for-the-absolute-beginners-hands-on/

https://kodekloud.com/wp-content/uploads/2021/10/KubernetesForBeginners-MumshadMannambeth-2.pdf

k8s overview

k8s architecture
Components

When you install Kubernetes on a System, you are actually installing the following
components. An API Server. An ETCD service. A kubelet service. A Container Runtime,
Controllers and Schedulers.
The API server acts as the front-end for kubernetes. The users, management devices,
Command line interfaces all talk to the API server to interact with the kubernetes
cluster.
Next is the ETCD key store. ETCD is a distributed reliable key-value store used by
kubernetes to store all data used to manage the cluster. Think of it this way, when you
have multiple nodes and multiple masters in your cluster, etcd stores all that
information on all the nodes in the cluster in a distributed manner. ETCD is
responsible for implementing locks within the cluster to ensure there are no conflicts
between the Masters.
The scheduler is responsible for distributing work or containers across multiple
nodes. It looks for newly created containers and assigns them to Nodes.
28
The controllers are the brain behind orchestration. They are responsible for noticing
and responding when nodes, containers or endpoints goes down. The controllers
makes decisions to bring up new containers in such cases.
The container runtime is the underlying software that is used to run containers. In our
case it happens to be Docker.
And finally kubelet is the agent that runs on each node in the cluster. The agent is
responsible for making sure that the containers are running on the nodes as
expected

kubectl run hello-minikube
kubectl cluster-info
kubectl get nodes

k8s concepts

pods
kubectl run nginx --image nginx
kubectl get pods
install kubectl

https://kubernetes.io/docs/tasks/tools/install-kubectl-linux

https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/#install-kubectl-binary-with-curl-on-linux

https://minikube.sigs.k8s.io/docs/start

 minikube start --driver virtualbox
saeb@acer ~> minikube status
minikube
type: Control Plane
host: Running
kubelet: Running
apiserver: Running
kubeconfig: Configured
saeb@acer ~> kubectl get nodes
NAME       STATUS     ROLES           AGE   VERSION
minikube   NotReady   control-plane   22h   v1.28.3
saeb@acer ~> 
kubectl get po -A
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
minikube service hello-minikube

Alternatively, use kubectl to forward the port:

kubectl port-forward service/hello-minikube 7080:8080
demo pods
kubectl run nginx --image=nginx
kubectl get pods
kubectl get pods -o wide
kubectl describe pods nginx
پسندها(0)شاکی(0)

دیدگاهتان را بنویسید

نشانی ایمیل شما منتشر نخواهد شد. بخش‌های موردنیاز علامت‌گذاری شده‌اند *

این سایت از اکیسمت برای کاهش هرزنامه استفاده می کند. بیاموزید که چگونه اطلاعات دیدگاه های شما پردازش می‌شوند.