-
Notifications
You must be signed in to change notification settings - Fork 3
/
flux-helmrelease.yaml
55 lines (55 loc) · 1.72 KB
/
flux-helmrelease.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/bjw-s/helm-charts/main/charts/other/app-template/schemas/helmrelease-helm-v2.schema.json
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: &app i-see-dead-pods
spec:
interval: 15m
chart:
spec:
chart: app-template
version: 3.4.0
sourceRef:
kind: HelmRepository
name: bjw-s-charts
namespace: flux-system
values:
controllers:
i-see-dead-pods:
type: cronjob
cronjob:
concurrencyPolicy: Forbid
schedule: "* * * * *"
pod:
securityContext:
runAsUser: 65534
runAsGroup: 65534
runAsNonRoot: true
containers:
cron:
image:
repository: bitnami/kubectl
tag: 1.31.1@sha256:27e5f500a2de2ba249a159c4af0b075500ad8a1afaa59ba1edf09bf83c656fd4
command:
- /bin/sh
- -ec
- |
kubectl get pods \
--all-namespaces \
-o go-template \
--template='{{range .items}}{{printf "%s %s %s\n" .metadata.namespace .metadata.name .status.message}}{{end}}' \
| grep "Pod was terminated in response to imminent node shutdown." \
| awk '{print $1, $2}' \
| xargs -r -n2 kubectl delete pod -n || true
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities: { drop: ["ALL"] }
resources:
requests:
cpu: 10m
memory: 10Mi
serviceAccount:
create: true
name: *app