Skip to content

ChiragAgg5k/kubectl-appwrite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kubectl-appwrite

kubectl-appwrite is a read-only kubectl plugin for Appwrite maintainers and platform operators.

It is designed to answer one question quickly:

What is broken, risky, or suspicious in this Appwrite region right now?

The main command is:

kubectl appwrite triage

What It Checks

triage inspects a namespace and groups related signals by workload.

Current checks include:

  • Deployment availability
  • StatefulSet readiness
  • Pod readiness and failed pods
  • Evicted pods and recovered evictions
  • Container waiting states such as CrashLoopBackOff and ImagePullBackOff
  • High container restart counts
  • Recent important warning events
  • KEDA ScaledObject readiness and activity
  • HPA metric availability and below-min replica state

Install

The binary must be named kubectl-appwrite for kubectl to discover it as kubectl appwrite.

go install github.com/chiragagg5k/kubectl-appwrite@latest

Or build locally from this repository:

go build -o kubectl-appwrite .

Then make sure the binary is on your PATH.

For example:

go build -o ~/go/bin/kubectl-appwrite .

Verify that kubectl can see it:

kubectl plugin list

Usage

kubectl appwrite triage -n cloud

The command uses your active kube context. Switch contexts with either:

kubectx <context>

or:

kubectl config use-context <context>

Flags

-n, --namespace string   Kubernetes namespace to inspect
-v, --verbose            Show healthy components
-c, --color string       Color output: auto, always, never

Color defaults to auto. In auto mode, color is disabled when output is not a terminal or when NO_COLOR is set. Use --color=always to force color.

Output

The default output is grouped for incident triage:

Context: do-nyc3-cloud-nyc3-prod
Namespace: cloud

Summary
  Status: DEGRADED
  Critical: 1
  Warnings: 12
  Recovered: 0
  Healthy: 41

Critical Workloads
  x worker-deletes
    issue: deployment unavailable
    available: 1/3

Warnings
  ! worker-stats-resources
    issue: KEDA invalid, KEDA ScaledObject status unknown, HPA metrics unavailable, high restarts
    pod: worker-stats-resources-7d56f7dfcb-9jvmn
    restarts: 80
    causes:
      - KEDA ScaledObject invalid
      - KEDA ScaledObject status unknown
      - HPA external metrics unavailable
      - container restart count elevated

Recovered Issues
  none

Healthy
  ok 41 workloads healthy
  use --verbose to show healthy components

Development

Install dependencies:

go mod download

Format Go files:

make fmt

Check formatting without modifying files:

make check-fmt

Run tests and build:

make test
make build

Run the command locally:

go run . triage -n cloud

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors