投稿時間:2023-08-14 02:02:23 RSSフィード2023-08-14 02:00 分まとめ(4件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
python Pythonタグが付けられた新着投稿 - Qiita torchvisionの実装から見るFaster R-CNN https://qiita.com/ground0state/items/08be7707069bdba10100 fasterrcnn 2023-08-14 01:14:24
golang Goタグが付けられた新着投稿 - Qiita Goの標準ライブラリだけでJWTをデコードしてみたら意外と簡単だったwww https://qiita.com/WisheeBell/items/51dd7be88b927d468053 簡単 2023-08-14 01:22:07
海外TECH DEV Community K8s Pods https://dev.to/scorcism/k8s-pod-d7l Ks PodsAs previously discussed ks provide us with the following features By default cluster in nature which fixes the issue of a single host Auto healing which helps with zero downtime Auto scaling helps in scaling the application Multiple enterprise level supportsIn ks the lowest level of deployment is pod If we compare this to docker In docker we deploy the containers In Docker we used to create a container and we deploy that container but in ks we cannot directly deploy the container in ks we will use these containers but as a pod So now you may be thinking What is pod and why we should deploy our container as a pod hold let me explain you In docker if we want to run a continer we execute docker run d it name containerImae p x x ImageName In this command you can see that all of these arguments are passed in command line to run the container Which becomes quite lengtly most of the time Which is not much supported for enterprise solution and this is one of the fundamental advantage of ks To overcome this What ks want us to do is Create a yml file and mention everything inside that file Usually the pod manifest file are called as pod ymlIn ks everything is writeen with yml file If you are unfamiliar with the yml you can follow this So now we can say A pod can be described as a defination of how to run a container Pod basically is a wrapper or a concept that is similar to container but it abstracts the defined commands arguments in pod ymlA pod is just a wrapper over a container A pod can contain a single container or a multiple container If pod contains multiple containers ks provide some advantages If you put group of container in one single pod then ks will allow to share networking share resources among the containers this way container a and container b inside a single pod can talk to each other using localhost Which eventually explains that there is a pod and inside that pod we have a container ks allocates a Cluster Ip address to the pod and you can access the application inside the pod using Pod Cluster Ip addressIp addresses are generated for the pods not the conatiner kube proxy will generate the ip address Working with the PodsIn docker when ever we want to run any command we have docker cli Similarly in ks we have kubectl kubectl is command line for ks You can follow this guild to Install kubectlWe will use minkube for learning To Install minikube follow thisIf you dont know what is minikube you can follow this blogIn simple words what minikube will do is it will create a VM first on top of this this will create a single node kubernetes cluster Working with podsStart minikubeminikube start ks cluster will be started Goto your notes directory and create a file pod ymlNow the question all these are okay but how and what should be inside the pod If I say you dont need to remeber what all things should be inside the pod yml you will be surprised but this is the truth you should only rember the keyword and rest you can copy from this and change as per your requirement Slowly when you start practicing you will automatically learn all the required args This in page mentioned above you can see a code snippet like thisapiVersion v kind Podmetadata name nginxspec containers name nginx image nginx ports containerPort Let s understand the file line by line apiVersion v gt This indicates that the configuration is using the Kubernetes API version kind Pod gt This specifies that you are creating a Pod metadata gt This section contains metadata about the Pod such as its name name gt This assigns the name nginx to the Pod spec gt The spec section defines the desired state of the Pod containers gt This is where you define the containers that will run inside the Pod In this case there is one container definition name nginx gt This assigns the name nginx to the container image nginx gt This specifies the Docker image to be used for the container In this case it s the official Nginx image with version ports gt This section defines the ports that the container will listen on containerPort gt This specifies that the container will listen on port This is the standard port for HTTP traffic which is commonly used for web servers like Nginx Now running executing the pod file Get all the podskubectl get pods Get brief info about all the podskubectl get pods o wide Execute the new create pod ymlkubectl apply f pod ymlCheck status of the pods Get all the running podskubectl get pods kubectl get pods o wideNow as you can see the STATUS of the pods is running and NAME is nginx as mentioned in the yml file and the Ip address is also assigned to the pod But to access that we need to login into minikube cluster As in our case minikube is the Master node we need to login into the minikube but in production you will need to login into your master node that can be an ec instance or anything To access the applicationminukube ssh as its cmd we can use curl to fetch the contentcurl lt Ip address gt Verify the applicationkubectl logs nginxkubectl descibe pod nginx You can check all the kubectl commands here at kubectl cheetsheet Now you may be thinking that abhishek where is the feature of auto scaling or auto healingOn top of the pod we have a wrapper called deployment So we have to use deployment to use the features like auto healing and auto scaling In production you will we deploy pods you will deploy deployments Which we will learn in next blog If you have interest in open source you can contribue to my projects One LinerClick CounterIf the article helps you leave a like follow or anything You can follow me on LinkedIn GitHub Dev to and hashnode Bye 2023-08-13 16:05:45
ニュース BBC News - Home Ministers face renewed pressure over boat crossings https://www.bbc.co.uk/news/uk-66490218?at_medium=RSS&at_campaign=KARANGA boats 2023-08-13 16:39:25

コメント

このブログの人気の投稿

投稿時間:2021-06-17 05:05:34 RSSフィード2021-06-17 05:00 分まとめ(1274件)

投稿時間:2021-06-20 02:06:12 RSSフィード2021-06-20 02:00 分まとめ(3871件)

投稿時間:2020-12-01 09:41:49 RSSフィード2020-12-01 09:00 分まとめ(69件)