Skip to content

Commit

Permalink
update helm deploy script
Browse files Browse the repository at this point in the history
Signed-off-by: tomsun28 <[email protected]>
  • Loading branch information
tomsun28 committed Jun 11, 2024
1 parent e1c317f commit 061ea44
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 23 deletions.
6 changes: 3 additions & 3 deletions script/helm/hertzbeat/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@
# 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/
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.
Expand Down
14 changes: 10 additions & 4 deletions script/helm/hertzbeat/templates/database/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
$$;
4 changes: 2 additions & 2 deletions script/helm/hertzbeat/templates/database/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
6 changes: 3 additions & 3 deletions script/helm/hertzbeat/templates/database/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
47 changes: 39 additions & 8 deletions script/helm/hertzbeat/templates/manager/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ data:
enabled-by-default: on
sureness:
container: jakarta_servlet
auths:
- digest
- basic
Expand All @@ -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
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -213,14 +238,18 @@ 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/**===*
- /api/i18n/**===get
- /api/apps/hierarchy===get
- /api/push/**===*
- /api/status/page/public/**===*
# web ui resource
- /===get
- /dashboard/**===get
- /monitors/**===get
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions script/helm/hertzbeat/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ manager:
account:
username: "admin"
password: "hertzbeat"
jwtSecretKey: "CyaFv0bwq2Eik0jdrKUtsA6bx3sDJeFV143R
jwtSecretKey: "CyaFv0bwq2Eik0jdrKUtsA6dx3sDJeFV143R
LnfKefTjsIfJLBa2YkhEqEGtcHDTNe4CU6+9
8tVt4bisXQ13rbN0oxhUZR73M6EByXIO+SV5
dKhaX0csgOCTlCxq20yhmUea6H6JIpSE2Rwp"
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 061ea44

Please sign in to comment.