Skip to content

Commit ce04d67

Browse files
initial safe-watcher chart
1 parent 26adf70 commit ce04d67

12 files changed

+418
-0
lines changed

Diff for: charts/safe-watcher/.helmignore

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/

Diff for: charts/safe-watcher/Chart.yaml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
apiVersion: v2
2+
name: safe-watcher
3+
description: A Helm chart for deploy Safe-Watcher to Kubernetes
4+
5+
maintainers:
6+
- name: WesleyCharlesBlake
7+
url: https://github.com/WesleyCharlesBlake/
8+
- name: chronicleprotocol
9+
url: https://github.com/chronicleprotocol
10+
sources:
11+
- https://github.com/Gearbox-protocol/safe-watcher
12+
13+
icon: https://avatars.githubusercontent.com/u/79740422
14+
# A chart can be either an 'application' or a 'library' chart.
15+
#
16+
# Application charts are a collection of templates that can be packaged into versioned archives
17+
# to be deployed.
18+
#
19+
# Library charts provide useful utilities or functions for the chart developer. They're included as
20+
# a dependency of application charts to inject those utilities and functions into the rendering
21+
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
22+
type: application
23+
24+
# This is the chart version. This version number should be incremented each time you make changes
25+
# to the chart and its templates, including the app version.
26+
# Versions are expected to follow Semantic Versioning (https://semver.org/)
27+
version: 0.0.1
28+
29+
# This is the version number of the application being deployed. This version number should be
30+
# incremented each time you make changes to the application. Versions are not expected to
31+
# follow Semantic Versioning. They should reflect the version the application is using.
32+
# It is recommended to use it with quotes.
33+
appVersion: "1.2.1"

Diff for: charts/safe-watcher/README.md

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# safe-watcher
2+
3+
![Version: 0.0.1](https://img.shields.io/badge/Version-0.0.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.2.1](https://img.shields.io/badge/AppVersion-1.2.1-informational?style=flat-square)
4+
5+
A Helm chart for deploy Safe-Watcher to Kubernetes
6+
7+
## Maintainers
8+
9+
| Name | Email | Url |
10+
| ---- | ------ | --- |
11+
| WesleyCharlesBlake | | <https://github.com/WesleyCharlesBlake/> |
12+
| chronicleprotocol | | <https://github.com/chronicleprotocol> |
13+
14+
## Source Code
15+
16+
* <https://github.com/Gearbox-protocol/safe-watcher>
17+
18+
## Values
19+
20+
| Key | Type | Default | Description |
21+
|-----|------|---------|-------------|
22+
| affinity | object | `{}` | |
23+
| autoscaling.enabled | bool | `false` | |
24+
| autoscaling.maxReplicas | int | `100` | |
25+
| autoscaling.minReplicas | int | `1` | |
26+
| autoscaling.targetCPUUtilizationPercentage | int | `80` | |
27+
| configYaml | object | `{"safeAddresses":["eth:0x11111"],"signers":{"0x22222":"alice","0x33333":"bob"},"telegramBotToken":"xxxx","telegramChannelId":"-1111"}` | inline plain text config, if empty, app expects an existing CM |
28+
| fullnameOverride | string | `""` | |
29+
| image.pullPolicy | string | `"IfNotPresent"` | |
30+
| image.repository | string | `"ghcr.io/gearbox-protocol/safe-watcher"` | |
31+
| image.tag | string | `""` | |
32+
| imagePullSecrets | list | `[]` | |
33+
| livenessProbe | object | `{}` | |
34+
| nameOverride | string | `""` | |
35+
| nodeSelector | object | `{}` | |
36+
| podAnnotations | object | `{}` | |
37+
| podLabels | object | `{}` | |
38+
| podSecurityContext | object | `{}` | |
39+
| readinessProbe | object | `{}` | |
40+
| replicaCount | int | `1` | |
41+
| resources | object | `{}` | |
42+
| securityContext | object | `{}` | |
43+
| serviceAccount | object | `{"annotations":{},"automount":true,"create":true,"name":""}` | This section builds out the service account more information can be found here: https://kubernetes.io/docs/concepts/security/service-accounts/ |
44+
| tolerations | list | `[]` | |
45+
| volumeMounts | list | `[{"mountPath":"/app/config.yaml","name":"config","subPath":"config.yaml"}]` | Additional volumeMounts on the output Deployment definition. |
46+
| volumes | list | `[{"configMap":{"items":[{"key":"config.yaml","path":"config.yaml"}],"name":"safe-watcher-config"},"name":"config"}]` | Default for CM, but you can also set it to your own CM instead of supplying values inline |
47+
48+
----------------------------------------------
49+
Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2)

