Пример #1
0
def check_kube_namespace_info(section: NamespaceInfo) -> CheckResult:
    yield from check_info(
        {
            "name": section.name,
            "creation_timestamp": section.creation_timestamp,
        }
    )
Пример #2
0
def check_kube_deployment_info(section: DeploymentInfo) -> CheckResult:
    yield from check_info(
        {
            "name": section.name,
            "namespace": section.namespace,
            "creation_timestamp": section.creation_timestamp,
        }
    )
Пример #3
0
def check_kube_node_info(section: NodeInfo) -> CheckResult:
    yield from check_info({
        "name": section.name,
        "creation_timestamp": section.creation_timestamp,
        "os_image": section.os_image,
        "container_runtime_version": section.container_runtime_version,
        "architecture": section.architecture,
        "kernel_version": section.kernel_version,
        "operating_system": section.operating_system,
    })
Пример #4
0
def check_kube_pod_info(section: PodInfo) -> CheckResult:
    # To get an understanding of API objects this check deals with, one can take a look at
    # PodInfo and the definition of its fields

    if section.namespace is None:
        raise KubernetesError("Pod has no namespace")

    if section.creation_timestamp is None:
        raise KubernetesError("Pod has no creation timestamp")

    yield from check_info({
        "node": section.node,
        "name": section.name,
        "namespace": section.namespace,
        "creation_timestamp": section.creation_timestamp,
        "qos_class": section.qos_class,
        "uid": section.uid,
        "restart_policy": section.restart_policy,
    })
Пример #5
0
def check_kube_statefulset_info(section: StatefulSetInfo) -> CheckResult:
    yield from check_info({
        "name": section.name,
        "namespace": section.namespace,
        "creation_timestamp": section.creation_timestamp,
    })
Пример #6
0
def check_kube_daemonset_info(section: DaemonSetInfo) -> CheckResult:
    yield from check_info({
        "name": section.name,
        "namespace": section.namespace,
        "creation_timestamp": section.creation_timestamp,
    })