Sunday, June 7, 2026

day-to-day commands in minikube and KinD

 Minikube

docker context use default

docker context ls

minikube start 
minikube start --nodes 3
minikube start --driver=<driver name>   e.g. "docker" , "virtualbox" 

minikube config set driver <driver_name>

minikube profile list

minikube status

minikube delete --all --purge

minikube node add
kubectl get nodes

minikube node delete minikube-m02


kubectl get pods    <= get user created pods
kubectl get pods -n kube-system   <= get system created pods

//GET network pluggin
kubectl get pods -n kube-system | grep -E "net|cni|flannel|calico|cilium|kube-router|kindnet"
kubectl get nodes -o jsonpath='{.items[*].status.images[*].name}' | tr ' ' '\n' | grep -E "cni|kindnet|calico|flannel|cilium" | sort -u

minikube ssh "ls /etc/cni/net.d/"
  • If it returns 10-kindnet.conflist, your network plugin is Kindnet. (kindnet is default for minikube)
  • If it returns 10-calico.conflist or k8s.d/, it will list the respective active plugin.

  • kubectl get configmaps
    kubectl get secrets

    kubectl describe configmap <configmap-name>


    kubectl describe node <node-name>
    kubectl describe node minikube-m02
    kubectl describe pods
    kubectl describe nodes


    To know what details k8s gives on executing a command, kubectl explain <resource> e.g. kubectl explain pods

    kubectl api-resources
    kubectl api-versions <= list all versions that can be used in "apiVersion" field of any yaml file.


    =========================================================
    KinD
    kind --version

    kind get clusters
    kind create cluster 

    by default kind creates a cluster named "kind", which appears as "kind-kind" on list of clusters. 
    by default kind creates a cluster with  one control plane and two nodes. 

    to create  named cluser : 
    Creation should be done in "wsl -d Ubuntu" environment. this can be invoked through powershell.
    kind create cluster --name mycluster
    kind delete cluster --name mycluster

    to alter the number of nodes created, create a yaml file and use it.

    ==================
    my-kind-config.yaml
    ==================
    kind: Cluster
    apiVersion: kind.x-k8s.io/v1aplha4
    nodes:
    - role: control-plane
    - role: worker
    - role: worker
    ==================
    NOTE: apiVersion is required, other wise you will get "unknown apiVersion" error. 

    kind create cluster --name mycluster --config my-kind-config.yaml


    kubectl get nodes
    NAME                      STATUS     ROLES           AGE   VERSION
    mycluster-control-plane   Ready   control-plane   22s   v1.33.1
    mycluster-worker          Ready   <none>          10s   v1.33.1
    mycluster-worker2         Ready   <none>          10s   v1.33.1

    NOTE: even if you have both minikube and kind running, kind nodes will be seen in wsl only and minikube nodes from  PS/normal command prompt only. 



    kubectl rollout restart daemonset prometheus-prometheus-node-exporter -n monitoring
    daemonset.apps/prometheus-prometheus-node-exporter restarted

    kubectl port-forward prometheus-grafana-649459765f-ncbxv  3000 -n monitoring
    kubectl port-forward <pod-name> <host-computer-port> -n <namespace>


    kubectl --namespace monitoring get secrets prometheus-grafana -o jsonpath="{.data.admin-password}" | base64 -d ; echo



    helm list --all-namespaces
    NAME            NAMESPACE       REVISION        UPDATED                                 STATUS          CHART                           APP VERSION
    node-exporter   monitoring      1               2026-06-08 09:38:00.795361989 +0000 UTC deployed        prometheus-node-exporter-4.55.0 1.11.1
    prometheus      monitoring      1               2026-06-08 09:23:33.520121361 +0000 UTC deployed        kube-prometheus-stack-86.2.0    v0.91.0

    No comments:

    Post a Comment

    Data Types in C# and other languages

    The following reference table compares commonly used C# numeric, scientific computing, and AI-oriented data types with their equivalents ...