Skip to content

Commit

Permalink
Merge pull request #119 from celo-org/jcortejoso/restart-geth-cj
Browse files Browse the repository at this point in the history
Undo shared template for delete pod cj
  • Loading branch information
jcortejoso authored Aug 22, 2023
2 parents 94290e2 + 7e12ae3 commit 41a3dbe
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 100 deletions.
2 changes: 1 addition & 1 deletion charts/common/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
apiVersion: v2
name: common
version: 0.3.4
version: 0.3.5
type: library
home: https://celo.org
icon: https://pbs.twimg.com/profile_images/1613170131491848195/InjXBNx9_400x400.jpg
Expand Down
4 changes: 2 additions & 2 deletions charts/common/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Helm chart with helper templates and functions for Celo nodes. Import into your chart with `dependencies` and use the templates and functions

![Version: 0.3.4](https://img.shields.io/badge/Version-0.3.4-informational?style=flat-square) ![Type: library](https://img.shields.io/badge/Type-library-informational?style=flat-square)
![Version: 0.3.5](https://img.shields.io/badge/Version-0.3.5-informational?style=flat-square) ![Type: library](https://img.shields.io/badge/Type-library-informational?style=flat-square)

- [common](#common)
- [Chart releases](#chart-releases)
Expand All @@ -23,7 +23,7 @@ To import this chart into your chart, add the following to your `requirements.ya
dependencies:
- name: common
repository: oci://us-west1-docker.pkg.dev/celo-testnet/clabs-public-oci
version: 0.3.4
version: 0.3.5
```
## Values
Expand Down
97 changes: 0 additions & 97 deletions charts/common/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -619,100 +619,3 @@ else
ADDITIONAL_FLAGS="${ADDITIONAL_FLAGS} --ws --wsaddr $LISTEN_ADDRESS --wsorigins=* --wsapi=$RPC_APIS --wsport=$WS_PORT"
fi
{{- end }}
{{- define "common.delete-pod-cronjob" -}}
{{- /*
This CronJob in intended to delete regularly a geth pod
in order to force geth to flush the data to disk, so it can
be used as an snapshot
*/}}
apiVersion: batch/v1
kind: CronJob
metadata:
labels:
{{- include "common.standard.labels" . | nindent 4 }}
component: restart-geth
name: {{ template "common.fullname" . }}-restart-geth
spec:
concurrencyPolicy: Forbid
failedJobsHistoryLimit: 1
jobTemplate:
spec:
backoffLimit: 1
template:
metadata:
labels:
{{- include "common.standard.labels" . | nindent 12 }}
component: restart-geth
spec:
containers:
- name: restart-geth
command:
- /bin/sh
- -c
args:
- |
kubectl delete pod -n {{ .Release.Namespace }} {{ .podName }}
image: bitnami/kubectl:latest
imagePullPolicy: Always
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
dnsPolicy: ClusterFirst
restartPolicy: Never
schedulerName: default-scheduler
serviceAccountName: {{ template "common.fullname" . }}-restart-geth
terminationGracePeriodSeconds: 30
schedule: "{{ .schedule }}"
successfulJobsHistoryLimit: 3
suspend: true
---
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
{{- include "common.standard.labels" . | nindent 4 }}
component: restart-geth
name: {{ template "common.fullname" . }}-restart-geth
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
labels:
{{- include "common.standard.labels" . | nindent 4 }}
component: restart-geth
name: {{ template "common.fullname" . }}-restart-geth
rules:
- apiGroups:
- ""
resources:
- namespaces
verbs:
- get
- apiGroups:
- ""
resources:
- pods
verbs:
- get
- list
- watch
- delete
- update
- patch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
labels:
{{- include "common.standard.labels" . | nindent 4 }}
component: restart-geth
name: {{ template "common.fullname" . }}-restart-geth
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ template "common.fullname" . }}-restart-geth
subjects:
- kind: ServiceAccount
name: {{ template "common.fullname" . }}-restart-geth
namespace: {{ .Release.Namespace }}
{{- end }}

0 comments on commit 41a3dbe

Please sign in to comment.