diff --git a/charts/beekeeper/Chart.yaml b/charts/beekeeper/Chart.yaml index 2a769a7..849fa72 100644 --- a/charts/beekeeper/Chart.yaml +++ b/charts/beekeeper/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 appVersion: latest name: beekeeper -version: 0.1.2 +version: 0.1.3 description: Ethereum Swarm Beekeeper Helm chart for Kubernetes home: https://swarm.ethereum.org icon: https://swarm-guide.readthedocs.io/en/latest/_images/swarm.png diff --git a/charts/beekeeper/templates/podfailure.yaml b/charts/beekeeper/templates/podfailure.yaml new file mode 100644 index 0000000..d51953a --- /dev/null +++ b/charts/beekeeper/templates/podfailure.yaml @@ -0,0 +1,50 @@ +{{- if and .Values.chaos.podfailure.enabled -}} + +apiVersion: batch/v1beta1 +kind: CronJob +metadata: + name: {{ include "beekeeper.fullname" . }}-podfailure + labels: + {{- include "beekeeper.labels" . | nindent 4 }} +spec: + schedule: "{{ .Values.chaos.podfailure.schedule }}" + successfulJobsHistoryLimit: {{ .Values.chaos.podfailure.successfulJobsHistoryLimit }} + failedJobsHistoryLimit: {{ .Values.chaos.podfailure.failedJobsHistoryLimit }} + concurrencyPolicy: "{{ .Values.chaos.podfailure.concurrencyPolicy }}" + jobTemplate: + metadata: + labels: + {{- include "beekeeper.selectorLabels" . | nindent 8 }} + spec: + template: + spec: + serviceAccountName: {{ include "beekeeper.serviceAccountName" . }} + containers: + - name: {{ .Chart.Name }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + env: + - name: BEEKEEPER_NAMESPACE + value: ".Values.beeChaos.namespace }}" + - name: BEEKEEPER_MODE + value: "{{ .Values.beeChaos.mode }}" + - name: BEEKEEPER_VALUE + value: "{{ .Values.beeChaos.value }}" + - name: BEEKEEPER_DURATION + value: "{{ .Values.beeChaos.duration }}" + - name: BEEKEEPER_CRON + value: "{{ .Values.beeChaos.cron }}" + - name: BEEKEEPER_PODNAME + value: "{{ .Values.beeChaos.podname }}" + args: + - turn-on + - podfailure + - --kubeconfig + - incluster + restartPolicy: Never + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 12 }} + {{- end }} + +{{- end -}} diff --git a/charts/beekeeper/values.yaml b/charts/beekeeper/values.yaml index a2102ee..95b744c 100644 --- a/charts/beekeeper/values.yaml +++ b/charts/beekeeper/values.yaml @@ -35,6 +35,13 @@ beeCluster: pushGateway: http://localhost:9091/ pushMetrics: false +beeChaos: + namespace: bee + mode: one + value: "" + duration: 19s + cron: 20s + check: fileretrieval: enabled: false @@ -86,3 +93,11 @@ check: concurrencyPolicy: Forbid chunksPerNode: 1 uploadNodeCount: 1 + +chaos: + podfailure: + enabled: true + schedule: "*/1 * * * *" + successfulJobsHistoryLimit: 3 + failedJobsHistoryLimit: 3 + concurrencyPolicy: Forbid \ No newline at end of file