Skip to main content

datus-k8s-plugin

A Datus plugin for inspecting and operating namespace-scoped Kubernetes data workloads through datus k8s. Its command surface follows familiar kubectl verbs while using the Kubernetes Python client rather than a kubectl binary.

Install

datus plugin install src:./datus-k8s-plugin

Configure

For a managed Kubernetes cluster, configure the cloud plugin once and reference it from a small k8s profile. Profiles with the same name are linked automatically; allowed_namespaces defaults to the selected namespace:

agent:
  plugins:
    eks:
      datus-dev:
        default: true
        cluster: datus-dev-eks-cluster
        region: us-east-1
        role_arn: arn:aws:iam::123456789012:role/datus-operator
    k8s:
      datus-dev:
        default: true
        provider: eks
        namespace: analytics
        allowed_namespaces: analytics,analytics-staging

The k8s plugin asks datus eks --profile datus-dev for the EKS endpoint, CA, and a short-lived credential. It never runs the cloud CLI and never persists complete kubeconfig or bearer tokens. Providers may return a client certificate/private key through the standard Kubernetes ExecCredential contract; those are held in owner-only temporary files and removed when the datus k8s process exits. provider_profile defaults to the k8s profile name. Set it only when the two profile names differ. When the provider profile is loaded with a non-default --config, set provider_config to that agent.yml path so nested calls resolve the same config.

Kubeconfig-backed clusters remain supported:

agent:
  plugins:
    k8s:
      prod:
        default: true
        kubeconfig: ./conf/kubeconfig.yaml
        # context is optional; current-context is used when omitted
        context: prod
        namespace: analytics
        allowed_namespaces: analytics,analytics-staging

Relative kubeconfig paths resolve from the directory where Datus is started and cannot escape it. Absolute paths and ${KUBECONFIG} are also accepted. Credentials remain inside kubeconfig.

Commands

Read-only:

datus k8s get pods -n analytics
datus k8s logs pod-name -n analytics --tail 200 --all-containers
datus k8s events -n analytics
datus k8s top pod -n analytics
datus k8s rollout status deployment/worker -n analytics

Tables are shaped per kind, so a failure is visible without fetching the object: pods carry READY/RESTARTS and report Init:CrashLoopBackOff rather than the bare phase, events carry TYPE/REASON/MESSAGE, and any other resource falls back to the conventional status fields (phase, state, lifecycleState) with status.error in the MESSAGE column under -o wide. To read one field, ask for it:

datus k8s get flinkdeployment orders -n analytics -o 'jsonpath={.status.jobStatus.state}'

The plugin intentionally has no generic blocking wait command. Re-check asynchronous resources with bounded get calls so each observation can inspect the resource's actual status, error, pods, and events before continuing.

State-changing commands (create, apply, delete, patch, scale, rollout restart, label, and annotate) always require agent confirmation. So does exec, which runs one non-interactive command in a pod so a diagnostic probe can read what a running process actually sees:

datus k8s exec fe-0 -n analytics -c fe -- sh -c 'ls -1 /opt/lib/*.jar'

stdin and TTY are always disabled and the pod's exit code is propagated, so exec cannot be used as a shell.

This is a deliberate kubectl-style subset. It does not support cluster-scoped resources, -A, interactive exec, attach/cp, port-forward/proxy, Kustomize, kubeconfig mutation, Go templates, custom-columns, or kubectl plugins. The JSONPath output via -o jsonpath= accepts .field and [index] steps only; filters, wildcards, and ranges are rejected rather than silently mis-evaluated.

Develop

uv run --package datus-k8s-plugin pytest datus-k8s-plugin

The package never imports datus; its complete plugin contract is declared in datus_k8s_plugin/datus-plugin.yml.

Metadata

Release files for datus-k8s-plugin 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for datus-k8s-plugin 0.2.0
File Size Uploaded Provenance Actions
datus_k8s_plugin-0.2.0.tar.gz 48.8 kB Without provenance Details for datus_k8s_plugin-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for datus-k8s-plugin 0.2.0
File Interpreter ABI Platform Actions
datus_k8s_plugin-0.2.0-py3-none-any.whl Python 3 none any Details for datus_k8s_plugin-0.2.0-py3-none-any.whl

Total release size: 89.8 kB

Release files / datus_k8s_plugin-0.2.0.tar.gz

Download URL datus_k8s_plugin-0.2.0.tar.gz
Size 48.8 kB
Tags Source
SHA-256 checksum
How to use checksums
f2073807fb6900dfb315b867dff78f23336acd72918cad0338d4795bac18ccfd
BLAKE2b-256 checksum
How to use checksums
4fc7263c1fc8a3a12b7f3e40fe1aca6aee243a264c52253fd33512b5e5fccffd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release files / datus_k8s_plugin-0.2.0-py3-none-any.whl

Download URL datus_k8s_plugin-0.2.0-py3-none-any.whl
Size 41.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a445ad72fc8534254dbf6a0959b1b5e9234079d649b2a5b80a95cb6081130dd6
BLAKE2b-256 checksum
How to use checksums
1d2d4477a9f1812397029370cc9484e79b7d612897432553b56f77f580ce2d9e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Security for datus-k8s-plugin 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page