Tango control subpackage with Kubernetes support (ska_tangoctl.tango_kontrol)
Read and display Kubernetes and Tango stuff.
- class ska_tangoctl.tango_kontrol.TangoKontrol(logger: Logger, k8s_ctx: str | None, k8s_cluster: str | None, domain_name: str | None)[source]
Read Tango devices running in a Kubernetes cluster.
- __init__(logger: Logger, k8s_ctx: str | None, k8s_cluster: str | None, domain_name: str | None)[source]
Initialize this thing.
- Parameters:
logger – logging handle
k8s_ctx – Kubernetes context
k8s_cluster – Kubernetes
domain_name – Kubernetes domain name
- get_contexts_dict() dict[source]
Read contexts/clusters in Kubernetes.
- Returns:
dictionary with host and context names
- get_contexts_list() tuple[source]
Read contexts/clusters in Kubernetes.
- Returns:
tuple with host and context names
- get_namespaces_dict() dict[source]
Read namespaces in Kubernetes cluster.
- Returns:
dictionary with devices
- get_namespaces_list() tuple[source]
Read namespaces in Kubernetes cluster.
- Returns:
tuple with context name, cluster name and list with devices
- get_pods_dict(ns_name: str | None) dict[source]
Read pods in Kubernetes namespace.
- Parameters:
ns_name – namespace name
- Returns:
dictionary with devices
- get_pods_json(ns_name: str | None, pod_cmd: str) list[source]
Read pods in Kubernetes namespace.
- Parameters:
ns_name – namespace name
pod_cmd – command to run on pod
- Returns:
dictionary with pod information
- list_pod_names(ns_name: str | None) int[source]
Display pods in Kubernetes namespace.
- Parameters:
ns_name – namespace name
- Returns:
error condition
- pod_run_cmd(k8s: KubernetesInfo, ns_name: str, pod_name: str, pod_cmd: str) dict[source]
Run a command in specified pod.
- Parameters:
k8s – K8S info handle
ns_name – namespace
pod_name – pod name
pod_cmd – command to run
- Returns:
dictionary with output information
- print_pod(ns_name: str | None, pod_name: str | None, pod_cmd: str) int[source]
Display pods in Kubernetes namespace.
- Parameters:
ns_name – namespace name
pod_name – pod name
pod_cmd – command to run
- Returns:
error condition
- print_pods(ns_name: str | None, pod_cmd: str) int[source]
Display pods in Kubernetes namespace.
- Parameters:
ns_name – namespace name
pod_cmd – command to run
- Returns:
error condition
- read_tango_host(ntango: int, ntangos: int) int[source]
Read info from Tango host.
- Parameters:
ntango – index number,
ntangos – index count
- Returns:
error condition
- show_pod(pod_cmd: str) int[source]
Display pods in Kubernetes namespace.
- Parameters:
pod_cmd – command to run
- Returns:
error condition