MaiBot/helm-chart/templates/job-post-install/job-gen-adapter-cm.yaml

31 lines
1.2 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# 动态生成adapter配置文件的configmap的job仅会在部署时运行一次
apiVersion: batch/v1
kind: Job
metadata:
name: {{ .Release.Name }}-maibot-adapter-cm-generator
namespace: {{ .Release.Namespace }}
annotations:
"helm.sh/hook": post-install,post-upgrade
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
spec:
backoffLimit: 2
template:
spec:
serviceAccountName: {{ .Release.Name }}-maibot-adapter-cm-generator
restartPolicy: Never
containers:
- name: adapter-cm-generator
image: {{ .Values.adapter.cm_generator.image.repository | default "reg.mikumikumi.xyz/maibot/adapter-cm-generator" }}:{{ .Values.adapter.cm_generator.image.tag | default "0.11.1-beta" }}
workingDir: /app
env:
- name: PYTHONUNBUFFERED
value: "1"
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: RELEASE_NAME
value: {{ .Release.Name }}
- name: DATA_B64
value: {{ .Values.config.adapter_config | b64enc }} # 将配置文件编码为base64从环境变量注入