Skip to content

Commit

Permalink
🔀 Merge pull request #127 from JuniorJPDJ/helm-chart
Browse files Browse the repository at this point in the history
feat: initial version of kubernetes helm chart
  • Loading branch information
jh0ker authored Mar 11, 2024
2 parents 1fb5ac1 + 3df30af commit 9bd86bd
Show file tree
Hide file tree
Showing 7 changed files with 146 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ target/
# PyCharm
.idea

# Helm resources
chart/charts

# Database file
uno.sqlite3

Expand Down
1 change: 1 addition & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ The following wonderful people contributed directly or indirectly to this projec

- [imlonghao](https://github.com/imlonghao)
- [Iuri Guilherme](https://github.com/iuriguilherme)
- [JuniorJPDJ](https://github.com/JuniorJPDJ)
- [pan93412](https://github.com/pan93412)
- [qubitnerd](https://github.com/qubitnerd)
- [SYHGroup](https://github.com/SYHGroup)
Expand Down
25 changes: 25 additions & 0 deletions chart/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# 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/
# helm-docs templates
*.gotmpl
6 changes: 6 additions & 0 deletions chart/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies:
- name: common
repository: https://bjw-s.github.io/helm-charts
version: 3.0.0-beta4
digest: sha256:7b1303fd68b34ce69f2b6eb8a72a1e74f77636f906f2c1499234fc8f32aa4aac
generated: "2024-03-11T03:47:29.800675883+01:00"
21 changes: 21 additions & 0 deletions chart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: v2
name: maumaubot
description: Telegram Bot that allows you to play the popular card game UNO via inline queries.
type: application
version: 0.1.0
appVersion: latest
kubeVersion: ">=1.22.0-0"
keywords:
- telegram
- uno
- telegram-bot
dependencies:
- name: common
repository: https://bjw-s.github.io/helm-charts
version: 3.0.0-beta4
sources:
- https://github.com/jh0ker/mau_mau_bot
annotations:
artifacthub.io/links: |-
- name: App Source
url: https://github.com/jh0ker/mau_mau_bot
17 changes: 17 additions & 0 deletions chart/templates/common.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{{/* Preprocess values and prepare config file */}}
{{- define "maumaubot.preprocess" -}}
secrets:
envs:
stringData:
TOKEN: {{ required "Bot token is required. Please set config.token" .Values.config.token | quote }}

configMaps:
config:
data:
config.json: |
{{- omit .Values.config "token" | mustToPrettyJson | nindent 8 }}
{{- end -}}
{{- $_ := merge .Values (include "maumaubot.preprocess" . | fromYaml) -}}

{{/* Render the templates */}}
{{- include "bjw-s.common.loader.all" . }}
73 changes: 73 additions & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
#
# IMPORTANT NOTE
#
# This chart inherits from our common library chart. You can check the default values/options here:
# https://github.com/bjw-s/helm-charts/blob/main/charts/library/common/values.yaml
#

config:
# token: # THIS IS NECESSARY FOR BOT TO START, FILL THIS FIELD
admin_list:
- 0
open_lobby: true
enable_translations: false
workers: 32
default_gamemode: fast
waiting_time: 120
time_removal_after_skip: 20
min_fast_turn_time: 15
min_players: 2

defaultPodOptions:
securityContext:
fsGroup: 65534
fsGroupChangePolicy: Always

configMaps:
config:
enabled: true
data: {}
# config.json is autogenerated from config object above

secrets:
envs:
stringData: {}
# TOKEN is got from config.token value

controllers:
main:
type: statefulset
containers:
main:
image:
repository: ghcr.io/jh0ker/mau_mau_bot
pullPolicy: Always
tag: latest
envFrom:
- secret: envs
securityContext:
capabilities:
drop:
- ALL

readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 65534
runAsGroup: 65534

persistence:
config:
type: configMap
identifier: config
globalMounts:
- path: /app/config.json
readOnly: true
subPath: config.json
data:
type: persistentVolumeClaim
accessMode: ReadWriteOnce
retain: true
globalMounts:
- path: /app/data/
readOnly: false
size: 100Mi

0 comments on commit 9bd86bd

Please sign in to comment.