INNER CODE UNIT · Python
run_kubectl_command_ro
IBM/AutoMLPipeline.jl · argo-workflow/agents/argo-k8s.py:197
def run_kubectl_command_ro(command: str):
"""
Execute read-only kubectl commands safely for information gathering.
This tool provides a safe way to run kubectl commands that only read information
from your Kubernetes cluster without making any modifications. It blocks potentially
destructive operations and only allows commands that gather information.
Allowed operations:
- get: Retrieve resources (pods, deployments, services, etc.)
- describe: Show detailed information about resources
- explain: Show documentation for resource types
- logs: Retrieve the logs of the resources (pods, deployments, services, etc.)
- top: Display resource usage (cpu/memory)
- config view: View kubeconfig settings
- config get-contexts: List available contexts
- version: Show kubectl and cluster version information
- api-resources: List available API resources