Search This Blog

Monday, October 28, 2024

Kubernetes cheat sheet

Below major cmdline cmds keep it handy to play in your playground easily..

kubectl get pods  ( listing of pods )
get services 
get deployments
get nodes 
kubectl get pods -o wide -A  ( all pods in all name spaces)
describe pod <podname>
describe service <sernamr>
apply -f <yaml>
delete pod <podname>
delete -f <yamlfilename>
logs <podname>
logs <podname> -c container name
-exec podname --shellname (to login)
scale deployement depname --replicas=n
expose deployment 
port-forward podname port1:port2
rollout status deployment/depname
config get-context
config use-context contxtname
config view 




Monday, October 21, 2024

Kubernetes Networks a Nightmare

Heartbeat of Kuberntes is its network by which pods, nodes, services work, you see lot of hickups in configuring the infra and network from scratch.I suggest to for readymade networking models and service meshes avilable in market, typically enterprise versions.
If you are familiar with basics networking ips in Kuberntes, It has
- Node IP for pod to pod communication between the nodes
- PodIP - a single ip of each pod,
 -Virtaual ip to represent a group of pods is your Service IP

I am briefying here some of the best practices you can consider while setting up your ip.
1.Use mesh like Linkerd
2.Use DNS to resolve your ips of nodes and pods
3.Better to allocate node,pod and service ips in different vpc/networks.

You can connect with me if any assistance required in setting up the Kubernetes cluster, taking up services, deployments and in configuring service meshes.

Thank you, happy reading.