Monday, September 5, 2022

kubernets commands


kubectl run ngix --image=(img name) --- run the pods

kubectl get pods ---- to check the pod's details

kubectl describe pod (image name) --- details the pod

kubectl get nodes --- to display the nodes

kubectl get pods -o wide ---- to display the

kubectl create deployment (name) ---- create deployment

kubectl edit deployment (name) --- edit deployment

kubectl delete deployment (name) --- delete deployment

status of different k8s components
kubectl get nodes | pod | services | replicaset

kubectl delete pod (podname) --- to delete a single

kubectl logs (pod name) --- log to console

kubectl exec -it (pod name) --- bin/bash -- get

yml:
apiVersion: v1
kind: Pod
metadata:
name: myapp-pod
labels:
app:
spec:
container:
- name: nginx-con
image: nginx

kubectl create -f pod-definition.yml ---- to create k8s yml

kubectl apply -f pod.yml ---- same as create command

kubectl run nginx --image=nginx --- to create an image

kubectl describe pod (pod name) ---- to check the

kubectl delete pod (pod name) --- to delete the

kubectl run nginx --image=nginx --dry-run=client -o yaml > pod.yaml

kubectl edit pod (name) --- to edit the configuration

kubectl get replicationcontroller ------ to see the replication on

kubectl replace -f replica.yml ------ to replace the file

kubectl scale --replicas=6 -f replica.yml ----- another way to

kubectl get rs ----- to display the replicasets

kubectl describe pods ----- to display the error on

kubectl create -f /root/replicaset-definition-1.yaml ---- to locate in root

kubectl scale rs new-replica-set --replicas=5 ---- to replica 5

kubectl get all --- to see all commands thats

kubectl get deployments ---- to get the deployments

kubectl set image deployment

kubectl rollout status deployment ----- to check the status

kubectl rollout history deployment ----- to check the history

kubectl rollout undo deployment ----- to undo the rollout

kubectl get svc ---- to list the service where

kubectl describe svc kubernetes ----- to display the port

master node
-api server ---- for all communication
-scheduler ----- schedules pods on nodes
-controller manager ---- runs controllers
-etcd --- open source , distributed key-value database from

worker node
-kubelet
-kube-proxy
-container runtime

use kind commends
kind create cluster --name (sai)
kind delete cluster --name (sai)

minikube service (name) --url ---- to print the ip

kubectl get pod name -o yaml | more -----

kubectl get pod name -o wide ----- to display

kubectl exec -it name -- /bin/sh ----- to run

kubectl delete pod name ---- to delete the pod

container communicate with another container using localhost:port using network

pod communicate with another pod using eathernet device using

node communicate with another node using route table with

nodeePort range --- 30000 to 32767

clusterip ---- used to communicate with application a and

application a call from node port application b send

ingress is used to connect with nodeports on mapping

networking{
cluster-ip ----- is a virtual ip
node port

No comments:

Post a Comment

Argocd with rollouts examples

examples in My github https://github.com/krishnansai/argocd-rollouts.git ArogoCd with ArgoRollouts Rollouts.yml # This example demonst...