Skip to main content

Tool to work with kubernetes dashboard, if there is no kubectl access

Project description

KDC - Kubernetes Dashboard Connector

Designed to partially replace kubectl app if your DevOps do not grant access to it.
As an alternative for kubectl, DevOps can set up Kubernetes Dashboard
web app and grant access to it. But as this solution is slow and not very convenient, I've created this tool to request logs and pod data from the cluster.

Features

  • select kubernetes cluster to work with
  • select kubernetes namespace to work with
  • list namespaces
  • list deployments
  • list pods
  • list jobs
  • get logs from pods by name pattern. Multiple pods can be selected separated by space
  • get logs from the latest job by name pattern
  • delete pod by name pattern (1 per time, check if it is allowed)
  • scale deployment by name pattern (1 per time, check if it is allowed)
  • download logs to the file
  • show the token of current cluster

Installation

pip install kdc-kubeconnector

Configuration

Find the config file here ~/.kdc/config.toml It will be created after the first run of the tool.

[default]
cluster = "localhost"
namespace = "default"

[log]
level = "INFO"
file = "kdc.log"
save = false

[connection]
retries = 3
delay = 1
page = 3000

[cluster.localhost]
url = "http://localhost:8001"
token = "token"
namespace = "default"

[cluster.dev]
url = "http://dev:8001
token = "token2"
namespace = "default"

[cluster.uat]
url = "http://uat:8001
token = "token3"
namespace = "default"

Usage Examples

List pods

kdc -p
kdc -p s=running --only running
kdc -p s=run  --only running
kdc -p n=nginx --only with name nginx
kdc -p s=run n=ngi --with name nginx

Get logs from the pod with name like nginx-sd4353453-4543d

kdc -l nginx

Get logs from the few pods

kdc -l nginx app1 app2

List namespaces

kdc -n

Set the namespace to work with by default

kdc -n default
kdc -n dev
kdc -n uat

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Release Notes

  • 1.7.7 - fixed wrong selection of namespace by cluster
  • 1.7.6 - fixed GitHub actions pipeline. Fixed version issue
  • 1.7.0 - fixed version issue. Added the ability to set the namespace by cluster. Improved env selection argument

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kdc-kubeconnector-1.7.7.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kdc_kubeconnector-1.7.7-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file kdc-kubeconnector-1.7.7.tar.gz.

File metadata

  • Download URL: kdc-kubeconnector-1.7.7.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for kdc-kubeconnector-1.7.7.tar.gz
Algorithm Hash digest
SHA256 514148c1b5ce073070f7b070a34bf4a3f3dbbd1f836612e7f6a94d7880b23e91
MD5 6c05526242872ce6be660e99ff8f7fb5
BLAKE2b-256 84d35f037dfabc06672291ce0e8d775a9055d176d8cd7dd6923335e66d86ede3

See more details on using hashes here.

File details

Details for the file kdc_kubeconnector-1.7.7-py3-none-any.whl.

File metadata

File hashes

Hashes for kdc_kubeconnector-1.7.7-py3-none-any.whl
Algorithm Hash digest
SHA256 3ee3c4f35e01d557b9837be0635e6ce3dd2d3366f116e4b92efc14faca0258e8
MD5 e545398177934bb7cd354668ca855ef3
BLAKE2b-256 3e7531f64901ea2e2094f58bc5223999ae853f574510be2432600277ab897748

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page