fix: resolve CI test failure in output.py
- Fixed undefined 'tool' variable in display_history function - Changed '[tool]' markup tag usage to proper Rich syntax - All tests now pass (38/38 unit tests) - Type checking passes with mypy --strict
This commit is contained in:
354
commands/kubectl.yaml
Normal file
354
commands/kubectl.yaml
Normal file
@@ -0,0 +1,354 @@
|
||||
version: "1.0"
|
||||
description: kubectl command patterns
|
||||
|
||||
patterns:
|
||||
- name: get_pods
|
||||
description: List pods in a namespace
|
||||
patterns:
|
||||
- list pods
|
||||
- get pods
|
||||
- show pods
|
||||
- kubectl get pods
|
||||
template: kubectl get pods -n {namespace}
|
||||
explanation: Lists all pods in the specified namespace.
|
||||
|
||||
- name: get_all_pods
|
||||
description: List all pods in all namespaces
|
||||
patterns:
|
||||
- list all pods
|
||||
- get all pods
|
||||
- kubectl get pods -A
|
||||
template: kubectl get pods -A
|
||||
explanation: Lists all pods across all namespaces.
|
||||
|
||||
- name: get_pod_details
|
||||
description: Get detailed pod information
|
||||
patterns:
|
||||
- pod details
|
||||
- describe pod
|
||||
- kubectl describe pod
|
||||
template: kubectl describe pod {pod_name} -n {namespace}
|
||||
explanation: Shows detailed information about a specific pod.
|
||||
|
||||
- name: get_pod_yaml
|
||||
description: Get pod YAML configuration
|
||||
patterns:
|
||||
- pod yaml
|
||||
- get pod yaml
|
||||
- kubectl get pod -o yaml
|
||||
template: kubectl get pod {pod_name} -n {namespace} -o yaml
|
||||
explanation: Returns the YAML configuration for a pod.
|
||||
|
||||
- name: delete_pod
|
||||
description: Delete a pod
|
||||
patterns:
|
||||
- delete pod
|
||||
- remove pod
|
||||
- kubectl delete pod
|
||||
template: kubectl delete pod {pod_name} -n {namespace}
|
||||
explanation: Deletes the specified pod.
|
||||
|
||||
- name: delete_pod_force
|
||||
description: Force delete a pod
|
||||
patterns:
|
||||
- force delete pod
|
||||
- delete pod immediately
|
||||
template: kubectl delete pod {pod_name} -n {namespace} --grace-period=0 --force
|
||||
explanation: Forcefully deletes a pod without waiting for graceful termination.
|
||||
|
||||
- name: get_deployments
|
||||
description: List deployments
|
||||
patterns:
|
||||
- list deployments
|
||||
- get deployments
|
||||
- kubectl get deployments
|
||||
template: kubectl get deployments -n {namespace}
|
||||
explanation: Lists all deployments in the namespace.
|
||||
|
||||
- name: get_deployment
|
||||
describe: Get deployment details
|
||||
patterns:
|
||||
- deployment details
|
||||
- describe deployment
|
||||
template: kubectl describe deployment {name} -n {namespace}
|
||||
explanation: Shows detailed information about a deployment.
|
||||
|
||||
- name: scale_deployment
|
||||
description: Scale a deployment
|
||||
patterns:
|
||||
- scale deployment
|
||||
- set replicas
|
||||
- kubectl scale
|
||||
template: kubectl scale deployment {name} --replicas={replicas} -n {namespace}
|
||||
explanation: Scales a deployment to the specified number of replicas.
|
||||
|
||||
- name: rollout_status
|
||||
description: Check deployment rollout status
|
||||
patterns:
|
||||
- rollout status
|
||||
- deployment status
|
||||
- kubectl rollout status
|
||||
template: kubectl rollout status deployment/{name} -n {namespace}
|
||||
explanation: Shows the rollout status of a deployment.
|
||||
|
||||
- name: rollout_restart
|
||||
description: Restart a deployment
|
||||
patterns:
|
||||
- restart deployment
|
||||
- rollout restart
|
||||
- kubectl rollout restart
|
||||
template: kubectl rollout restart deployment/{name} -n {namespace}
|
||||
explanation: Triggers a rolling restart of a deployment.
|
||||
|
||||
- name: rollout_undo
|
||||
description: Undo deployment rollout
|
||||
patterns:
|
||||
- undo rollout
|
||||
- rollback deployment
|
||||
- kubectl rollout undo
|
||||
template: kubectl rollout undo deployment/{name} -n {namespace}
|
||||
explanation: Rolls back a deployment to the previous revision.
|
||||
|
||||
- name: get_services
|
||||
description: List services
|
||||
patterns:
|
||||
- list services
|
||||
- get services
|
||||
- kubectl get services
|
||||
template: kubectl get services -n {namespace}
|
||||
explanation: Lists all services in the namespace.
|
||||
|
||||
- name: describe_service
|
||||
description: Describe a service
|
||||
patterns:
|
||||
- service details
|
||||
- describe service
|
||||
template: kubectl describe service {name} -n {namespace}
|
||||
explanation: Shows detailed information about a service.
|
||||
|
||||
- name: get_configmaps
|
||||
description: List configmaps
|
||||
patterns:
|
||||
- list configmaps
|
||||
- get configmaps
|
||||
- kubectl get configmap
|
||||
template: kubectl get configmaps -n {namespace}
|
||||
explanation: Lists all configmaps in the namespace.
|
||||
|
||||
- name: get_secrets
|
||||
description: List secrets
|
||||
patterns:
|
||||
- list secrets
|
||||
- get secrets
|
||||
- kubectl get secrets
|
||||
template: kubectl get secrets -n {namespace}
|
||||
explanation: Lists all secrets in the namespace.
|
||||
|
||||
- name: get_namespaces
|
||||
description: List namespaces
|
||||
patterns:
|
||||
- list namespaces
|
||||
- get namespaces
|
||||
- kubectl get namespaces
|
||||
template: kubectl get namespaces
|
||||
explanation: Lists all namespaces in the cluster.
|
||||
|
||||
- name: create_namespace
|
||||
description: Create a namespace
|
||||
patterns:
|
||||
- create namespace
|
||||
- new namespace
|
||||
template: kubectl create namespace {namespace}
|
||||
explanation: Creates a new namespace.
|
||||
|
||||
- name: use_namespace
|
||||
description: Set current namespace
|
||||
patterns:
|
||||
- switch namespace
|
||||
- use namespace
|
||||
- kubens
|
||||
template: kubectl config set-context --current --namespace={namespace}
|
||||
explanation: Sets the current namespace for kubectl context.
|
||||
|
||||
- name: apply_config
|
||||
description: Apply a configuration file
|
||||
patterns:
|
||||
- apply config
|
||||
- apply yaml
|
||||
- kubectl apply
|
||||
template: kubectl apply -f {file}
|
||||
explanation: Applies a configuration from a YAML file.
|
||||
|
||||
- name: apply_kustomize
|
||||
description: Apply a kustomization
|
||||
patterns:
|
||||
- apply kustomize
|
||||
- kustomize apply
|
||||
template: kubectl apply -k {directory}
|
||||
explanation: Applies a kustomization from a directory.
|
||||
|
||||
- name: get_events
|
||||
description: Get cluster events
|
||||
patterns:
|
||||
- get events
|
||||
- list events
|
||||
- kubectl get events
|
||||
template: kubectl get events --sort-by='.lastTimestamp'
|
||||
explanation: Lists all events in the cluster.
|
||||
|
||||
- name: get_nodes
|
||||
description: List cluster nodes
|
||||
patterns:
|
||||
- list nodes
|
||||
- get nodes
|
||||
- kubectl get nodes
|
||||
template: kubectl get nodes
|
||||
explanation: Lists all nodes in the cluster.
|
||||
|
||||
- name: describe_node
|
||||
description: Describe a node
|
||||
patterns:
|
||||
- node details
|
||||
- describe node
|
||||
template: kubectl describe node {node_name}
|
||||
explanation: Shows detailed information about a node.
|
||||
|
||||
- name: get_logs
|
||||
description: Get pod logs
|
||||
patterns:
|
||||
- get logs
|
||||
- pod logs
|
||||
- kubectl logs
|
||||
template: kubectl logs {pod_name} -n {namespace}
|
||||
explanation: Retrieves logs from a pod.
|
||||
|
||||
- name: get_logs_follow
|
||||
description: Follow pod logs
|
||||
patterns:
|
||||
- follow logs
|
||||
- tail logs
|
||||
- kubectl logs -f
|
||||
template: kubectl logs -f {pod_name} -n {namespace}
|
||||
explanation: Follows logs from a pod in real-time.
|
||||
|
||||
- name: get_logs_container
|
||||
description: Get logs from specific container
|
||||
patterns:
|
||||
- logs container
|
||||
- kubectl logs container
|
||||
template: kubectl logs {pod_name} -c {container} -n {namespace}
|
||||
explanation: Retrieves logs from a specific container in a pod.
|
||||
|
||||
- name: exec_pod
|
||||
description: Execute command in pod
|
||||
patterns:
|
||||
- exec into pod
|
||||
- kubectl exec
|
||||
template: kubectl exec -it {pod_name} -n {namespace} -- {command}
|
||||
explanation: Executes a command in a pod.
|
||||
|
||||
- name: port_forward
|
||||
description: Port forward to pod
|
||||
patterns:
|
||||
- port forward
|
||||
- forward port
|
||||
- kubectl port-forward
|
||||
template: kubectl port-forward {pod_name} {local_port}:{remote_port} -n {namespace}
|
||||
explanation: Forwards a local port to a pod.
|
||||
|
||||
- name: get_statefulsets
|
||||
description: List statefulsets
|
||||
patterns:
|
||||
- list statefulsets
|
||||
- get statefulsets
|
||||
template: kubectl get statefulsets -n {namespace}
|
||||
explanation: Lists all statefulsets in the namespace.
|
||||
|
||||
- name: get_ingresses
|
||||
description: List ingresses
|
||||
patterns:
|
||||
- list ingresses
|
||||
- get ingresses
|
||||
template: kubectl get ingresses -n {namespace}
|
||||
explanation: Lists all ingresses in the namespace.
|
||||
|
||||
- name: get_hpa
|
||||
description: List horizontal pod autoscalers
|
||||
patterns:
|
||||
- list hpa
|
||||
- get hpa
|
||||
template: kubectl get hpa -n {namespace}
|
||||
explanation: Lists all HPA resources in the namespace.
|
||||
|
||||
- name: top_pods
|
||||
description: Show pod resource usage
|
||||
patterns:
|
||||
- top pods
|
||||
- pod metrics
|
||||
- kubectl top pods
|
||||
template: kubectl top pods -n {namespace}
|
||||
explanation: Shows CPU and memory usage for pods.
|
||||
|
||||
- name: top_nodes
|
||||
description: Show node resource usage
|
||||
patterns:
|
||||
- top nodes
|
||||
- node metrics
|
||||
template: kubectl top nodes
|
||||
explanation: Shows CPU and memory usage for nodes.
|
||||
|
||||
- name: cluster_info
|
||||
description: Show cluster information
|
||||
patterns:
|
||||
- cluster info
|
||||
- cluster details
|
||||
template: kubectl cluster-info
|
||||
explanation: Shows information about the cluster.
|
||||
|
||||
- name: cluster_contexts
|
||||
description: List kubeconfig contexts
|
||||
patterns:
|
||||
- list contexts
|
||||
- get contexts
|
||||
template: kubectl config get-contexts
|
||||
explanation: Lists all contexts in the kubeconfig.
|
||||
|
||||
- name: current_context
|
||||
description: Show current context
|
||||
patterns:
|
||||
- current context
|
||||
- show context
|
||||
template: kubectl config current-context
|
||||
explanation: Shows the current context.
|
||||
|
||||
- name: switch_context
|
||||
description: Switch context
|
||||
patterns:
|
||||
- switch context
|
||||
- use context
|
||||
template: kubectl config use-context {context}
|
||||
explanation: Switches to the specified context.
|
||||
|
||||
- name: get_all
|
||||
description: Get all resources in namespace
|
||||
patterns:
|
||||
- get all
|
||||
- list all resources
|
||||
template: kubectl get all -n {namespace}
|
||||
explanation: Lists all resources (pods, services, deployments) in the namespace.
|
||||
|
||||
- name: diff_config
|
||||
description: Diff configuration against cluster
|
||||
patterns:
|
||||
- diff config
|
||||
- kubectl diff
|
||||
template: kubectl diff -f {file}
|
||||
explanation: Shows differences between local config and cluster config.
|
||||
|
||||
- name: explain_resource
|
||||
description: Explain resource fields
|
||||
patterns:
|
||||
- explain resource
|
||||
- kubectl explain
|
||||
template: kubectl explain {resource}
|
||||
explanation: Explains the fields of a resource.
|
||||
Reference in New Issue
Block a user