{"id":315,"date":"2023-06-28T22:38:46","date_gmt":"2023-06-28T20:38:46","guid":{"rendered":"https:\/\/activum24.pl\/?p=315"},"modified":"2024-07-01T11:42:56","modified_gmt":"2024-07-01T09:42:56","slug":"podstawy-kubernetes-minikube-cz-1","status":"publish","type":"post","link":"https:\/\/activum24.pl\/index.php\/2023\/06\/28\/podstawy-kubernetes-minikube-cz-1\/","title":{"rendered":"Podstawy Kubernetes &#8211; minikube"},"content":{"rendered":"\n<p>Instalacja i zapoznanie si\u0119 z podstawowymi poleceniami kubectl.<\/p>\n\n\n\n<p>sudo apt-get install -y ca-certificates curl<br>curl -fsSL https:\/\/packages.cloud.google.com\/apt\/doc\/apt-key.gpg | sudo gpg &#8211;dearmor -o \/etc\/apt\/keyrings\/kubernetes-archive-keyring.gpg<br>echo &#8222;deb [signed-by=\/etc\/apt\/keyrings\/kubernetes-archive-keyring.gpg] https:\/\/apt.kubernetes.io\/ kubernetes-xenial main&#8221; | sudo tee \/etc\/apt\/sources.list.d\/kubernetes.list<br>sudo apt-get update<br>sudo apt-get install -y kubectl<br>kubectl cluster-info<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>apiVersion: v1<br><br>kind: Pod<br><br>metadata:<br>  name: pod2<br><br>spec:<br> containers:<br>  &#8211; name: ubuntu<br>    image: ubuntu:18.04<br>    command: [ &#8222;sleep&#8221;, &#8222;inf&#8221; ]<br>  &#8211; name: nginx<br>    image: nginx<br>    ports:<br>      &#8211; containerPort: 80<br><\/p>\n\n\n\n<p>minikube start<br>kubectl get pods<br>minikube<br>minikube dashboard<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>mkdir minikube<br>touch pod.yml<br>kubectl create -f .\/pod.yml<br>kubectl apply -f .\/pod.yml<br>kubectl delete -f .\/pod.yml<br>kubectl apply -f .\/pod.yml<br>kubectl get pods<br>kubectl get pods -o wide<br>minikube ssh<br>kubectl delete -f .\/pod.yml<br>kubectl apply -f .\/ubuntu.yml<br>kubectl get pods -o wide<br>kubectl desciribe pod mojeubuntu<br>kubectl describe pod mojeubuntu<br>kubectl get pods -o wide<br>kubectl edit pod mojeubuntu<br>kubectl apply -f .\/ubuntu.yml<br>kubectl delete -f .\/ubuntu.yml<br>kubectl apply -f .\/ubuntu.yml<br>kubectl exec mojeubuntu ps aux<br>kubectl exec mojeubuntu<br>kubectl exec mojeubuntu ps aux<br>kubectl exec -it mojeubuntu bash<br>kubectl get pods -o wide<br>kubectl delete -f .\/ubuntu.yml<br>kubectl apply -f .\/pod2.yml<br>kubectl get pods -o wide<br>kubectl logs pod2<br>kubectl logs pod2 nginx<br>kubectl logs pod2 ubuntu<br>kubectl logs pod2<br>kubectl exec -it pod2 bash<br>kubectl exec -c nginx -it pod2 bash<br>kubectl get pods -o wide<br>kubectl exec -it pod2 bash<br>kubectl delete -f .\/pod2.yml<br>kubectl run nginx &#8211;image=nginx &#8211;dry-run=client -o yaml>nginx2.yml<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Instalacja i zapoznanie si\u0119 z podstawowymi poleceniami kubectl. sudo apt-get install -y ca-certificates curlcurl -fsSL https:\/\/packages.cloud.google.com\/apt\/doc\/apt-key.gpg | sudo gpg &#8211;dearmor -o \/etc\/apt\/keyrings\/kubernetes-archive-keyring.gpgecho &#8222;deb [signed-by=\/etc\/apt\/keyrings\/kubernetes-archive-keyring.gpg] https:\/\/apt.kubernetes.io\/ kubernetes-xenial main&#8221; | sudo tee \/etc\/apt\/sources.list.d\/kubernetes.listsudo apt-get updatesudo apt-get install -y kubectlkubectl cluster-info apiVersion: v1 kind: Pod metadata: name: pod2 spec: containers: &#8211; name: ubuntu image: ubuntu:18.04 command: [ &#8222;sleep&#8221;,&hellip;&nbsp;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","footnotes":""},"categories":[1],"tags":[121,120,122],"class_list":["post-315","post","type-post","status-publish","format-standard","hentry","category-hardware","tag-konteneryzacja","tag-kubernetes","tag-minikube"],"_links":{"self":[{"href":"https:\/\/activum24.pl\/index.php\/wp-json\/wp\/v2\/posts\/315","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/activum24.pl\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/activum24.pl\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/activum24.pl\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/activum24.pl\/index.php\/wp-json\/wp\/v2\/comments?post=315"}],"version-history":[{"count":4,"href":"https:\/\/activum24.pl\/index.php\/wp-json\/wp\/v2\/posts\/315\/revisions"}],"predecessor-version":[{"id":533,"href":"https:\/\/activum24.pl\/index.php\/wp-json\/wp\/v2\/posts\/315\/revisions\/533"}],"wp:attachment":[{"href":"https:\/\/activum24.pl\/index.php\/wp-json\/wp\/v2\/media?parent=315"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/activum24.pl\/index.php\/wp-json\/wp\/v2\/categories?post=315"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/activum24.pl\/index.php\/wp-json\/wp\/v2\/tags?post=315"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}