Example #1
0
def _parameter_valuespec():
    return Dictionary(
        help=_((
            "This ruleset is relevant for Kubernetes replicas. You can set "
            "a maximum allowed duration during which replicas may be in a not "
            "ready or not up-to-date state. Keep in mind that replicas may "
            "temporarily be in these states during the process of an update. "
            "Therefore, it is recommended to always have a grace period "
            "configured.")),
        elements=[
            ("update_duration", age_levels_dropdown(_("Update duration"))),
            ("not_ready_duration",
             age_levels_dropdown(_("Not ready duration"))),
        ],
    )
Example #2
0
def _parameter_valuespec_kube_pod_status(sections: Sequence[Section]):
    elements: List[Tuple[str, CascadingDropdown]] = []
    for options, default_choice in sections:
        elements.extend(
            (option,
             age_levels_dropdown(option, default_choice=default_choice))
            for option in options)
    elements.append((
        "other",
        age_levels_dropdown(title="Other", default_choice="no_levels"),
    ))

    return lambda: Dictionary(
        title=_("Interpretation of pod status"),
        help=
        _("Map the Kubernetes pod status shown in the summary to an upper level of its age. "
          "In order the configure pod statuses not within the list below, use the 'Other' option."
          ),
        elements=elements,
    )
Example #3
0
def _parameter_valuespec():
    return Dictionary(
        help=_(
            (
                "A pod's status depends on an array of conditions through which the"
                " Pod has or has not yet passed. You can set a time for how long a condition"
                " is allowed to be in a failed state before the check alerts."
            )
        ),
        elements=[
            ("scheduled", age_levels_dropdown(_("Time until alert, if pod not scheduled"))),
            ("initialized", age_levels_dropdown(_("Time until alert, if pod not initialized"))),
            (
                "containersready",
                age_levels_dropdown(_("Time until alert, if pod's containers not ready")),
            ),
            ("ready", age_levels_dropdown(_("Time until alert, if pod not ready"))),
        ],
        optional_keys=["initialized", "scheduled", "containersready", "ready"],
    )
Example #4
0
def _parameter_valuespec():
    return Dictionary(
        help=_(
            (
                "A Deployment enters various states during its lifecycle. Depending on this a "
                "Deployment may present different conditions. You can set a time for how long "
                "a condition is allowed to be in a certain state before the check alerts."
            )
        ),
        elements=[
            (
                "progressing",
                age_levels_dropdown(_("Time until alert, if deployment not in progressing")),
            ),
            ("available", age_levels_dropdown(_("Time until alert, if deployment not available"))),
            (
                "replicafailure",
                age_levels_dropdown(_("Time until alert, if deployment in replica failure")),
            ),
        ],
        optional_keys=["progressing", "available", "replicafailure"],
    )
Example #5
0
def _parameter_valuespec():
    return Dictionary(
        help=_((
            "This ruleset is relevant for Kubernetes replicas. You can set "
            "a maximum allowed duration during which replicas may be in a not "
            "ready or not up-to-date state. For DaemonSets, you may "
            "additionally specify the duration for which there may be a "
            "positive number of misscheduled replicas. Keep in mind that replicas "
            "may temporarily be in these states during the process of an "
            "update. Therefore, it is recommended to always have a grace "
            "period configured.")),
        elements=[
            ("update_duration", age_levels_dropdown(_("Update duration"))),
            ("not_ready_duration",
             age_levels_dropdown(_("Not ready duration"))),
            (
                "misscheduled_duration",
                age_levels_dropdown(
                    _("Misscheduled duration (DaemonSet only)")),
            ),
        ],
    )
Example #6
0
def __element():
    return Tuple(elements=[
        age_levels_dropdown(),
        ListOf(
            valuespec=RegExp(
                mode=RegExp.infix,
                title=_("Status"),
                allow_empty=False,
                size=50,
            ),
            add_label=_("Add new status"),
            allow_empty=False,
            movable=False,
            help=RegExp(mode=RegExp.infix).help(),
        ),
    ], )