Kubernetes Administration – Essential Commands for IFS Cloud

This guide covers practical Kubernetes (K8s) administration tasks including managing namespaces, pods, deployments, PVCs, and PVs. Ideal for teams working with IFS Cloud deployments on Kubernetes.

📁 Namespace Management

🔥 Delete a Namespace

            kubectl delete namespace hypdev --force

🧱 Pod Operations

❌ Delete or Recreate a Pod

            kubectl delete pod <pod-name> --grace-period=0 --force -n <namespace>

Example:

            kubectl delete pod ifsapp-reporting-86b484b7cc-zws87 --grace-period=0 --force -n hypprd

🔍 Describe a Pod

            kubectl describe pod <pod-name> -n <namespace>

Examples:

            kubectl describe pod ifsapp-proxy-xxxxxxxx-8k4ph -n hypprd
            kubectl describe pod ifs-db-init-bdrv9 -n hypprd

🚀 Deployments

📜 List All Deployments in a Namespace

            kubectl get deployments -n <namespace>

Example:

            kubectl get deployments -n hypprd

✏️ Edit a Deployment

            kubectl edit deployment <deployment-name> -n <namespace>

Scale Down Example:

Edit the replicas under spec section to 0 to stop a pod:

            spec:
              replicas: 0

Result after update:

kubectl get deployments -n hypprd
NAME                READY   UP-TO-DATE   AVAILABLE   AGE
ifs-file-storage    0/0     0            0           87m

📦 Persistent Volume Claims (PVCs)

📋 List All PVCs in a Namespace

            kubectl get pvc -n <namespace>

Example:

            kubectl get pvc -n hypprd

🔍 Describe a PVC


            kubectl describe pvc <pvc-name> -n <namespace>

Example:

            kubectl describe pvc ifs-fss-pvc-smb-hypprd-1285... -n hypprd

📄 Get YAML of a PVC

            kubectl get pvc <pvc-name> -n <namespace> -o yaml

🔄 PVC Management

🗑️ Delete a PVC (After Backup)

⚠️ Always take a YAML backup before deleting a PVC.

            kubectl delete pvc <pvc-name> -n <namespace>

✅ Recreate PVC from YAML

Before creating, remove the following from the YAML file:

            status:
              phase: Pending

Then:

            kubectl create -f pvc.yaml

💾 Persistent Volumes (PVs)

📋 List All PVs

            kubectl get pv

📄 Get YAML of a PV

            kubectl get pv <pv-name> -o yaml

✏️ Edit PV YAML

Backup first! Then:

            kubectl edit pv <pv-name>

To detach a PV from an old claim, remove the claimRef section manually.

✅ Final Result Verification

After recreation:

            kubectl get pvc -n hypprd

You should see the new PVC in Bound state:

NAME     STATUS   VOLUME                                   CAPACITY   ACCESS MODES   STORAGECLASS   AGE
...      Bound    ifs-fss-pv-smb-hypprd-1285fbb3...         95Gi       RWX            smb            18s

Comments

Popular posts from this blog

Managing Oracle Data Files – Resizing and Adding

Oracle Database Basic Consepts (Start / Stop / Check Database Status)