Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions helm/am-bot/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Patterns to ignore when building packages.
.DS_Store
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
*.swp
*.bak
*.tmp
*.orig
*~
.project
.idea/
*.tmproj
.vscode/
10 changes: 10 additions & 0 deletions helm/am-bot/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v2
name: am-bot
description: ARK Modding Discord Bot - Community management bot for ARK modding Discord server
type: application
version: 1.0.0
appVersion: "0.0.6"

maintainers:
- name: jslay
email: jslay@arkmodding.net
85 changes: 85 additions & 0 deletions helm/am-bot/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "am-bot.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
*/}}
{{- define "am-bot.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 "am-bot.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

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

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

{{/*
Create the name of the service account to use
*/}}
{{- define "am-bot.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "am-bot.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{/*
Bot secret name
*/}}
{{- define "am-bot.secretName" -}}
{{- if .Values.existingSecret }}
{{- .Values.existingSecret }}
{{- else }}
{{- printf "%s-secrets" (include "am-bot.fullname" .) }}
{{- end }}
{{- end }}

{{/*
AWS secret name
*/}}
{{- define "am-bot.awsSecretName" -}}
{{- if .Values.aws.existingSecret }}
{{- .Values.aws.existingSecret }}
{{- else if .Values.existingSecret }}
{{- .Values.existingSecret }}
{{- else }}
{{- printf "%s-secrets" (include "am-bot.fullname" .) }}
{{- end }}
{{- end }}
77 changes: 77 additions & 0 deletions helm/am-bot/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "am-bot.fullname" . }}
labels:
{{- include "am-bot.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "am-bot.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "am-bot.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- range . }}
- name: {{ . }}
{{- end }}
{{- end }}
{{- if .Values.serviceAccount.create }}
serviceAccountName: {{ include "am-bot.serviceAccountName" . }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
{{- /* Bot token */}}
- name: BOT_TOKEN
valueFrom:
secretKeyRef:
name: {{ include "am-bot.secretName" . }}
key: BOT_TOKEN
{{- /* AWS credentials for SES */}}
{{- if .Values.aws.enabled }}
- name: AWS_ACCESS_KEY_ID
valueFrom:
secretKeyRef:
name: {{ include "am-bot.awsSecretName" . }}
key: AWS_ACCESS_KEY_ID
- name: AWS_SECRET_ACCESS_KEY
valueFrom:
secretKeyRef:
name: {{ include "am-bot.awsSecretName" . }}
key: AWS_SECRET_ACCESS_KEY
- name: AWS_DEFAULT_REGION
valueFrom:
secretKeyRef:
name: {{ include "am-bot.awsSecretName" . }}
key: AWS_DEFAULT_REGION
{{- end }}
{{- /* Additional environment variables */}}
{{- range $key, $value := .Values.env }}
- name: {{ $key }}
value: {{ $value | quote }}
{{- end }}
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 }}
18 changes: 18 additions & 0 deletions helm/am-bot/templates/secrets.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{{- if and (not .Values.existingSecret) (or .Values.secrets .Values.aws.secrets) }}
apiVersion: v1
kind: Secret
metadata:
name: {{ include "am-bot.fullname" . }}-secrets
labels:
{{- include "am-bot.labels" . | nindent 4 }}
type: Opaque
stringData:
{{- range $key, $value := .Values.secrets }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- if and .Values.aws.enabled (not .Values.aws.existingSecret) }}
{{- range $key, $value := .Values.aws.secrets }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
{{- end }}
53 changes: 53 additions & 0 deletions helm/am-bot/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Default values for am-bot

replicaCount: 1

image:
registry: ghcr.io
repository: arkmodding/am_bot
tag: "0.0.6"
pullPolicy: IfNotPresent

imagePullSecrets: []

# Use an existing secret for credentials
# The secret must contain: BOT_TOKEN
# If AWS SES is enabled, also needs: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_DEFAULT_REGION
existingSecret: ""

# If not using existingSecret, provide secrets here (not recommended for production)
secrets: {}
# BOT_TOKEN: ""

# AWS SES configuration for email notifications
aws:
enabled: true
# Use a separate existing secret for AWS credentials
# Must contain: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_DEFAULT_REGION
existingSecret: ""
# If not using existingSecret, provide values here
secrets: {}
# AWS_ACCESS_KEY_ID: ""
# AWS_SECRET_ACCESS_KEY: ""
# AWS_DEFAULT_REGION: ""

# Additional environment variables
env: {}

resources:
limits:
cpu: 200m
memory: 128Mi
requests:
cpu: 50m
memory: 64Mi

nodeSelector: {}
tolerations: []
affinity: {}

podAnnotations: {}

serviceAccount:
create: false
name: ""
Loading