commit 4bf0afc354e54c023ce5c25ec7b27b62a4eddc29 Author: zhanghaogang Date: Thu Mar 13 13:32:09 2025 +0800 chore: 添加Helm Chart打包和推送脚本 - 新增build-chart.sh脚本用于自动化打包和推送Helm Chart - 支持自动获取最新生成的包名 - 支持推送至OCI仓库 - 自动清理生成的包文件 diff --git a/build-chart.sh b/build-chart.sh new file mode 100644 index 0000000..179eccc --- /dev/null +++ b/build-chart.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +# 打包 Helm Chart +helm package chart/ + +# 获取最新生成的包名 +chart_package=$(ls -t *.tgz | head -n 1) + +# 推送 Helm Chart 到 OCI 仓库 +helm push $chart_package oci://registry.timerzz.com:20443/helm-charts + +# 删除生成的包 +rm -f $chart_package \ No newline at end of file diff --git a/chart/.helmignore b/chart/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/chart/.helmignore @@ -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/ diff --git a/chart/Chart.yaml b/chart/Chart.yaml new file mode 100644 index 0000000..724e775 --- /dev/null +++ b/chart/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: kedaya-ht-config +description: 可达鸭海淘的配置 + +# 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.1 + +# 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: "V1.0.1" diff --git a/chart/templates/configMap.yaml b/chart/templates/configMap.yaml new file mode 100644 index 0000000..8bd3262 --- /dev/null +++ b/chart/templates/configMap.yaml @@ -0,0 +1,31 @@ +apiVersion: v1 +data: + db: |- + host: {{ .Values.db.host }} + user: {{ .Values.db.user }} + password: {{ .Values.db.password }} + port: {{ .Values.db.port }} + dbname: {{ .Values.db.dbname }} + dw: |- + public: + key: {{ .Values.dw.public.key }} + secret: {{ .Values.dw.public.secret }} + env: {{ .Values.dw.public.env }} + proxy: + host: "{{ .Values.dw.proxy.host }}" + port: "{{ .Values.dw.proxy.port }}" + user: "{{ .Values.dw.proxy.user }}" + pass: "{{ .Values.dw.proxy.pass }}" + proxy: |- + interval: {{ .Values.proxy.interval }} + clash: + {{- range .Values.proxy.clash }} + - {{ . | quote }} + {{- end }} + redis: |- + addr: {{ .Values.redis.addr }} + password: {{ .Values.redis.password | quote }} + db: {{ .Values.redis.db }} +kind: ConfigMap +metadata: + name: {{ .Values.name }} \ No newline at end of file diff --git a/chart/values.yaml b/chart/values.yaml new file mode 100644 index 0000000..929bd34 --- /dev/null +++ b/chart/values.yaml @@ -0,0 +1,31 @@ +# Default values for chart. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. +name: "online" +db: + host: 192.168.31.55 + user: timerzz + password: zhhg1997 + port: 5432 + dbname: kedaya + +dw: + public: + key: 92a2afa02627410fae9e3331cc850224 + secret: 73b5bf12bc5e4b4690f444b32b934dc0feb1e42977514333a76f263592ee37f4 + env: online + proxy: + host: "jd.timerzz.com" + port: "8090" + user: "timerzz" + pass: "zhhg1997" + +proxy: + interval: 5m + clash: + - https://us.timerzz.com:26107/clash/config + +redis: + addr: dragonfly-sample.default.svc:6379 + password: "" + db: 1