Sign inSign up

arconixforge/k8-analyzer

By arconixforge

•Updated over 1 year ago

Kubernetes resource analyzer for monitoring and storing cluster configuration data

Image
Developer tools
Monitoring & observability
0

110

arconixforge/k8-analyzer repository overview

⁠k8-analyzer

A Kubernetes resource analyzer that collects and stores information about deployments, statefulsets, jobs, environment variables, configmaps, and secrets across specified namespaces.

Docker Pulls Artifact Hub

šŸ“– MEDIUM → https://medium.com/@arconixforge⁠ šŸ’» Git → https://github.com/ArconixForge⁠ 🐳 Docker → https://hub.docker.com/u/arconixforge⁠ šŸ“¦ Artifact → https://artifacthub.io/packages/search?user=ArconixForge⁠ 🐳 X → https://x.com/ArconixForge⁠

⁠Features

  • Collects container images used in deployments, statefulsets, and jobs
  • Gathers environment variables from all workloads
  • Captures ConfigMap and Secret data
  • Stores collected data in PostgreSQL database
  • Configurable namespaces and collection intervals
  • Continuous monitoring with customizable polling frequency

⁠Prerequisites

  • Kubernetes cluster with RBAC enabled
  • PostgreSQL database
  • Kubernetes RBAC permissions to read resources in target namespaces

⁠Quick Start

# Pull the Docker image
docker pull arconixforge/k8-analyzer:v5.0

# Deploy using Helm
helm repo add arconixforge https://artifacthub.io/packages/helm/k8-analyzer
helm install k8-analyzer arconixforge/k8-analyzer

⁠Configuration

⁠Environment Variables
VariableDescriptionDefaultRequired
NAMESPACESComma-separated list of namespaces to monitor-Yes
COLLECTION_INTERVALData collection interval in seconds300Yes
DB_NAMEPostgreSQL database namepostgresYes
DB_USERPostgreSQL usernamepostgresYes
DB_PASSWORDPostgreSQL passwordpostgresYes
DB_HOSTPostgreSQL hostpostgres-serviceYes
DB_PORTPostgreSQL port5432Yes
⁠Kubernetes Permissions

The service account used by k8-analyzer needs the following permissions:

rules:
- apiGroups: [""]
  resources: ["configmaps", "secrets"]
  verbs: ["get", "list"]
- apiGroups: ["apps"]
  resources: ["deployments", "statefulsets"]
  verbs: ["get", "list"]
- apiGroups: ["batch"]
  resources: ["jobs"]
  verbs: ["get", "list"]

⁠Deployment

⁠Using Helm
# Add the Helm repository
helm repo add arconixforge https://artifacthub.io/packages/helm/k8-analyzer

# Install the chart
helm install k8-analyzer arconixforge/k8-analyzer \
  --set namespaces="default,kube-system" \
  --set postgresql.enabled=true
⁠Using Raw Kubernetes Manifests
  1. Create a PostgreSQL instance if not already available
  2. Create necessary RBAC resources
  3. Deploy the k8-analyzer pod

⁠Database Schema

The collected data is stored in a table named gke_data with the following schema:

CREATE TABLE gke_data (
    id SERIAL PRIMARY KEY,
    image_details JSONB,
    env_details JSONB,
    config_details JSONB,
    secret_details JSONB,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

⁠Contributing

Contributions are welcome! Please read our Contributing Guide⁠ for details on our code of conduct and the process for submitting pull requests.

⁠License

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

⁠Support

Tag summary

Content type

Image

Digest

sha256:cdf85e589…

Size

58.8 MB

Last updated

over 1 year ago

docker pull arconixforge/k8-analyzer:v1.0