Skip to content

Commit

Permalink
Added the telegram-pepperbot chart
Browse files Browse the repository at this point in the history
  • Loading branch information
glenndehaan committed Mar 20, 2023
1 parent eb7b5e7 commit f0dadd7
Show file tree
Hide file tree
Showing 8 changed files with 314 additions and 0 deletions.
23 changes: 23 additions & 0 deletions charts/telegram-pepperbot/.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/
36 changes: 36 additions & 0 deletions charts/telegram-pepperbot/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
apiVersion: v2
name: telegram-pepperbot
description: A Helm chart for deploying the telegram-pepperbot application
home: https://github.com/glenndehaan/charts
keywords:
- telegram
- pepper
- app
- redis
maintainers:
- email: glenn@dehaan.cloud
name: glenndehaan
url: https://glenndehaan.com
sources:
- https://github.com/glenndehaan/charts

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.0.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "latest"
45 changes: 45 additions & 0 deletions charts/telegram-pepperbot/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# telegram-pepperbot

![Version: 1.0.0](https://img.shields.io/badge/Version-1.0.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square)

A Helm chart for deploying the telegram-pepperbot application

**Homepage:** <https://github.com/glenndehaan/charts>

## Maintainers

| Name | Email | Url |
| ---- | ------ | --- |
| glenndehaan | <glenn@dehaan.cloud> | <https://glenndehaan.com> |

## Source Code

* <https://github.com/glenndehaan/charts>

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| affinity | object | `{}` | Affinity for pod assignment |
| fullnameOverride | string | `""` | String to fully override names.fullname |
| image.pullPolicy | string | `"Always"` | Telegram-Pepperbot image pull policy |
| image.repository | string | `"marnixjanssen/telgram-pepperbot"` | Telegram-Pepperbot image repository |
| image.tag | string | `""` | Overrides the image tag whose default is the chart appVersion. |
| imagePullSecrets | list | `[]` | Specify docker-registry secret names as an array |
| nameOverride | string | `""` | String to partially override names.fullname |
| nodeSelector | object | `{}` | Node labels for pod assignment. Evaluated as a template. |
| pepperbot.redisHost | string | `"redis-headless.example.svc.cluster.local"` | Telegram-Pepperbot Redis Host |
| pepperbot.telegramToken | string | `""` | Telegram-Pepperbot Telegram Bot Token |
| podAnnotations | object | `{}` | Annotations for Telegram-Pepperbot pods |
| podSecurityContext | object | `{}` | Pod Security Context for Telegram-Pepperbot pods |
| replicaCount | int | `2` | Number of Telegram-Pepperbot replicas to deploy |
| resources | object | `{}` | Resources for pods. Evaluated as a template. |
| revisionHistoryLimit | int | `1` | Number of Telegram-Pepperbot revisions to keep |
| securityContext | object | `{}` | Security Context for Telegram-Pepperbot |
| serviceAccount.annotations | object | `{}` | Annotations to add to the service account |
| serviceAccount.create | bool | `true` | Specifies whether a service account should be created |
| serviceAccount.name | string | `""` | The name of the service account to use. If not set and create is true, a name is generated using the fullname template |
| tolerations | list | `[]` | Tolerations for pod assignment. Evaluated as a template. |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0)
1 change: 1 addition & 0 deletions charts/telegram-pepperbot/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Please wait a few seconds until the {{ .Chart.Name }} chart is fully installed.
62 changes: 62 additions & 0 deletions charts/telegram-pepperbot/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "telegram-pepperbot.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 "telegram-pepperbot.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 "telegram-pepperbot.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

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

{{/*
Selector labels
*/}}
{{- define "telegram-pepperbot.selectorLabels" -}}
app.kubernetes.io/name: {{ include "telegram-pepperbot.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "telegram-pepperbot.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "telegram-pepperbot.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
59 changes: 59 additions & 0 deletions charts/telegram-pepperbot/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "telegram-pepperbot.fullname" . }}
labels:
{{- include "telegram-pepperbot.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
revisionHistoryLimit: {{ .Values.revisionHistoryLimit }}
selector:
matchLabels:
{{- include "telegram-pepperbot.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "telegram-pepperbot.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "telegram-pepperbot.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
initContainers:
- name: {{ .Chart.Name }}-redis-ready
image: busybox:1.35
command: [ 'sh', '-c', 'echo -e "Checking for the availability of Redis Server"; while ! nc -z {{ .Values.pepperbot.redisHost }} 6379; do sleep 1; printf "-"; done; echo -e " >> Redis Server is ready";' ]
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
- name: REDIS_URL
value: "redis://{{ .Values.pepperbot.redisHost }}:6379"
- name: TELOXIDE_TOKEN
value: "{{ .Values.pepperbot.telegramToken }}"
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 }}
12 changes: 12 additions & 0 deletions charts/telegram-pepperbot/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "telegram-pepperbot.serviceAccountName" . }}
labels:
{{- include "telegram-pepperbot.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
76 changes: 76 additions & 0 deletions charts/telegram-pepperbot/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Default values for telegram-pepperbot.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

# -- Number of Telegram-Pepperbot replicas to deploy
replicaCount: 2
# -- Number of Telegram-Pepperbot revisions to keep
revisionHistoryLimit: 1

pepperbot:
# -- Telegram-Pepperbot Redis Host
redisHost: "redis-headless.example.svc.cluster.local"
# -- Telegram-Pepperbot Telegram Bot Token
telegramToken: ""

image:
# -- Telegram-Pepperbot image repository
repository: marnixjanssen/telgram-pepperbot
# -- Telegram-Pepperbot image pull policy
pullPolicy: Always
# -- Overrides the image tag whose default is the chart appVersion.
tag: ""

# -- Specify docker-registry secret names as an array
imagePullSecrets: []
# -- String to partially override names.fullname
nameOverride: ""
# -- String to fully override names.fullname
fullnameOverride: ""

serviceAccount:
# -- Specifies whether a service account should be created
create: true
# -- Annotations to add to the service account
annotations: {}
# -- The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template
name: ""

# -- Annotations for Telegram-Pepperbot pods
podAnnotations: {}

# -- Pod Security Context for Telegram-Pepperbot pods
podSecurityContext: {}
# fsGroup: 2000

# -- Security Context for Telegram-Pepperbot
securityContext: {}
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000

# -- Resources for pods. Evaluated as a template.
resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi

# -- Node labels for pod assignment. Evaluated as a template.
nodeSelector: {}

# -- Tolerations for pod assignment. Evaluated as a template.
tolerations: []

# -- Affinity for pod assignment
affinity: {}

0 comments on commit f0dadd7

Please sign in to comment.