From ffa81a68f718bc513f75654caba7dfecfa67a672 Mon Sep 17 00:00:00 2001 From: tomsun28 Date: Wed, 14 Aug 2024 00:14:30 +0800 Subject: [PATCH] [infra] add sub git module hertzbeat-helm-chart (#2522) --- .gitmodules | 21 ++ script/helm/hertzbeat-helm-chart | 1 + script/helm/hertzbeat/.helmignore | 23 -- script/helm/hertzbeat/Chart.yaml | 37 --- script/helm/hertzbeat/README.md | 161 ---------- script/helm/hertzbeat/templates/NOTES.txt | 22 -- script/helm/hertzbeat/templates/_helpers.tpl | 67 ---- .../templates/collector/configmap.yaml | 60 ---- .../templates/collector/deployment.yaml | 84 ----- .../hertzbeat/templates/collector/hpa.yaml | 45 --- .../templates/database/configmap.yaml | 36 --- .../hertzbeat/templates/database/pvc.yaml | 46 --- .../hertzbeat/templates/database/service.yaml | 32 -- .../templates/database/statefulset.yaml | 116 ------- .../templates/manager/configmap.yaml | 300 ------------------ .../templates/manager/deployment.yaml | 89 ------ .../hertzbeat/templates/manager/ingress.yaml | 48 --- .../templates/manager/service-cluster.yaml | 33 -- .../templates/manager/service-expose.yaml | 64 ---- .../hertzbeat/templates/tsdb/configmap.yaml | 25 -- script/helm/hertzbeat/templates/tsdb/pvc.yaml | 46 --- .../hertzbeat/templates/tsdb/service.yaml | 32 -- .../hertzbeat/templates/tsdb/statefulset.yaml | 87 ----- script/helm/hertzbeat/values.yaml | 143 --------- 24 files changed, 22 insertions(+), 1596 deletions(-) create mode 100644 .gitmodules create mode 160000 script/helm/hertzbeat-helm-chart delete mode 100644 script/helm/hertzbeat/.helmignore delete mode 100644 script/helm/hertzbeat/Chart.yaml delete mode 100644 script/helm/hertzbeat/README.md delete mode 100644 script/helm/hertzbeat/templates/NOTES.txt delete mode 100644 script/helm/hertzbeat/templates/_helpers.tpl delete mode 100644 script/helm/hertzbeat/templates/collector/configmap.yaml delete mode 100644 script/helm/hertzbeat/templates/collector/deployment.yaml delete mode 100644 script/helm/hertzbeat/templates/collector/hpa.yaml delete mode 100644 script/helm/hertzbeat/templates/database/configmap.yaml delete mode 100644 script/helm/hertzbeat/templates/database/pvc.yaml delete mode 100644 script/helm/hertzbeat/templates/database/service.yaml delete mode 100644 script/helm/hertzbeat/templates/database/statefulset.yaml delete mode 100644 script/helm/hertzbeat/templates/manager/configmap.yaml delete mode 100644 script/helm/hertzbeat/templates/manager/deployment.yaml delete mode 100644 script/helm/hertzbeat/templates/manager/ingress.yaml delete mode 100644 script/helm/hertzbeat/templates/manager/service-cluster.yaml delete mode 100644 script/helm/hertzbeat/templates/manager/service-expose.yaml delete mode 100644 script/helm/hertzbeat/templates/tsdb/configmap.yaml delete mode 100644 script/helm/hertzbeat/templates/tsdb/pvc.yaml delete mode 100644 script/helm/hertzbeat/templates/tsdb/service.yaml delete mode 100644 script/helm/hertzbeat/templates/tsdb/statefulset.yaml delete mode 100644 script/helm/hertzbeat/values.yaml diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000000..a7ef9fc5dd --- /dev/null +++ b/.gitmodules @@ -0,0 +1,21 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +[submodule "script/helm/hertzbeat-helm-chart"] + path = script/helm/hertzbeat-helm-chart + url = git@github.com:apache/hertzbeat-helm-chart.git + branch = main diff --git a/script/helm/hertzbeat-helm-chart b/script/helm/hertzbeat-helm-chart new file mode 160000 index 0000000000..74027a5fda --- /dev/null +++ b/script/helm/hertzbeat-helm-chart @@ -0,0 +1 @@ +Subproject commit 74027a5fdaed41693842b343789d4e49a57a5771 diff --git a/script/helm/hertzbeat/.helmignore b/script/helm/hertzbeat/.helmignore deleted file mode 100644 index 0e8a0eb36f..0000000000 --- a/script/helm/hertzbeat/.helmignore +++ /dev/null @@ -1,23 +0,0 @@ -# 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/script/helm/hertzbeat/Chart.yaml b/script/helm/hertzbeat/Chart.yaml deleted file mode 100644 index 9bedb3948b..0000000000 --- a/script/helm/hertzbeat/Chart.yaml +++ /dev/null @@ -1,37 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -apiVersion: v2 -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 -maintainers: - - name: hertzbeat-dev - email: dev@hertzbeat.apache.org -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. -# Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.6.0 -# 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.6.0" diff --git a/script/helm/hertzbeat/README.md b/script/helm/hertzbeat/README.md deleted file mode 100644 index 0ebff08af3..0000000000 --- a/script/helm/hertzbeat/README.md +++ /dev/null @@ -1,161 +0,0 @@ -# Helm Chart for Apache HertzBeat (incubating) - -[![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/hertzbeat)](https://artifacthub.io/packages/search?repo=hertzbeat) - -

hertzbeat: An open-source, real-time monitoring system with custom monitoring, high performance cluster and agentless capabilities.

— Open in Artifact Hub
- - -## What is Apache HertzBeat (incubating)? - -[Apache HertzBeat](https://github.com/apache/hertzbeat) (incubating) is an easy-to-use, open source, real-time monitoring system with agentless, high performance cluster, prometheus-compatible, offers powerful custom monitoring and status page building capabilities. - -### Features - -* Combines **monitoring, alarm, and notification** features into one platform, and supports monitoring for web service, program, database, cache, os, webserver, middleware, bigdata, cloud-native, network, custom and more. -* Easy to use and agentless, web-based and with one-click monitoring and alerting, zero learning curve. -* Makes protocols such as `Http, Jmx, Ssh, Snmp, Jdbc, Prometheus` configurable, allowing you to collect any metrics by simply configuring the template `YML` file online. Imagine being able to quickly adapt to a new monitoring type like K8s or Docker simply by configuring online with HertzBeat. -* Compatible with the `Prometheus` ecosystem and more, can monitoring what `Prometheus` can monitoring with few clicks on webui. -* High performance, supports horizontal expansion of multi-collector clusters, multi-isolated network monitoring and cloud-edge collaboration. -* Provides flexible alarm threshold rules and timely notifications delivered via `Discord` `Slack` `Telegram` `Email` `Dingtalk` `WeChat` `FeiShu` `Webhook` `SMS` `ServerChan`. -* Provides powerful status page building capabilities, easily communicate the real-time status of your service to users. - - -> HertzBeat's powerful customization, multi-type support, high performance, easy expansion, and low coupling, aims to help developers and teams quickly build their own monitoring system. - -## Helm Chart for HertzBeat - -This [Helm](https://github.com/kubernetes/helm) chart installs [HertzBeat](https://github.com/apache/hertzbeat) in a Kubernetes cluster. Welcome to [contribute](https://github.com/apache/hertzbeat/tree/master/script/helm) to Helm Chart for HertzBeat. - -## Prerequisites - -- Kubernetes cluster 1.20+ -- Helm v3.2.0+ - -## Installation - -### Add Helm repository - -```bash -helm repo add hertzbeat https://charts.hertzbeat.com/ -helm repo update -``` - -### Configure the chart - -The following items can be set via `--set` flag during installation or configured by editing the `values.yaml` directly (need to download the chart first). - -#### Configure how to expose HertzBeat service - -- **Ingress**: The ingress controller must be installed in the Kubernetes cluster. -- **ClusterIP**: Exposes the service on a cluster-internal IP. Choosing this value makes the service only reachable from within the cluster. -- **NodePort**: Exposes the service on each Node’s IP at a static port (the NodePort). You’ll be able to contact the NodePort service, from outside the cluster, by requesting `NodeIP:NodePort`. -- **LoadBalancer**: Exposes the service externally using a cloud provider’s load balancer. - -#### Configure the external URL - -The external URL for HertzBeat core service is used to: - -1. populate the docker/helm commands showed on portal -2. populate the token service URL returned to docker client - -Format: `protocol://domain[:port]`. Usually: - -- if service exposed via `Ingress`, the `domain` should be the value of `expose.ingress.hosts` -- if service exposed via `ClusterIP`, the `domain` should be the value of `expose.clusterIP.name` -- if service exposed via `NodePort`, the `domain` should be the IP address of one Kubernetes node -- if service exposed via `LoadBalancer`, set the `domain` as your own domain name and add a CNAME record to map the domain name to the one you got from the cloud provider - -If HertzBeat is deployed behind the proxy, set it as the URL of proxy. - -#### Configure how to persist data - -- **Disable**: The data does not survive the termination of a pod. -- **Persistent Volume Claim(default)**: A default `StorageClass` is needed in the Kubernetes cluster to dynamically provision the volumes. Specify another StorageClass in the `storageClass` or set `existingClaim` if you already have existing persistent volumes to use. - -#### Configure the other items listed in [configuration](#configuration) section - -### Install the chart - -Install the HertzBeat helm chart with a release name `my-release`: -```bash -helm install hertzbeat hertzbeat/hertzbeat -``` - -## Uninstallation - -To uninstall/delete the `hertzbeat` deployment: -```bash -helm uninstall hertzbeat -``` - -## Configuration - -The following table lists the configurable parameters of the HertzBeat chart and the default values. - -| Parameter | Description | Default | -|---------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------| -| **Expose** | | | -| `expose.type` | How to expose the service: `Ingress`, `ClusterIP`, `NodePort` or `LoadBalancer`, other values will be ignored and the creation of service will be skipped. | `Ingress` | -| `expose.clusterIP.name` | The name of ClusterIP service | `hertzbeat` | -| `expose.clusterIP.annotations` | The annotations attached to the ClusterIP service | {} | -| `expose.clusterIP.ports.port` | The service port HertzBeat listens on when serving HTTP | `80` | -| `expose.nodePort.name` | The name of NodePort service | `hertzbeat` | -| `expose.nodePort.ports.port` | The service port HertzBeat listens on when serving HTTP | `80` | -| `expose.nodePort.ports.nodePort` | The node port HertzBeat listens on when serving HTTP | `30002` | -| `expose.loadBalancer.IP` | The IP of the loadBalancer. It only works when loadBalancer supports assigning IP | `""` | -| `expose.loadBalancer.ports.port` | The service port HertzBeat listens on when serving HTTP | `80` | -| `expose.loadBalancer.sourceRanges` | List of IP address ranges to assign to loadBalancerSourceRanges | [] | -| **Manager** | | | -| `manager.account.username` | The hertzbeat account username | `admin` | -| `manager.account.password` | The hertzbeat account password | `hertzbeat` | -| `manager.resources` | The [resources] to allocate for container | undefined | -| `manager.nodeSelector` | Node labels for pod assignment | `{}` | -| `manager.tolerations` | Tolerations for pod assignment | `[]` | -| `manager.affinity` | Node/Pod affinities | `{}` | -| `manager.podAnnotations` | Annotations to add to the nginx pod | `{}` | -| **Collector** | | | -| `collector.replicaCount` | The replica count | `1` | -| `collector.autoscaling.enable` | Is enable auto scaling collector replicas | `1` | -| `collector.resources` | The [resources] to allocate for container | undefined | -| `collector.nodeSelector` | Node labels for pod assignment | `{}` | -| `collector.tolerations` | Tolerations for pod assignment | `[]` | -| `collector.affinity` | Node/Pod affinities | `{}` | -| `collector.podAnnotations` | Annotations to add to the nginx pod | `{}` | -| **Database** | | | -| `database.timezone` | The database system timezone | `1` | -| `database.rootPassword` | The database root user password | `1` | -| `database.persistence.enabled` | Enable the data persistence or not | `true` | -| `database.persistence.resourcePolicy` | Setting it to `keep` to avoid removing PVCs during a helm delete operation. Leaving it empty will delete PVCs after the chart deleted. Does not affect PVCs created for internal database and redis components. | `keep` | -| `database.persistence.existingClaim` | Use the existing PVC which must be created manually before bound, and specify the `subPath` if the PVC is shared with other components | | -| `database.persistence.storageClass` | Specify the `storageClass` used to provision the volume. Or the default StorageClass will be used (the default). Set it to `-` to disable dynamic provisioning | | -| `database.persistence.subPath` | The sub path used in the volume | | -| `database.persistence.accessMode` | The access mode of the volume | `ReadWriteOnce` | -| `database.persistence.size` | The size of the volume | `5Gi` | -| `database.persistence.annotations` | The annotations of the volume | | -| `database.resources` | The [resources] to allocate for container | undefined | -| `database.nodeSelector` | Node labels for pod assignment | `{}` | -| `database.tolerations` | Tolerations for pod assignment | `[]` | -| `database.affinity` | Node/Pod affinities | `{}` | -| `database.podAnnotations` | Annotations to add to the nginx pod | `{}` | -| **TSDB** | | | -| `tsdb.timezone` | The database system timezone | `1` | -| `tsdb.persistence.enabled` | Enable the data persistence or not | `true` | -| `tsdb.persistence.resourcePolicy` | Setting it to `keep` to avoid removing PVCs during a helm delete operation. Leaving it empty will delete PVCs after the chart deleted. Does not affect PVCs created for internal database and redis components. | `keep` | -| `tsdb.persistence.existingClaim` | Use the existing PVC which must be created manually before bound, and specify the `subPath` if the PVC is shared with other components | | -| `tsdb.persistence.storageClass` | Specify the `storageClass` used to provision the volume. Or the default StorageClass will be used (the default). Set it to `-` to disable dynamic provisioning | | -| `tsdb.persistence.subPath` | The sub path used in the volume | | -| `tsdb.persistence.accessMode` | The access mode of the volume | `ReadWriteOnce` | -| `tsdb.persistence.size` | The size of the volume | `5Gi` | -| `tsdb.persistence.annotations` | The annotations of the volume | | -| `tsdb.resources` | The [resources] to allocate for container | undefined | -| `tsdb.nodeSelector` | Node labels for pod assignment | `{}` | -| `tsdb.tolerations` | Tolerations for pod assignment | `[]` | -| `tsdb.affinity` | Node/Pod affinities | `{}` | -| `tsdb.podAnnotations` | Annotations to add to the nginx pod | `{}` | - - -[resources]: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ -[hertzbeat]: https://github.com/apache/hertzbeat/ -[artifacthub]: https://artifacthub.io/ -[helm]: https://helm.sh/ - diff --git a/script/helm/hertzbeat/templates/NOTES.txt b/script/helm/hertzbeat/templates/NOTES.txt deleted file mode 100644 index 376794e1b1..0000000000 --- a/script/helm/hertzbeat/templates/NOTES.txt +++ /dev/null @@ -1,22 +0,0 @@ -1. Get the application URL by running these commands: -{{- if (eq .Values.expose.type "Ingress")}} -http{{ if $.Values.expose.ingress.tls.enable }}s{{ end }}://{{ .Values.expose.ingress.host }} - -{{- else if contains "NodePort" .Values.expose.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "hertzbeat.fullname" . }}-http) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT - -{{- else if contains "LoadBalancer" .Values.expose.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "hertzbeat.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "hertzbeat.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo http://$SERVICE_IP:{{ .Values.expose.loadBalancer.ports.port }} - -{{- else if contains "ClusterIP" .Values.expose.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "hertzbeat.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT - -{{- end }} diff --git a/script/helm/hertzbeat/templates/_helpers.tpl b/script/helm/hertzbeat/templates/_helpers.tpl deleted file mode 100644 index 4b64c3a038..0000000000 --- a/script/helm/hertzbeat/templates/_helpers.tpl +++ /dev/null @@ -1,67 +0,0 @@ -{{/* -Expand the name of the chart. -*/}} -{{- define "hertzbeat.name" -}} -{{- default .Chart.Name | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "hertzbeat.fullname" -}} -{{- $name := default .Chart.Name }} -{{- if contains $name .Release.Name }} -{{- .Release.Name | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} -{{- end }} -{{- end }} - -{{- define "hertzbeat.manager" -}} -{{- printf "%s" (include "hertzbeat.fullname" .) -}} -{{- end -}} - -{{- define "hertzbeat.manager.host" -}} -{{- printf "%s-cluster" (include "hertzbeat.manager" .) -}} -{{- end -}} - -{{- define "hertzbeat.collector" -}} -{{- printf "%s-collector" (include "hertzbeat.fullname" .) -}} -{{- end -}} - -{{- define "hertzbeat.database" -}} -{{- printf "%s-database" (include "hertzbeat.fullname" .) -}} -{{- end -}} - -{{- define "hertzbeat.tsdb" -}} -{{- printf "%s-tsdb" (include "hertzbeat.fullname" .) -}} -{{- end -}} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "hertzbeat.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Common labels -*/}} -{{- define "hertzbeat.labels" -}} -helm.sh/chart: {{ include "hertzbeat.chart" . }} -{{ include "hertzbeat.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end }} - -{{/* -Selector labels -*/}} -{{- define "hertzbeat.selectorLabels" -}} -app.kubernetes.io/name: {{ include "hertzbeat.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end }} diff --git a/script/helm/hertzbeat/templates/collector/configmap.yaml b/script/helm/hertzbeat/templates/collector/configmap.yaml deleted file mode 100644 index 94345ab3fd..0000000000 --- a/script/helm/hertzbeat/templates/collector/configmap.yaml +++ /dev/null @@ -1,60 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -apiVersion: v1 -kind: ConfigMap -metadata: - name: "{{ include "hertzbeat.collector" . }}" - labels: - {{- include "hertzbeat.labels" . | nindent 4 }} -data: - IDENTITY: "" - MANAGER_HOST: "{{ include "hertzbeat.manager.host" . }}" - MANAGER_PORT: "1158" - application.yml: |+ - server: - port: 1159 - spring: - application: - name: ${HOSTNAME:@hertzbeat-collector@}${PID} - profiles: - active: cluster - jackson: - default-property-inclusion: ALWAYS - # need to disable spring boot mongodb auto config, or default mongodb connection tried and failed... - autoconfigure: - exclude: org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration, org.springframework.boot.autoconfigure.data.mongo.MongoDataAutoConfiguration - - --- - spring: - config: - activate: - on-profile: cluster - - collector: - dispatch: - entrance: - netty: - enabled: true - identity: ${IDENTITY:} - mode: ${MODE:public} - manager-host: ${MANAGER_HOST:127.0.0.1} - manager-port: ${MANAGER_PORT:1158} - - common: - queue: - type: netty diff --git a/script/helm/hertzbeat/templates/collector/deployment.yaml b/script/helm/hertzbeat/templates/collector/deployment.yaml deleted file mode 100644 index 98954b7f9f..0000000000 --- a/script/helm/hertzbeat/templates/collector/deployment.yaml +++ /dev/null @@ -1,84 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "hertzbeat.collector" . }} - labels: - {{- include "hertzbeat.labels" . | nindent 4 }} - component: collector -spec: - {{- if not .Values.collector.autoscaling.enabled }} - replicas: {{ .Values.collector.replicaCount }} - {{- end }} - selector: - matchLabels: - {{- include "hertzbeat.selectorLabels" . | nindent 6 }} - component: collector - template: - metadata: - {{- with .Values.collector.podAnnotations }} - annotations: - {{- toYaml . | nindent 8 }} - {{- end }} - labels: - {{- include "hertzbeat.selectorLabels" . | nindent 8 }} - component: collector - spec: - securityContext: - {{- toYaml .Values.collector.podSecurityContext | nindent 8 }} - containers: - - name: hertzbeat-collector - securityContext: - {{- toYaml .Values.collector.securityContext | nindent 12 }} - image: "{{ .Values.collector.image.repository }}:{{ .Values.collector.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.collector.image.pullPolicy }} - ports: - - containerPort: 1159 - protocol: TCP - livenessProbe: - tcpSocket: - port: 1159 - readinessProbe: - tcpSocket: - port: 1159 - envFrom: - - configMapRef: - name: "{{ include "hertzbeat.collector" . }}" - volumeMounts: - - mountPath: /opt/hertzbeat-collector/config/application.yml - subPath: application.yml - name: application - resources: - {{- toYaml .Values.collector.resources | nindent 12 }} - volumes: - - name: application - configMap: - name: {{ include "hertzbeat.collector" . }} - {{- with .Values.collector.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.collector.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.collector.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} diff --git a/script/helm/hertzbeat/templates/collector/hpa.yaml b/script/helm/hertzbeat/templates/collector/hpa.yaml deleted file mode 100644 index ee82be3d4a..0000000000 --- a/script/helm/hertzbeat/templates/collector/hpa.yaml +++ /dev/null @@ -1,45 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -{{- if .Values.collector.autoscaling.enabled }} -apiVersion: autoscaling/v2beta1 -kind: HorizontalPodAutoscaler -metadata: - name: {{ include "hertzbeat.collector" . }} - labels: - {{- include "hertzbeat.labels" . | nindent 4 }} -spec: - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: {{ include "hertzbeat.collector" . }} - minReplicas: {{ .Values.collector.autoscaling.minReplicas }} - maxReplicas: {{ .Values.collector.autoscaling.maxReplicas }} - metrics: - {{- if .Values.collector.autoscaling.targetCPUUtilizationPercentage }} - - type: Resource - resource: - name: cpu - targetAverageUtilization: {{ .Values.collector.autoscaling.targetCPUUtilizationPercentage }} - {{- end }} - {{- if .Values.collector.autoscaling.targetMemoryUtilizationPercentage }} - - type: Resource - resource: - name: memory - targetAverageUtilization: {{ .Values.collector.autoscaling.targetMemoryUtilizationPercentage }} - {{- end }} -{{- end }} diff --git a/script/helm/hertzbeat/templates/database/configmap.yaml b/script/helm/hertzbeat/templates/database/configmap.yaml deleted file mode 100644 index 4c9c3e91c4..0000000000 --- a/script/helm/hertzbeat/templates/database/configmap.yaml +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -apiVersion: v1 -kind: ConfigMap -metadata: - name: "{{ include "hertzbeat.database" . }}" - labels: - {{- include "hertzbeat.labels" . | nindent 4 }} -data: - TZ: "{{ .Values.database.timezone }}" - POSTGRES_PASSWORD: "{{ .Values.database.rootPassword }}" - POSTGRES_USER: "root" - schema.sql: |+ - 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/script/helm/hertzbeat/templates/database/pvc.yaml b/script/helm/hertzbeat/templates/database/pvc.yaml deleted file mode 100644 index 69f6ad4493..0000000000 --- a/script/helm/hertzbeat/templates/database/pvc.yaml +++ /dev/null @@ -1,46 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -{{- if .Values.database.persistence.enabled }} -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: {{ template "hertzbeat.database" . }} - annotations: - {{- range $key, $value := .Values.database.persistence.annotations }} - {{ $key }}: {{ $value | quote }} - {{- end }} - {{- if eq .Values.database.persistence.resourcePolicy "keep" }} - helm.sh/resource-policy: keep - {{- end }} - labels: - {{- include "hertzbeat.labels" . | nindent 4 }} - component: database -spec: - accessModes: - - {{ .Values.database.persistence.accessMode }} - resources: - requests: - storage: {{ .Values.database.persistence.size }} - {{- if .Values.database.persistence.storageClass }} - {{- if eq "-" .Values.database.persistence.storageClass }} - storageClassName: "" - {{- else }} - storageClassName: {{ .Values.database.persistence.storageClass }} - {{- end }} - {{- end }} -{{- end }} diff --git a/script/helm/hertzbeat/templates/database/service.yaml b/script/helm/hertzbeat/templates/database/service.yaml deleted file mode 100644 index e95d860d24..0000000000 --- a/script/helm/hertzbeat/templates/database/service.yaml +++ /dev/null @@ -1,32 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -apiVersion: v1 -kind: Service -metadata: - name: {{ include "hertzbeat.database" . }} - labels: - {{- include "hertzbeat.labels" . | nindent 4 }} -spec: - type: ClusterIP - ports: - - port: 5432 - targetPort: 5432 - protocol: TCP - selector: - {{- include "hertzbeat.selectorLabels" . | nindent 4 }} - component: database diff --git a/script/helm/hertzbeat/templates/database/statefulset.yaml b/script/helm/hertzbeat/templates/database/statefulset.yaml deleted file mode 100644 index 85d4e9f608..0000000000 --- a/script/helm/hertzbeat/templates/database/statefulset.yaml +++ /dev/null @@ -1,116 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: {{ include "hertzbeat.database" . }} - labels: - {{- include "hertzbeat.labels" . | nindent 4 }} - component: database -spec: - replicas: 1 - serviceName: {{ include "hertzbeat.database" . }} - selector: - matchLabels: - {{- include "hertzbeat.selectorLabels" . | nindent 6 }} - component: database - template: - metadata: - {{- with .Values.database.podAnnotations }} - annotations: - {{- toYaml . | nindent 8 }} - {{- end }} - labels: - {{- include "hertzbeat.selectorLabels" . | nindent 8 }} - component: database - spec: - securityContext: - {{- toYaml .Values.database.podSecurityContext | nindent 8 }} - containers: - - name: database - image: {{ .Values.database.image.repository }}:{{ .Values.database.image.tag }} - imagePullPolicy: {{ .Values.database.image.pullPolicy }} - livenessProbe: - tcpSocket: - port: 5432 - initialDelaySeconds: 300 - periodSeconds: 10 - readinessProbe: - tcpSocket: - port: 5432 - initialDelaySeconds: 1 - periodSeconds: 10 - resources: - {{- toYaml .Values.database.resources | nindent 12 }} - envFrom: - - configMapRef: - name: "{{ include "hertzbeat.database" . }}" - volumeMounts: - - name: data - mountPath: /var/lib/postgresql/data - subPath: "" - - mountPath: /docker-entrypoint-initdb.d/schema.sql - subPath: schema.sql - name: schema - volumes: - - name: schema - configMap: - name: {{ include "hertzbeat.database" . }} - {{- if not .Values.database.persistence.enabled }} - - name: data - emptyDir: {} - {{- else }} - - name: data - persistentVolumeClaim: - claimName: {{ .Values.database.persistence.existingClaim | default (include "hertzbeat.database" .) }} - {{- end }} - {{- with .Values.database.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.database.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.database.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} -{{/* {{- if and .Values.database.persistence.enabled (not .Values.database.persistence.existingClaim) }}*/}} -{{/* volumeClaimTemplates:*/}} -{{/* - metadata:*/}} -{{/* name: data*/}} -{{/* labels:*/}} -{{/* {{- include "hertzbeat.labels" . | indent 10 }}*/}} -{{/* annotations:*/}} -{{/* {{- range $key, $value := .Values.database.persistence.annotations }}*/}} -{{/* {{ $key }}: {{ $value | quote }}*/}} -{{/* {{- end }}*/}} -{{/* spec:*/}} -{{/* accessModes: [{{ .Values.database.persistence.accessMode | quote }}]*/}} -{{/* {{- if .Values.database.persistence.storageClass }}*/}} -{{/* {{- if (eq "-" .Values.database.persistence.storageClass) }}*/}} -{{/* storageClassName: ""*/}} -{{/* {{- else }}*/}} -{{/* storageClassName: "{{ .Values.database.persistence.storageClass }}"*/}} -{{/* {{- end }}*/}} -{{/* {{- end }}*/}} -{{/* resources:*/}} -{{/* requests:*/}} -{{/* storage: {{ .Values.database.persistence.size | quote }}*/}} -{{/* {{- end -}}*/}} diff --git a/script/helm/hertzbeat/templates/manager/configmap.yaml b/script/helm/hertzbeat/templates/manager/configmap.yaml deleted file mode 100644 index f96c2f7d55..0000000000 --- a/script/helm/hertzbeat/templates/manager/configmap.yaml +++ /dev/null @@ -1,300 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -apiVersion: v1 -kind: ConfigMap -metadata: - name: "{{ include "hertzbeat.manager" . }}" - labels: - {{- include "hertzbeat.labels" . | nindent 4 }} -data: - application.yml: |+ - server: - port: 1157 - spring: - application: - name: ${HOSTNAME:@hertzbeat@}${PID} - profiles: - active: prod - mvc: - static-path-pattern: /** - jackson: - default-property-inclusion: ALWAYS - web: - resources: - static-locations: - - classpath:/dist/ - - classpath:../dist/ - # need to disable spring boot mongodb auto config, or default mongodb connection tried and failed.. - autoconfigure: - exclude: org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration, org.springframework.boot.autoconfigure.data.mongo.MongoDataAutoConfiguration - freemarker: - enabled: false - management: - health: - mail: - enabled: off - endpoints: - web: - exposure: - include: - - 'metrics' - - 'health' - - 'env' - enabled-by-default: on - - sureness: - container: jakarta_servlet - auths: - - digest - - basic - - jwt - jwt: - secret: {{ .Values.manager.jwtSecretKey }} - - --- - spring: - config: - activate: - on-profile: prod - - datasource: - driver-class-name: org.postgresql.Driver - username: root - password: {{ .Values.database.rootPassword }} - url: jdbc:postgresql://{{ include "hertzbeat.database" . }}:5432/hertzbeat - hikari: - max-lifetime: 120000 - jpa: - 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 - host: smtp.qq.com - username: tancloud@qq.com - # Attention: this is not email account password, this requires an email authorization code - # 请注意此非邮箱账户密码 此需填写邮箱授权码 - password: your-password - #Attention: Tencent mail smtps 465,smtp 587 - #请注意腾讯邮箱465为smtps,587为smtp - port: 587 - properties: - mail: - smtp: - socketFactoryClass: javax.net.ssl.SSLSocketFactory - ssl: - enable: true - - common: - queue: - # memory or kafka - type: memory - # properties when queue type is kafka - kafka: - servers: 127.0.0.1:9092 - metrics-data-topic: async-metrics-data - alerts-data-topic: async-alerts-data - - warehouse: - store: - # store history metrics data, enable only one below - # 存储历史数据方式, 下方只能enabled启用一种方式 - jpa: - enabled: false - victoria-metrics: - enabled: true - url: http://{{ include "hertzbeat.tsdb" . }}:8428 - username: root - password: root - td-engine: - enabled: false - driver-class-name: com.taosdata.jdbc.rs.RestfulDriver - url: jdbc:TAOS-RS://{{ include "hertzbeat.tsdb" . }}:6041/hertzbeat - username: root - password: taosdata - greptime: - enabled: false - endpoint: localhost:4001 - iot-db: - enabled: false - host: {{ include "hertzbeat.tsdb" . }} - rpc-port: 6667 - username: root - password: root - # org.apache.hertzbeat.warehouse.config.IotDbVersion: V_0_13 || V_1_0 - version: V_1_0 - query-timeout-in-ms: -1 - # 数据存储时间:默认'7776000000'(90天,单位为毫秒,-1代表永不过期) - # data expire time, unit:ms, default '7776000000'(90 days, -1:never expire) - expire-time: '7776000000' - influxdb: - enabled: false - server-url: http://127.0.0.1:8086 - username: root - password: root - expire-time: '30d' - replication: 1 - - # store real-time metrics data, enable only one below - # 存储实时数据方式, 下方只能enabled启用一种方式 - memory: - enabled: true - init-size: 16 - redis: - enabled: false - host: 127.0.0.1 - port: 6379 - password: 123456 - db: 0 - - alerter: - # custom console url - console-url: https://console.tancloud.io - # 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] - - /api/apps/**===get===[admin,user,guest] - - /api/monitor/**===get===[admin,user,guest] - - /api/monitor/**===post===[admin,user] - - /api/monitor/**===put===[admin,user] - - /api/monitor/**===delete==[admin] - - /api/monitors/**===get===[admin,user,guest] - - /api/monitors/**===post===[admin,user] - - /api/monitors/**===put===[admin,user] - - /api/monitors/**===delete===[admin] - - /api/alert/**===get===[admin,user,guest] - - /api/alert/**===post===[admin,user] - - /api/alert/**===put===[admin,user] - - /api/alert/**===delete===[admin] - - /api/alerts/**===get===[admin,user,guest] - - /api/alerts/**===post===[admin,user] - - /api/alerts/**===put===[admin,user] - - /api/alerts/**===delete===[admin] - - /api/notice/**===get===[admin,user,guest] - - /api/notice/**===post===[admin,user] - - /api/notice/**===put===[admin,user] - - /api/notice/**===delete===[admin] - - /api/tag/**===get===[admin,user,guest] - - /api/tag/**===post===[admin,user] - - /api/tag/**===put===[admin,user] - - /api/tag/**===delete===[admin] - - /api/summary/**===get===[admin,user,guest] - - /api/summary/**===post===[admin,user] - - /api/summary/**===put===[admin,user] - - /api/summary/**===delete===[admin] - - /api/collector/**===get===[admin,user,guest] - - /api/collector/**===post===[admin,user] - - /api/collector/**===put===[admin,user] - - /api/collector/**===delete===[admin] - - /api/status/page/**===get===[admin,user,guest] - - /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 - - /alert/**===get - - /account/**===get - - /setting/**===get - - /passport/**===get - - /status/**===get - - /**/*.html===get - - /**/*.js===get - - /**/*.css===get - - /**/*.ico===get - - /**/*.ttf===get - - /**/*.png===get - - /**/*.gif===get - - /**/*.jpg===get - - /**/*.svg===get - - /**/*.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 - # eg: admin has role [admin,user], password is hertzbeat - # eg: tom has role [user], password is hertzbeat - # eg: lili has role [guest], plain password is lili, salt is 123, salted password is 1A676730B0C7F54654B0E09184448289 - account: - - appId: {{ .Values.manager.account.username }} - credential: {{ .Values.manager.account.password }} - role: [admin] - - appId: tom - credential: hertzbeat - role: [user] - - appId: guest - credential: hertzbeat - role: [guest] - - appId: lili - # credential = MD5(password + salt) - # plain password: hertzbeat - # attention: digest authentication does not support salted encrypted password accounts - credential: 94C6B34E7A199A9F9D4E1F208093B489 - salt: 123 - role: [user] diff --git a/script/helm/hertzbeat/templates/manager/deployment.yaml b/script/helm/hertzbeat/templates/manager/deployment.yaml deleted file mode 100644 index 77fd44bb86..0000000000 --- a/script/helm/hertzbeat/templates/manager/deployment.yaml +++ /dev/null @@ -1,89 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "hertzbeat.manager" . }} - labels: - {{- include "hertzbeat.labels" . | nindent 4 }} - component: manager -spec: - replicas: 1 - selector: - matchLabels: - {{- include "hertzbeat.selectorLabels" . | nindent 6 }} - component: manager - template: - metadata: - {{- with .Values.manager.podAnnotations }} - annotations: - {{- toYaml . | nindent 8 }} - {{- end }} - labels: - {{- include "hertzbeat.selectorLabels" . | nindent 8 }} - component: manager - spec: - securityContext: - {{- toYaml .Values.manager.podSecurityContext | nindent 8 }} - containers: - - name: {{ .Chart.Name }} - securityContext: - {{- toYaml .Values.manager.securityContext | nindent 12 }} - image: "{{ .Values.manager.image.repository }}:{{ .Values.manager.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.manager.image.pullPolicy }} - ports: - - name: http - containerPort: 1157 - protocol: TCP - - name: cluster - containerPort: 1158 - protocol: TCP - livenessProbe: - tcpSocket: - port: 1157 - readinessProbe: - tcpSocket: - port: 1157 - volumeMounts: - - mountPath: /opt/hertzbeat/config/application.yml - subPath: application.yml - name: application - - mountPath: /opt/hertzbeat/config/sureness.yml - subPath: sureness.yml - name: sureness - resources: - {{- toYaml .Values.manager.resources | nindent 12 }} - volumes: - - name: application - configMap: - name: {{ include "hertzbeat.manager" . }} - - name: sureness - configMap: - name: {{ include "hertzbeat.manager" . }} - {{- with .Values.manager.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.manager.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.manager.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} diff --git a/script/helm/hertzbeat/templates/manager/ingress.yaml b/script/helm/hertzbeat/templates/manager/ingress.yaml deleted file mode 100644 index 53aa725e24..0000000000 --- a/script/helm/hertzbeat/templates/manager/ingress.yaml +++ /dev/null @@ -1,48 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -{{- if .Values.expose.ingress.enabled }} -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: "{{ include "hertzbeat.manager" . }}-ingress" - annotations: - {{- toYaml .Values.expose.ingress.annotations | nindent 4 }} - labels: - {{- include "hertzbeat.labels" . | nindent 4 }} -spec: - {{if .Values.expose.ingress.ingressClassName }} - ingressClassName: {{ .Values.expose.ingress.ingressClassName }} - {{end}} - rules: - - host: {{ .Values.expose.ingress.host }} - http: - paths: - - path: / - pathType: Prefix - backend: - service: - name: "{{ include "hertzbeat.manager" . }}-http" - port: - number: 1157 - tls: - {{- if .Values.expose.ingress.tls.enabled }} - - secretName: {{ .Values.expose.ingress.tls.secretName }} - hosts: - - {{ .Values.expose.ingress.host }} - {{- end }} -{{- end }} diff --git a/script/helm/hertzbeat/templates/manager/service-cluster.yaml b/script/helm/hertzbeat/templates/manager/service-cluster.yaml deleted file mode 100644 index 2262cb67ff..0000000000 --- a/script/helm/hertzbeat/templates/manager/service-cluster.yaml +++ /dev/null @@ -1,33 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -apiVersion: v1 -kind: Service -metadata: - name: "{{ include "hertzbeat.manager" . }}-cluster" - labels: - {{- include "hertzbeat.labels" . | nindent 4 }} -spec: - type: ClusterIP - ports: - - port: 1158 - targetPort: 1158 - protocol: TCP - name: cluster - selector: - {{- include "hertzbeat.selectorLabels" . | nindent 4 }} - component: manager diff --git a/script/helm/hertzbeat/templates/manager/service-expose.yaml b/script/helm/hertzbeat/templates/manager/service-expose.yaml deleted file mode 100644 index 6da190153b..0000000000 --- a/script/helm/hertzbeat/templates/manager/service-expose.yaml +++ /dev/null @@ -1,64 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -{{- if or (eq .Values.expose.type "ClusterIP") (eq .Values.expose.type "NodePort") (eq .Values.expose.type "LoadBalancer") (eq .Values.expose.type "Ingress") }} -apiVersion: v1 -kind: Service -metadata: - name: "{{ include "hertzbeat.manager" . }}-http" - labels: - {{- include "hertzbeat.labels" . | nindent 4 }} -{{- if or (eq .Values.expose.type "ClusterIP") (eq .Values.expose.type "Ingress") }} -spec: - type: ClusterIP - ports: - - name: http - port: {{ .Values.expose.clusterIP.ports.port }} - targetPort: 1157 - selector: - {{- include "hertzbeat.selectorLabels" . | nindent 4 }} - component: manager -{{- else if eq .Values.expose.type "NodePort" }} -spec: - type: NodePort - ports: - - port: {{ .Values.expose.nodePort.ports.port }} - targetPort: 1157 - protocol: TCP - name: http - {{- if .Values.expose.nodePort.ports.nodePort }} - nodePort: {{ .Values.expose.nodePort.ports.nodePort }} - {{- end }} - selector: - {{- include "hertzbeat.selectorLabels" . | nindent 4 }} - component: manager -{{- else if eq .Values.expose.type "LoadBalancer" }} -spec: - type: LoadBalancer - {{- with .Values.expose.loadBalancer.sourceRanges }} - loadBalancerSourceRanges: - {{- toYaml . | nindent 4 }} - {{- end }} - {{- if .Values.expose.loadBalancer.ip }} - loadBalancerIP: {{ .Values.expose.loadBalancer.ip }} - {{- end }} - ports: - - name: http - port: {{ .Values.expose.loadBalancer.ports.port }} - targetPort: 1157 -{{- end }} -{{- end }} diff --git a/script/helm/hertzbeat/templates/tsdb/configmap.yaml b/script/helm/hertzbeat/templates/tsdb/configmap.yaml deleted file mode 100644 index a8263dd2a6..0000000000 --- a/script/helm/hertzbeat/templates/tsdb/configmap.yaml +++ /dev/null @@ -1,25 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -apiVersion: v1 -kind: ConfigMap -metadata: - name: "{{ include "hertzbeat.tsdb" . }}" - labels: - {{- include "hertzbeat.labels" . | nindent 4 }} -data: - TZ: "{{ .Values.database.timezone }}" diff --git a/script/helm/hertzbeat/templates/tsdb/pvc.yaml b/script/helm/hertzbeat/templates/tsdb/pvc.yaml deleted file mode 100644 index 409615122c..0000000000 --- a/script/helm/hertzbeat/templates/tsdb/pvc.yaml +++ /dev/null @@ -1,46 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -{{- if .Values.tsdb.persistence.enabled }} -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: {{ template "hertzbeat.tsdb" . }} - annotations: - {{- range $key, $value := .Values.tsdb.persistence.annotations }} - {{ $key }}: {{ $value | quote }} - {{- end }} - {{- if eq .Values.tsdb.persistence.resourcePolicy "keep" }} - helm.sh/resource-policy: keep - {{- end }} - labels: - {{- include "hertzbeat.labels" . | nindent 4 }} - component: tsdb -spec: - accessModes: - - {{ .Values.tsdb.persistence.accessMode }} - resources: - requests: - storage: {{ .Values.tsdb.persistence.size }} - {{- if .Values.tsdb.persistence.storageClass }} - {{- if eq "-" .Values.tsdb.persistence.storageClass }} - storageClassName: "" - {{- else }} - storageClassName: {{ .Values.tsdb.persistence.storageClass }} - {{- end }} - {{- end }} -{{- end }} diff --git a/script/helm/hertzbeat/templates/tsdb/service.yaml b/script/helm/hertzbeat/templates/tsdb/service.yaml deleted file mode 100644 index 44f992f565..0000000000 --- a/script/helm/hertzbeat/templates/tsdb/service.yaml +++ /dev/null @@ -1,32 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -apiVersion: v1 -kind: Service -metadata: - name: {{ include "hertzbeat.tsdb" . }} - labels: - {{- include "hertzbeat.labels" . | nindent 4 }} -spec: - type: ClusterIP - ports: - - port: 8428 - targetPort: 8428 - protocol: TCP - selector: - {{- include "hertzbeat.selectorLabels" . | nindent 4 }} - component: tsdb diff --git a/script/helm/hertzbeat/templates/tsdb/statefulset.yaml b/script/helm/hertzbeat/templates/tsdb/statefulset.yaml deleted file mode 100644 index 891ada92e7..0000000000 --- a/script/helm/hertzbeat/templates/tsdb/statefulset.yaml +++ /dev/null @@ -1,87 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: {{ include "hertzbeat.tsdb" . }} - labels: - {{- include "hertzbeat.labels" . | nindent 4 }} - component: tsdb -spec: - replicas: 1 - serviceName: {{ include "hertzbeat.tsdb" . }} - selector: - matchLabels: - {{- include "hertzbeat.selectorLabels" . | nindent 6 }} - component: tsdb - template: - metadata: - {{- with .Values.tsdb.podAnnotations }} - annotations: - {{- toYaml . | nindent 8 }} - {{- end }} - labels: - {{- include "hertzbeat.selectorLabels" . | nindent 8 }} - component: tsdb - spec: - securityContext: - {{- toYaml .Values.tsdb.podSecurityContext | nindent 8 }} - containers: - - name: tsdb - image: {{ .Values.tsdb.image.repository }}:{{ .Values.tsdb.image.tag }} - imagePullPolicy: {{ .Values.tsdb.image.pullPolicy }} - livenessProbe: - tcpSocket: - port: 8428 - initialDelaySeconds: 300 - periodSeconds: 10 - readinessProbe: - tcpSocket: - port: 8428 - initialDelaySeconds: 1 - periodSeconds: 10 - resources: - {{- toYaml .Values.tsdb.resources | nindent 12 }} - envFrom: - - configMapRef: - name: "{{ include "hertzbeat.tsdb" . }}" - volumeMounts: - - name: data - mountPath: /victoria-metrics-data - subPath: "" - volumes: - {{- if not .Values.tsdb.persistence.enabled }} - - name: data - emptyDir: {} - {{- else }} - - name: data - persistentVolumeClaim: - claimName: {{ .Values.tsdb.persistence.existingClaim | default (include "hertzbeat.tsdb" .) }} - {{- end }} - {{- with .Values.tsdb.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.tsdb.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.tsdb.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} diff --git a/script/helm/hertzbeat/values.yaml b/script/helm/hertzbeat/values.yaml deleted file mode 100644 index 49ff444398..0000000000 --- a/script/helm/hertzbeat/values.yaml +++ /dev/null @@ -1,143 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -# Default values for hertzbeat. - -manager: - image: - repository: apache/hertzbeat - pullPolicy: IfNotPresent - # Overrides the image tag whose default is the chart appVersion. - tag: "" - account: - username: "admin" - password: "hertzbeat" - jwtSecretKey: "CyaFv0bwq2Eik0jdrKUtsA6dx3sDJeFV143R - LnfKefTjsIfJLBa2YkhEqEGtcHDTNe4CU6+9 - 8tVt4bisXQ13rbN0oxhUZR73M6EByXIO+SV5 - dKhaX0csgOCTlCxq20yhmUea6H6JIpSE2Rwp" - podAnnotations: { } - podSecurityContext: { } - securityContext: { } - resources: { } - nodeSelector: { } - tolerations: [ ] - affinity: { } - -collector: - image: - repository: apache/hertzbeat-collector - pullPolicy: IfNotPresent - # Overrides the image tag whose default is the chart appVersion. - tag: "" - replicaCount: 1 - autoscaling: - enabled: false - minReplicas: 1 - maxReplicas: 20 - targetCPUUtilizationPercentage: 80 - targetMemoryUtilizationPercentage: 80 - - podAnnotations: { } - podSecurityContext: { } - securityContext: { } - resources: { } - nodeSelector: { } - tolerations: [ ] - affinity: { } - -database: - image: - repository: postgres - pullPolicy: IfNotPresent - # Overrides the image tag whose default is the chart appVersion. - tag: "15" - timezone: "Asia/Shanghai" - rootPassword: "123456" - persistence: - enabled: true - existingClaim: "" - storageClass: "" - subPath: "" - accessMode: ReadWriteOnce - size: 4Gi - annotations: {} - resourcePolicy: "keep" - - podAnnotations: { } - podSecurityContext: { } - securityContext: { } - resources: { } - nodeSelector: { } - tolerations: [ ] - affinity: { } - -tsdb: - image: - repository: victoriametrics/victoria-metrics - pullPolicy: IfNotPresent - # Overrides the image tag whose default is the chart appVersion. - tag: "v1.95.1" - timezone: "Asia/Shanghai" - persistence: - enabled: true - existingClaim: "" - storageClass: "" - subPath: "" - accessMode: ReadWriteOnce - size: 4Gi - annotations: {} - resourcePolicy: "keep" - - podAnnotations: { } - podSecurityContext: { } - securityContext: { } - resources: { } - nodeSelector: { } - tolerations: [ ] - affinity: { } - -# Expose Network -expose: - # Set how to expose the service. Set the type as "ClusterIP","NodePort","LoadBalancer" or "Ingress" - # and fill the information in the corresponding section - type: Ingress - clusterIP: - ports: - # The service port Harbor listens on when serving HTTP - port: 1157 - nodePort: - ports: - # The service port Harbor listens on when serving HTTP - port: 1157 - # The node port Harbor listens on when serving HTTP - nodePort: 31157 - loadBalancer: - # Set the IP if the LoadBalancer supports assigning IP - ip: "" - ports: - # The service port Harbor listens on when serving HTTP - port: 1157 - sourceRanges: [ ] - ingress: - enabled: true - ingressClassName: "" - host: "hertzbeat.domain" - annotations: {} - tls: - enabled: true - secretName: your-tls-secret