browsertrix/chart/templates/role.yaml
Ilya Kreymer 3438133fcb
Crawler pod memory padding + auto scaling (#1631)
- set memory limit to 1.2x memory request to provide extra padding and
avoid OOM
- attempt to resize crawler pods by 1.2x when exceeding 90% of available
memory
- do a 'soft OOM' (send extra SIGTERM) to pod when reaching 100% of
requested memory, resulting in faster graceful restart, but avoiding a
system-instant OOM Kill
- Fixes #1632

---------
Co-authored-by: Tessa Walsh <tessa@bitarchivist.net>
2024-03-28 16:39:00 -07:00

43 lines
1.2 KiB
YAML

---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
namespace: {{ .Values.crawler_namespace }}
name: crawler-run
rules:
- apiGroups: [""]
resources: ["pods", "pods/exec", "pods/log", "services", "configmaps", "secrets", "events", "persistentvolumeclaims"]
verbs: ["get", "list", "watch", "create", "update", "patch", "delete", "deletecollection", "exec"]
- apiGroups: ["batch", "extensions", "apps"]
resources: ["jobs", "cronjobs", "statefulsets"]
verbs: ["get", "list", "watch", "create", "update", "patch", "delete", "deletecollection"]
- apiGroups: ["btrix.cloud"]
resources: ["crawljobs", "profilejobs"]
verbs: ["get", "list", "watch", "create", "update", "patch", "delete", "deletecollection"]
- apiGroups: ["metrics.k8s.io"]
resources: ["pods"]
verbs: ["list"]
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: crawler-role
namespace: {{ .Values.crawler_namespace }}
subjects:
- kind: ServiceAccount
name: default
namespace: {{ .Release.Namespace }}
- kind: User
name: system:anonymous
namespace: {{ .Release.Namespace }}
roleRef:
kind: Role
name: crawler-run
apiGroup: rbac.authorization.k8s.io