From e7c2fcf9c2c62970e3367d06adbd34671460c254 Mon Sep 17 00:00:00 2001 From: Robert Jonczy Date: Tue, 16 Apr 2024 11:08:54 +0200 Subject: [PATCH] added cosmos-notifier helm chart --- charts/cosmos-notifier/.helmignore | 23 +++++++ charts/cosmos-notifier/Chart.yaml | 6 ++ charts/cosmos-notifier/templates/NOTES.txt | 1 + charts/cosmos-notifier/templates/_helpers.tpl | 62 +++++++++++++++++++ .../cosmos-notifier/templates/deployment.yaml | 59 ++++++++++++++++++ .../templates/serviceaccount.yaml | 12 ++++ charts/cosmos-notifier/values.yaml | 29 +++++++++ 7 files changed, 192 insertions(+) create mode 100644 charts/cosmos-notifier/.helmignore create mode 100644 charts/cosmos-notifier/Chart.yaml create mode 100644 charts/cosmos-notifier/templates/NOTES.txt create mode 100644 charts/cosmos-notifier/templates/_helpers.tpl create mode 100644 charts/cosmos-notifier/templates/deployment.yaml create mode 100644 charts/cosmos-notifier/templates/serviceaccount.yaml create mode 100644 charts/cosmos-notifier/values.yaml diff --git a/charts/cosmos-notifier/.helmignore b/charts/cosmos-notifier/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/charts/cosmos-notifier/.helmignore @@ -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/ diff --git a/charts/cosmos-notifier/Chart.yaml b/charts/cosmos-notifier/Chart.yaml new file mode 100644 index 0000000..6de6fd8 --- /dev/null +++ b/charts/cosmos-notifier/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +name: cosmos-notifier +description: A Helm chart for Kubernetes to deploy cosmos-notifier +type: application +version: 0.1.0 +appVersion: "0.1.0" diff --git a/charts/cosmos-notifier/templates/NOTES.txt b/charts/cosmos-notifier/templates/NOTES.txt new file mode 100644 index 0000000..e9cd233 --- /dev/null +++ b/charts/cosmos-notifier/templates/NOTES.txt @@ -0,0 +1 @@ +cosmos-notifier deployed \ No newline at end of file diff --git a/charts/cosmos-notifier/templates/_helpers.tpl b/charts/cosmos-notifier/templates/_helpers.tpl new file mode 100644 index 0000000..a0581f7 --- /dev/null +++ b/charts/cosmos-notifier/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "cosmos-notifier.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- 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 "cosmos-notifier.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 "cosmos-notifier.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "cosmos-notifier.labels" -}} +helm.sh/chart: {{ include "cosmos-notifier.chart" . }} +{{ include "cosmos-notifier.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "cosmos-notifier.selectorLabels" -}} +app.kubernetes.io/name: {{ include "cosmos-notifier.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "cosmos-notifier.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "cosmos-notifier.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/charts/cosmos-notifier/templates/deployment.yaml b/charts/cosmos-notifier/templates/deployment.yaml new file mode 100644 index 0000000..892d79f --- /dev/null +++ b/charts/cosmos-notifier/templates/deployment.yaml @@ -0,0 +1,59 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "cosmos-notifier.fullname" . }} + labels: + {{- include "cosmos-notifier.labels" . | nindent 4 }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + {{- include "cosmos-notifier.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "cosmos-notifier.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "cosmos-notifier.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: 80 + protocol: TCP + livenessProbe: + httpGet: + path: / + port: http + readinessProbe: + httpGet: + path: / + port: http + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/charts/cosmos-notifier/templates/serviceaccount.yaml b/charts/cosmos-notifier/templates/serviceaccount.yaml new file mode 100644 index 0000000..41b537d --- /dev/null +++ b/charts/cosmos-notifier/templates/serviceaccount.yaml @@ -0,0 +1,12 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "cosmos-notifier.serviceAccountName" . }} + labels: + {{- include "cosmos-notifier.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/charts/cosmos-notifier/values.yaml b/charts/cosmos-notifier/values.yaml new file mode 100644 index 0000000..bbebe7f --- /dev/null +++ b/charts/cosmos-notifier/values.yaml @@ -0,0 +1,29 @@ +replicaCount: 1 + +image: + repository: ghcr.io/composablefi/cosmos-notifier + pullPolicy: IfNotPresent + tag: "latest" + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +serviceAccount: + create: true + annotations: {} + name: "" + +podAnnotations: {} + +podSecurityContext: {} + +securityContext: {} + +resources: {} + +nodeSelector: {} + +tolerations: [] + +affinity: {}