diff --git a/helm-chart/.gitignore b/helm-chart/.gitignore new file mode 100644 index 0000000..aa1ec1e --- /dev/null +++ b/helm-chart/.gitignore @@ -0,0 +1 @@ +*.tgz diff --git a/helm-chart/Chart.yaml b/helm-chart/Chart.yaml new file mode 100644 index 0000000..5093f43 --- /dev/null +++ b/helm-chart/Chart.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +name: coriander-bot-rs +version: 1.0.0 +keywords: + - telegram +maintainers: + - name: Siubeng +sources: + - https://github.com/fython/coriander-bot-rs +description: A telegram bot written in Rust diff --git a/helm-chart/templates/configmap.yaml b/helm-chart/templates/configmap.yaml new file mode 100644 index 0000000..3670ff8 --- /dev/null +++ b/helm-chart/templates/configmap.yaml @@ -0,0 +1,8 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Release.Name }}-configmap +data: + RUST_LOG: "{{ .Values.env.RUST_LOG }}" + TELOXIDE_TOKEN: "{{ .Values.bot.token }}" + CORIANDER_MAINTAINER_USER_ID: "{{ .Values.bot.maintainerUserId }}" diff --git a/helm-chart/templates/deployment.yaml b/helm-chart/templates/deployment.yaml new file mode 100644 index 0000000..f40b4a5 --- /dev/null +++ b/helm-chart/templates/deployment.yaml @@ -0,0 +1,23 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.Name }}-deploy + labels: + app: coriander-bot +spec: + replicas: 1 + selector: + matchLabels: + app: coriander-bot + template: + metadata: + labels: + app: coriander-bot + spec: + containers: + - name: {{ .Release.Name }} + envFrom: + - configMapRef: + name: {{ .Release.Name }}-configmap + image: '{{ .Values.image.repository }}:{{ .Values.image.tag }}' + imagePullPolicy: {{ .Values.image.pullPolicy }} diff --git a/helm-chart/values.yaml b/helm-chart/values.yaml new file mode 100644 index 0000000..ce83278 --- /dev/null +++ b/helm-chart/values.yaml @@ -0,0 +1,12 @@ +# 镜像配置 +image: + repository: ghcr.io/fython/coriander-bot-rs + tag: latest + pullPolicy: IfNotPresent +# 机器人配置 +bot: + token: "" + maintainerUserId: 0 +# 其他环境变量 +env: + RUST_LOG: "info,std::option"