Skip to content

Commit

Permalink
feat: improve reliability by adding periodic pepr restart (#229)
Browse files Browse the repository at this point in the history
  • Loading branch information
MxNxPx authored Oct 22, 2024
1 parent 6872031 commit 684c6d0
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
59 changes: 59 additions & 0 deletions packages/additional-manifests/jobs/pepr-restart-job.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: watch-recycle-sa
namespace: pepr-system
---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
namespace: pepr-system
name: watch-recycle-role
rules:
- apiGroups: ["apps"]
resources: ["deployments", "replicasets", "pods"]
verbs: ["get", "patch"]
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: watch-recycle-binding
namespace: pepr-system
subjects:
- kind: ServiceAccount
name: watch-recycle-sa
roleRef:
kind: Role
name: watch-recycle-role
apiGroup: rbac.authorization.k8s.io
---
apiVersion: batch/v1
kind: CronJob
metadata:
name: pod-deleter-job
namespace: pepr-system
spec:
schedule: "*/15 * * * *"
jobTemplate:
spec:
template:
spec:
serviceAccountName: watch-recycle-sa
restartPolicy: OnFailure
containers:
- name: kubectl-container
image: registry1.dso.mil/ironbank/opensource/kubernetes/kubectl:v1.29.4
args:
- rollout
- restart
- deployment/pepr-uds-core-watcher
- -n
- pepr-system
- name: kubectl-container2
image: registry1.dso.mil/ironbank/opensource/kubernetes/kubectl:v1.29.4
args:
- rollout
- restart
- deployment/pepr-uds-core
- -n
- pepr-system
8 changes: 8 additions & 0 deletions packages/additional-manifests/zarf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,11 @@ components:
- pepr-policy-exemptions/metallb-exemptions.yaml
- pepr-policy-exemptions/gitlab-exemptions.yaml
- pepr-policy-exemptions/eks-mgmt-exemptions.yaml
- name: jobs
required: true
manifests:
- name: jobs-manifests
files:
- jobs/pepr-restart-job.yaml
images:
- registry1.dso.mil/ironbank/opensource/kubernetes/kubectl:v1.29.4

0 comments on commit 684c6d0

Please sign in to comment.