Diff for: charts/safe-watcher/templates/NOTES.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
1. Get the application pod by running this commands:
2+
3+
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "safe-watcher.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")

Diff for: charts/safe-watcher/templates/_helpers.tpl

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "safe-watcher.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11+
If release name contains chart name it will be used as a full name.
12+
*/}}
13+
{{- define "safe-watcher.fullname" -}}
14+
{{- if .Values.fullnameOverride }}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16+
{{- else }}
17+
{{- $name := default .Chart.Name .Values.nameOverride }}
18+
{{- if contains $name .Release.Name }}
19+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
20+
{{- else }}
21+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22+
{{- end }}
23+
{{- end }}
24+
{{- end }}
25+
26+
{{/*
27+
Create chart name and version as used by the chart label.
28+
*/}}
29+
{{- define "safe-watcher.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "safe-watcher.labels" -}}
37+
helm.sh/chart: {{ include "safe-watcher.chart" . }}
38+
{{ include "safe-watcher.selectorLabels" . }}
39+
{{- if .Chart.AppVersion }}
40+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
41+
{{- end }}
42+
app.kubernetes.io/managed-by: {{ .Release.Service }}
43+
{{- end }}
44+
45+
{{/*
46+
Selector labels
47+
*/}}
48+
{{- define "safe-watcher.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "safe-watcher.name" . }}
50+
app.kubernetes.io/instance: {{ .Release.Name }}
51+
{{- end }}
52+
53+
{{/*
54+
Create the name of the service account to use
55+
*/}}
56+
{{- define "safe-watcher.serviceAccountName" -}}
57+
{{- if .Values.serviceAccount.create }}
58+
{{- default (include "safe-watcher.fullname" .) .Values.serviceAccount.name }}
59+
{{- else }}
60+
{{- default "default" .Values.serviceAccount.name }}
61+
{{- end }}
62+
{{- end }}

Diff for: charts/safe-watcher/templates/configmap.yaml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{{- if .Values.configYaml }}
2+
apiVersion: v1
3+
kind: ConfigMap
4+
metadata:
5+
name: safe-watcher-config
6+
labels:
7+
{{- include "safe-watcher.labels" . | nindent 4 }}
8+
data:
9+
config.yaml: |-
10+
{{ .Values.configYaml | toJson | indent 4 }}
11+
{{- end }}

Diff for: charts/safe-watcher/templates/deployment.yaml

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: {{ include "safe-watcher.fullname" . }}
5+
labels:
6+
{{- include "safe-watcher.labels" . | nindent 4 }}
7+
spec:
8+
{{- if not .Values.autoscaling.enabled }}
9+
replicas: {{ .Values.replicaCount }}
10+
{{- end }}
11+
selector:
12+
matchLabels:
13+
{{- include "safe-watcher.selectorLabels" . | nindent 6 }}
14+
template:
15+
metadata:
16+
{{- with .Values.podAnnotations }}
17+
annotations:
18+
{{- toYaml . | nindent 8 }}
19+
{{- end }}
20+
labels:
21+
{{- include "safe-watcher.labels" . | nindent 8 }}
22+
{{- with .Values.podLabels }}
23+
{{- toYaml . | nindent 8 }}
24+
{{- end }}
25+
spec:
26+
{{- with .Values.imagePullSecrets }}
27+
imagePullSecrets:
28+
{{- toYaml . | nindent 8 }}
29+
{{- end }}
30+
serviceAccountName: {{ include "safe-watcher.serviceAccountName" . }}
31+
{{- with .Values.podSecurityContext }}
32+
securityContext:
33+
{{- toYaml . | nindent 8 }}
34+
{{- end }}
35+
containers:
36+
- name: {{ .Chart.Name }}
37+
{{- with .Values.securityContext }}
38+
securityContext:
39+
{{- toYaml . | nindent 12 }}
40+
{{- end }}
41+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
42+
imagePullPolicy: {{ .Values.image.pullPolicy }}
43+
44+
{{- with .Values.livenessProbe }}
45+
livenessProbe:
46+
{{- toYaml . | nindent 12 }}
47+
{{- end }}
48+
{{- with .Values.readinessProbe }}
49+
readinessProbe:
50+
{{- toYaml . | nindent 12 }}
51+
{{- end }}
52+
{{- with .Values.resources }}
53+
resources:
54+
{{- toYaml . | nindent 12 }}
55+
{{- end }}
56+
{{- with .Values.volumeMounts }}
57+
volumeMounts:
58+
{{- toYaml . | nindent 12 }}
59+
{{- end }}
60+
{{- with .Values.volumes }}
61+
volumes:
62+
{{- toYaml . | nindent 8 }}
63+
{{- end }}
64+
{{- with .Values.nodeSelector }}
65+
nodeSelector:
66+
{{- toYaml . | nindent 8 }}
67+
{{- end }}
68+
{{- with .Values.affinity }}
69+
affinity:
70+
{{- toYaml . | nindent 8 }}
71+
{{- end }}
72+
{{- with .Values.tolerations }}
73+
tolerations:
74+
{{- toYaml . | nindent 8 }}
75+
{{- end }}

Diff for: charts/safe-watcher/templates/extra-manifests.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{{ range .Values.extraObjects }}
2+
---
3+
{{ tpl (toYaml .) $ }}
4+
{{ end }}

Diff for: charts/safe-watcher/templates/hpa.yaml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{{- if .Values.autoscaling.enabled }}
2+
apiVersion: autoscaling/v2
3+
kind: HorizontalPodAutoscaler
4+
metadata:
5+
name: {{ include "safe-watcher.fullname" . }}
6+
labels:
7+
{{- include "safe-watcher.labels" . | nindent 4 }}
8+
spec:
9+
scaleTargetRef:
10+
apiVersion: apps/v1
11+
kind: Deployment
12+
name: {{ include "safe-watcher.fullname" . }}
13+
minReplicas: {{ .Values.autoscaling.minReplicas }}
14+
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
15+
metrics:
16+
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
17+
- type: Resource
18+
resource:
19+
name: cpu
20+
target:
21+
type: Utilization
22+
averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
23+
{{- end }}
24+
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
25+
- type: Resource
26+
resource:
27+
name: memory
28+
target:
29+
type: Utilization
30+
averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
31+
{{- end }}
32+
{{- end }}

Diff for: charts/safe-watcher/templates/serviceaccount.yaml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{{- if .Values.serviceAccount.create -}}
2+
apiVersion: v1
3+
kind: ServiceAccount
4+
metadata:
5+
name: {{ include "safe-watcher.serviceAccountName" . }}
6+
labels:
7+
{{- include "safe-watcher.labels" . | nindent 4 }}
8+
{{- with .Values.serviceAccount.annotations }}
9+
annotations:
10+
{{- toYaml . | nindent 4 }}
11+
{{- end }}
12+
automountServiceAccountToken: {{ .Values.serviceAccount.automount }}
13+
{{- end }}

Diff for: charts/safe-watcher/templates/tests/test-connection.yaml

Whitespace-only changes.

0 commit comments

Comments
 (0)