Lifeguard K8S
Integration with Kubernetes
Actions
- delete_informed_pods: delete pods informed in validation response details. Example of usage:
from lifeguard_k8s.actions.pods import deleted_formed_pods
@validation(
"drubin-lifeguard",
actions=[delete_informed_pods],
schedule={"every": {"minutes": 1}},
)
def drubin_lifeguard():
# To execute delete_informed_pods action the response should have the
# two attributes in details:
# - namespace: the Kubernetes namespace where the pods are
# - delete_pods: list of pods to be deleted
return ValidationResponse(
PROBLEM, {"delete_pods": ["lifeguard-75c44897b4-k9g94"], "namespace": "drubin"}
)
Validations
- pods_validation: check if all pods are running
Important: To use Kubernetes APIs into the valiations, you need to create a service account and a cluster role binding. Example of a valid manifest:
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: lifeguard-sa
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: lifeguard-roles
rules:
- apiGroups: [""]
resources: ["nodes"]
verbs: ["get", "list"]
- apiGroups: [""]
resources: ["pods", "pods/exec"]
verbs: ["get", "list"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: lifeguard-rolebinding
subjects:
- kind: ServiceAccount
name: lifeguard-sa
namespace: namespace
roleRef:
kind: ClusterRole
name: lifeguard-roles
apiGroup: rbac.authorization.k8s.io
Release files for lifeguard-k8s 1.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| lifeguard-k8s-1.3.0.tar.gz | 7.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| lifeguard_k8s-1.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 18.4 kB
Release files / lifeguard-k8s-1.3.0.tar.gz
| Download URL | lifeguard-k8s-1.3.0.tar.gz |
|---|---|
| Size | 7.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
97b64acb2019b9f9f888b048db2c3b6bec11ebe1b51379ccb52dc740bccfe65d
|
|
BLAKE2b-256 checksum How to use checksums |
0e60c4d23397968d7bb8847058814f8ae8c0c56673acf5647c892eb80a798d5d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|
Release files / lifeguard_k8s-1.3.0-py3-none-any.whl
| Download URL | lifeguard_k8s-1.3.0-py3-none-any.whl |
|---|---|
| Size | 10.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
825c6467f033b2d4a62922452e91aafe4a841c01dc7e86e5d14be013e46e19f9
|
|
BLAKE2b-256 checksum How to use checksums |
477210866002013581f2d0d0fa3e3b463c0d051cd2604f96cee26f1ceed015e7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|