This is an automated email from the ASF dual-hosted git repository. gongchao pushed a commit to branch helm-chart in repository https://gitbox.apache.org/repos/asf/hertzbeat-helm-chart.git
commit 738d2aeb6119702cee6a5bff5edbed21bf8d71c7 Author: tomsun28 <[email protected]> AuthorDate: Tue Jun 11 17:52:30 2024 +0800 [improve] update docker compose and k8s helm deploy script (#2076) --- hertzbeat/Chart.yaml | 6 ++-- hertzbeat/templates/database/configmap.yaml | 14 +++++--- hertzbeat/templates/database/service.yaml | 4 +-- hertzbeat/templates/database/statefulset.yaml | 6 ++-- hertzbeat/templates/manager/configmap.yaml | 47 ++++++++++++++++++++++----- hertzbeat/values.yaml | 6 ++-- 6 files changed, 60 insertions(+), 23 deletions(-) diff --git a/hertzbeat/Chart.yaml b/hertzbeat/Chart.yaml index 00978ec..224c75a 100644 --- a/hertzbeat/Chart.yaml +++ b/hertzbeat/Chart.yaml @@ -16,7 +16,7 @@ # under the License. apiVersion: v2 -name: HertzBeat +name: hertzbeat description: An open-source, real-time monitoring system with custom monitoring, high performance cluster and agentless capabilities. type: application home: https://hertzbeat.apache.org/ @@ -24,8 +24,8 @@ sources: - https://github.com/apache/hertzbeat - https://charts.hertzbeat.com maintainers: - - name: tom - email: [email protected] + - name: hertzbeat-dev + email: [email protected] icon: https://raw.githubusercontent.com/apache/hertzbeat/master/home/static/img/hertzbeat-logo.png # 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. diff --git a/hertzbeat/templates/database/configmap.yaml b/hertzbeat/templates/database/configmap.yaml index 2f80a89..4c9c3e9 100644 --- a/hertzbeat/templates/database/configmap.yaml +++ b/hertzbeat/templates/database/configmap.yaml @@ -23,8 +23,14 @@ metadata: {{- include "hertzbeat.labels" . | nindent 4 }} data: TZ: "{{ .Values.database.timezone }}" - MYSQL_ROOT_PASSWORD: "{{ .Values.database.rootPassword }}" + POSTGRES_PASSWORD: "{{ .Values.database.rootPassword }}" + POSTGRES_USER: "root" schema.sql: |+ - set names utf8mb4; - create database if not exists hertzbeat default charset utf8mb4 collate utf8mb4_general_ci; - commit; + CREATE EXTENSION IF NOT EXISTS dblink; + + DO $$ + BEGIN + PERFORM dblink_exec('', 'CREATE DATABASE hertzbeat'); + EXCEPTION WHEN duplicate_database THEN RAISE NOTICE '%, skipping', SQLERRM USING ERRCODE = SQLSTATE; + END + $$; diff --git a/hertzbeat/templates/database/service.yaml b/hertzbeat/templates/database/service.yaml index 589fd21..e95d860 100644 --- a/hertzbeat/templates/database/service.yaml +++ b/hertzbeat/templates/database/service.yaml @@ -24,8 +24,8 @@ metadata: spec: type: ClusterIP ports: - - port: 3306 - targetPort: 3306 + - port: 5432 + targetPort: 5432 protocol: TCP selector: {{- include "hertzbeat.selectorLabels" . | nindent 4 }} diff --git a/hertzbeat/templates/database/statefulset.yaml b/hertzbeat/templates/database/statefulset.yaml index 181af83..85d4e9f 100644 --- a/hertzbeat/templates/database/statefulset.yaml +++ b/hertzbeat/templates/database/statefulset.yaml @@ -47,12 +47,12 @@ spec: imagePullPolicy: {{ .Values.database.image.pullPolicy }} livenessProbe: tcpSocket: - port: 3306 + port: 5432 initialDelaySeconds: 300 periodSeconds: 10 readinessProbe: tcpSocket: - port: 3306 + port: 5432 initialDelaySeconds: 1 periodSeconds: 10 resources: @@ -62,7 +62,7 @@ spec: name: "{{ include "hertzbeat.database" . }}" volumeMounts: - name: data - mountPath: /var/lib/mysql + mountPath: /var/lib/postgresql/data subPath: "" - mountPath: /docker-entrypoint-initdb.d/schema.sql subPath: schema.sql diff --git a/hertzbeat/templates/manager/configmap.yaml b/hertzbeat/templates/manager/configmap.yaml index 3efb85f..b7f1fa7 100644 --- a/hertzbeat/templates/manager/configmap.yaml +++ b/hertzbeat/templates/manager/configmap.yaml @@ -58,6 +58,7 @@ data: enabled-by-default: on sureness: + container: jakarta_servlet auths: - digest - basic @@ -72,17 +73,27 @@ data: on-profile: prod datasource: - driver-class-name: com.mysql.cj.jdbc.Driver + driver-class-name: org.postgresql.Driver username: root password: {{ .Values.database.rootPassword }} - url: jdbc:mysql://{{ include "hertzbeat.database" . }}:3306/hertzbeat?useUnicode=true&characterEncoding=utf-8&allowPublicKeyRetrieval=true&useSSL=false + url: jdbc:postgresql://{{ include "hertzbeat.database" . }}:5432/hertzbeat hikari: max-lifetime: 120000 - jpa: - hibernate: - ddl-auto: update - + show-sql: false + database-platform: org.eclipse.persistence.platform.database.PostgreSQLPlatform + database: postgresql + properties: + eclipselink: + logging: + level: SEVERE + flyway: + enabled: true + clean-disabled: true + baseline-on-migrate: true + baseline-version: 1 + locations: + - classpath:db/migration/{vendor} mail: # Attention: this is mail server address. # 请注意此为邮件服务器地址:qq邮箱为 smtp.qq.com qq 企业邮箱为 smtp.exmail.qq.com @@ -166,13 +177,27 @@ data: alerter: # custom console url console-url: https://console.tancloud.cn + # we work + we-work-webhook-url: https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key= + # ding ding talk + ding-talk-webhook-url: https://oapi.dingtalk.com/robot/send?access_token= + # fei shu fly book + fly-book-webhook-url: https://open.feishu.cn/open-apis/bot/v2/hook/ + # telegram + telegram-webhook-url: https://api.telegram.org/bot%s/sendMessage + # discord + discord-webhook-url: https://discord.com/api/v9/channels/%s/messages + # server酱 + server-chan-webhook-url: https://sctapi.ftqq.com/%s.send + # gotify + gotify-webhook-url: http://127.0.0.1/message?token=%s scheduler: server: enabled: true port: 1158 - + sureness.yml: |+ resourceRole: - /api/account/auth/refresh===post===[admin,user,guest] @@ -213,7 +238,10 @@ data: - /api/status/page/**===post===[admin,user] - /api/status/page/**===put===[admin,user] - /api/status/page/**===delete===[admin] - + + # config the resource restful api that need bypass auth protection + # rule: api===method + # eg: /api/v1/source3===get means /api/v1/source3===get can be access by anyone, no need auth. excludedResource: - /api/alerts/report/**===* - /api/account/auth/**===* @@ -221,6 +249,7 @@ data: - /api/apps/hierarchy===get - /api/push/**===* - /api/status/page/public/**===* + # web ui resource - /===get - /dashboard/**===get - /monitors/**===get @@ -241,9 +270,11 @@ data: - /**/*.json===get - /**/*.woff===get - /**/*.eot===get + # swagger ui resource - /swagger-resources/**===get - /v2/api-docs===get - /v3/api-docs===get + # h2 database - /h2-console/**===* # account info config diff --git a/hertzbeat/values.yaml b/hertzbeat/values.yaml index 844b4da..49ff444 100644 --- a/hertzbeat/values.yaml +++ b/hertzbeat/values.yaml @@ -26,7 +26,7 @@ manager: account: username: "admin" password: "hertzbeat" - jwtSecretKey: "CyaFv0bwq2Eik0jdrKUtsA6bx3sDJeFV143R + jwtSecretKey: "CyaFv0bwq2Eik0jdrKUtsA6dx3sDJeFV143R LnfKefTjsIfJLBa2YkhEqEGtcHDTNe4CU6+9 8tVt4bisXQ13rbN0oxhUZR73M6EByXIO+SV5 dKhaX0csgOCTlCxq20yhmUea6H6JIpSE2Rwp" @@ -62,10 +62,10 @@ collector: database: image: - repository: mysql + repository: postgres pullPolicy: IfNotPresent # Overrides the image tag whose default is the chart appVersion. - tag: "8" + tag: "15" timezone: "Asia/Shanghai" rootPassword: "123456" persistence: --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
