Skip to content

A Bash script to automate the checking of Kubernetes cluster setup, including nodes, pods, services, deployments, namespaces, configmaps, metrics, events, and Helm releases. It provides a quick overview of the cluster's health and configuration status.

Notifications You must be signed in to change notification settings

Raafay892/K8S_CHECK

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Kubernetes Setup Check Script

This repository contains a Bash script that automates the process of checking various components of a Kubernetes cluster. The script provides a quick overview of the cluster's health and configuration status by running essential kubectl commands. It helps you verify nodes, pods, services, deployments, namespaces, configmaps, metrics, events, and Helm releases in your Kubernetes setup.

Features

  • Check the status of Kubernetes nodes
  • Get the cluster's control plane information
  • List all pods in the cluster
  • Retrieve services and deployments in the default namespace
  • List namespaces and configmaps across all namespaces
  • Display resource usage metrics for nodes and pods (if metrics-server is installed)
  • List events sorted by creation timestamp
  • Check Helm releases (if Helm is installed)

Prerequisites

  • Kubernetes: Ensure your cluster is up and running.
  • kubectl: The script assumes you have kubectl installed and configured to access your cluster.
  • Helm (optional): The script will check if Helm is installed and list Helm releases if available.
  • Metrics-server (optional): To retrieve metrics data for nodes and pods, you must have the metrics-server installed in your cluster.

Usage

  1. Clone this repository:

    git clone https://github.com/Raafay892/k8S_CHECK.git
    cd K8S_CHECK
  2. Make the script executable:

    chmod +x k8s_check.sh
  3. Run the script:

    ./k8s_check.sh

The script will output the status of your Kubernetes components in the terminal.

Script Overview

  • kubectl get nodes: Displays the nodes in the cluster.
  • kubectl cluster-info: Provides control plane information.
  • kubectl get pods --all-namespaces: Lists all pods across namespaces.
  • kubectl get svc: Lists services in the default namespace.
  • kubectl get deployments: Lists deployments in the default namespace.
  • kubectl get namespaces: Lists all namespaces.
  • kubectl get configmap --all-namespaces: Lists all configmaps across namespaces.
  • kubectl top nodes: Displays resource usage for nodes (if metrics-server is installed).
  • kubectl top pods --all-namespaces: Displays resource usage for pods (if metrics-server is installed).
  • kubectl get events --sort-by='.metadata.creationTimestamp': Lists events in the cluster sorted by creation timestamp.
  • helm list: Displays Helm releases (if Helm is installed).

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

A Bash script to automate the checking of Kubernetes cluster setup, including nodes, pods, services, deployments, namespaces, configmaps, metrics, events, and Helm releases. It provides a quick overview of the cluster's health and configuration status.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages