Skip to content

Commit

Permalink
Merge pull request #3 from archway-network/hermesrelayer
Browse files Browse the repository at this point in the history
feat: hermes-relayer config
  • Loading branch information
jlehtimaki authored Jul 8, 2023
2 parents 395d0db + 3f7c62d commit e1bda1a
Show file tree
Hide file tree
Showing 7 changed files with 302 additions and 0 deletions.
23 changes: 23 additions & 0 deletions charts/hermes-relayer/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
7 changes: 7 additions & 0 deletions charts/hermes-relayer/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
apiVersion: v2
name: hermes-relayer
description: A Helm chart for Kubernetes
type: application
version: 1.0.0
appVersion: 1.5.1
50 changes: 50 additions & 0 deletions charts/hermes-relayer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Hermes Relayer

## Prerequisites

Kubernetes 1.16+

## Get Repository Info

```console
helm repo add arhcway-network https://archway-network.github.io/helm-charts
helm repo update
```

_See [`helm repo`](https://helm.sh/docs/helm/helm_repo/) for command documentation._

## Install Chart

```console
helm install [RELEASE_NAME] archway-network/hermes-relayer
```

_See [configuration](#configuration) below._

_See [helm install](https://helm.sh/docs/helm/helm_install/) for command documentation._

## Uninstall Chart

```console
helm uninstall [RELEASE_NAME]
```

This removes all the Kubernetes components associated with the chart and deletes the release.

_See [helm uninstall](https://helm.sh/docs/helm/helm_uninstall/) for command documentation._

## Upgrading Chart

```console
helm upgrade [RELEASE_NAME] [CHART] --install
```

_See [helm upgrade](https://helm.sh/docs/helm/helm_upgrade/) for command documentation._

## Configuration

See [Customizing the Chart Before Installing](https://helm.sh/docs/intro/using_helm/#customizing-the-chart-before-installing). To see all configurable options with detailed comments, visit the chart's [values.yaml](./values.yaml), or run these configuration commands:

```console
helm show values archway-network/hermes-relayer
```
69 changes: 69 additions & 0 deletions charts/hermes-relayer/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "hermes-relayer.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{- define "hermes-relayer.namespace" -}}
{{- if .Values.namespaceOverride }}
{{- .Values.namespaceOverride }}
{{- else }}
{{- .Release.Namespace }}
{{- end }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "hermes-relayer.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "hermes-relayer.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "hermes-relayer.labels" -}}
helm.sh/chart: {{ include "hermes-relayer.chart" . }}
{{ include "hermes-relayer.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "hermes-relayer.selectorLabels" -}}
app.kubernetes.io/name: {{ include "hermes-relayer.name" . }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "hermes-relayer.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "hermes-relayer.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
8 changes: 8 additions & 0 deletions charts/hermes-relayer/templates/configMap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}-configmap
data:
config.toml: |
{{.Values.relayer.config |indent 4}}
108 changes: 108 additions & 0 deletions charts/hermes-relayer/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "hermes-relayer.fullname" . }}
namespace: {{ include "hermes-relayer.namespace" . }}
labels:
{{- include "hermes-relayer.labels" . | nindent 4}}
spec:
replicas: {{.Values.replicaCount}}
selector:
matchLabels:
{{- include "hermes-relayer.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "hermes-relayer.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.podSecurityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
- name: chain1mnenomic
secret:
secretName: {{ .Values.relayer.chain1SecretName }}
- name: chain2mnenomic
secret:
secretName: {{ .Values.relayer.chain2SecretName }}
- name: keys
emptyDir: {}
- name: configfile
configMap:
name: {{ .Release.Name }}-configmap
items:
- key: config.toml
path: config.toml
initContainers:
- name: initchain1
image: "{{.Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion}}"
args: [
'keys',
'add',
'--chain',
'{{ .Values.relayer.chain1ID }}',
'--mnemonic-file',
'/etc/mnemonic/mnemonic'
]
volumeMounts:
- name: keys
mountPath: "/home/hermes/.hermes/keys"
- name: configfile
mountPath: "/home/hermes/.hermes/"
- name: chain1mnenomic
readOnly: true
mountPath: /etc/mnemonic
- name: initchain2
image: "{{.Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion}}"
args: [
'keys',
'add',
'--chain',
'{{ .Values.relayer.chain2ID }}',
'--mnemonic-file',
'/etc/mnemonic/mnemonic'
]
volumeMounts:
- name: keys
mountPath: "/home/hermes/.hermes/keys"
- name: configfile
mountPath: "/home/hermes/.hermes/"
- name: chain2mnenomic
readOnly: true
mountPath: /etc/mnemonic
containers:
- name: relayer
image: "{{.Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion}}"
imagePullPolicy: {{.Values.image.pullPolicy}}
args: [
'start'
]
{{- with .Values.containerSecurityContext }}
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
- name: keys
mountPath: /home/hermes/.hermes/keys
- name: configfile
mountPath: "/home/hermes/.hermes/"
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
37 changes: 37 additions & 0 deletions charts/hermes-relayer/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
replicaCount: 1
image:
repository: ghcr.io/informalsystems/hermes
pullPolicy: Always
tag: ""
imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
resources: {}
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
podSecurityContext:
fsGroup: 1001
runAsGroup: 1001
runAsNonRoot: true
runAsUser: 1001
containerSecurityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
privileged: false
podAnnotations: {}
nodeSelector: {}
tolerations: []
affinity: {}
relayer:
chain1ID:
chain2ID:
chain1SecretName:
chain2SecretName:
config: |

0 comments on commit e1bda1a

Please sign in to comment.