From 53589a4e5afe72253cbeef99543a875ffe0dfafa Mon Sep 17 00:00:00 2001 From: Hadyaziz05 Date: Fri, 15 Aug 2025 14:28:16 +0300 Subject: [PATCH] Created Helm chart for pulse-bridge --- pulse-bridge/.helmignore | 23 ++++ pulse-bridge/Chart.yaml | 12 ++ pulse-bridge/README.md | 167 +++++++++++++++++++++++++ pulse-bridge/templates/_helpers.tpl | 15 +++ pulse-bridge/templates/configmap.yaml | 7 ++ pulse-bridge/templates/deployment.yaml | 48 +++++++ pulse-bridge/templates/service.yaml | 14 +++ pulse-bridge/values.yaml | 35 ++++++ 8 files changed, 321 insertions(+) create mode 100644 pulse-bridge/.helmignore create mode 100644 pulse-bridge/Chart.yaml create mode 100644 pulse-bridge/README.md create mode 100644 pulse-bridge/templates/_helpers.tpl create mode 100644 pulse-bridge/templates/configmap.yaml create mode 100644 pulse-bridge/templates/deployment.yaml create mode 100644 pulse-bridge/templates/service.yaml create mode 100644 pulse-bridge/values.yaml diff --git a/pulse-bridge/.helmignore b/pulse-bridge/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/pulse-bridge/.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/pulse-bridge/Chart.yaml b/pulse-bridge/Chart.yaml new file mode 100644 index 0000000..34ed21d --- /dev/null +++ b/pulse-bridge/Chart.yaml @@ -0,0 +1,12 @@ +apiVersion: v2 +name: pulse-bridge +description: A Helm chart for deploying Pulse Bridge - a comprehensive monitoring solution for HTTP services and databases +type: application +version: 0.1.0 +appVersion: "latest" +home: https://github.com/wavezync/pulse-bridge +sources: + - https://github.com/wavezync/pulse-bridge +maintainers: + - name: wavezync + url: https://github.com/wavezync \ No newline at end of file diff --git a/pulse-bridge/README.md b/pulse-bridge/README.md new file mode 100644 index 0000000..6062a58 --- /dev/null +++ b/pulse-bridge/README.md @@ -0,0 +1,167 @@ +# Pulse Bridge Helm Chart + +A Helm chart for deploying Pulse Bridge - a comprehensive monitoring solution for HTTP services and databases. + +## Overview + +Pulse Bridge is a Go-based monitoring application that provides health checking capabilities for various services including HTTP endpoints, PostgreSQL, MySQL, MariaDB, Redis, and MSSQL databases. This Helm chart simplifies the deployment of Pulse Bridge on Kubernetes clusters. + +## Prerequisites + +- Kubernetes 1.16+ +- Helm 3.0+ + +## Installation + +### Quick Start + +Install Pulse Bridge with your custom configuration: + +```bash +helm install pulse-bridge ./pulse-bridge --set-file config.yaml=./my-config.yml +``` + +### Complete Installation with All Available Flags + +```bash +helm install pulse-bridge ./pulse-bridge \ + --set-file config.yaml=./my-config.yml \ + --set replicaCount=2 \ + --set image.repository=pulse-bridge \ + --set image.tag=latest \ + --set image.pullPolicy=IfNotPresent \ + --set service.type=LoadBalancer \ + --set service.port=8080 \ +``` + +## Configuration + +### Configuration Parameters + +| Parameter | Description | Default | +|-----------|-------------|---------| +| `replicaCount` | Number of Pulse Bridge replicas | `1` | +| `image.repository` | Docker image repository | `pulse-bridge` | +| `image.tag` | Docker image tag | `latest` | +| `image.pullPolicy` | Image pull policy | `IfNotPresent` | +| `service.type` | Kubernetes service type | `LoadBalancer` | +| `service.port` | Service port | `8080` | +| `config.yaml` | Pulse Bridge monitoring configuration | See example below | +| `resources` | Pod resource requests and limits | `{}` | +| `nodeSelector` | Node labels for pod assignment | `{}` | +| `tolerations` | Toleration labels for pod assignment | `[]` | +| `affinity` | Affinity settings for pod assignment | `{}` | + +### Configuration File Structure + +Create a `my-config.yml` file with your monitoring targets: + +```yaml +monitors: + # HTTP service monitoring + - name: "Web API Health Check" + type: "http" + interval: "30s" + timeout: "5s" + http: + url: "https://api.example.com/health" + method: "GET" + headers: + Content-Type: "application/json" + Authorization: "Bearer your-token" + + # Database monitoring + - name: "PostgreSQL Database" + type: "database" + interval: "30s" + timeout: "10s" + database: + driver: "postgres" + connection_string: "postgres://user:password@db-host:5432/dbname?sslmode=disable" + query: "SELECT 1" + + # Redis monitoring + - name: "Redis Cache" + type: "database" + interval: "15s" + timeout: "5s" + database: + driver: "redis" + host: "redis-host" + port: 6379 + password: "redis-password" + database: "0" +``` + +## API Endpoints + +Once deployed, Pulse Bridge exposes the following endpoints: + +- `GET /health` - Application health check +- `GET /monitor/services` - Status of all monitored services +- `GET /monitor/services/{service-name}` - Status of a specific service + +## Upgrading + +```bash +# Upgrade with new configuration +helm upgrade pulse-bridge ./pulse-bridge --set-file config.yaml=./updated-config.yml + +# Upgrade with new image version +helm upgrade pulse-bridge ./pulse-bridge --set image.tag=v1.1.0 +``` + +## Uninstalling + +```bash +helm uninstall pulse-bridge +``` + +## Troubleshooting + +### Check Pod Status + +```bash +kubectl get pods -l app.kubernetes.io/name=pulse-bridge +``` + +### View Pod Logs + +```bash +kubectl logs -l app.kubernetes.io/name=pulse-bridge -f +``` + +### Describe Pod for Events + +```bash +kubectl describe pod -l app.kubernetes.io/name=pulse-bridge +``` + +### Check ConfigMap + +```bash +kubectl get configmap pulse-bridge-config -o yaml +``` + +## Contributing + +This Helm chart is part of the Pulse Bridge open-source project. Contributions are welcome! + +1. Fork the repository +2. Create a feature branch +3. Make your changes +4. Test the chart with different configurations +5. Submit a pull request + +## Support + +For issues and questions: + +1. Check the main project repository: [wavezync/pulse-bridge](https://github.com/wavezync/pulse-bridge) +2. Review the application logs using `kubectl logs` +3. Open an issue on GitHub + +## License + +This chart is licensed under the same license as the main Pulse Bridge project. + diff --git a/pulse-bridge/templates/_helpers.tpl b/pulse-bridge/templates/_helpers.tpl new file mode 100644 index 0000000..3c0860c --- /dev/null +++ b/pulse-bridge/templates/_helpers.tpl @@ -0,0 +1,15 @@ +{{- define "pulse-bridge.name" -}} +{{- .Chart.Name -}} +{{- end -}} + +{{- define "pulse-bridge.labels" -}} +app.kubernetes.io/name: {{ include "pulse-bridge.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +app.kubernetes.io/version: {{ .Chart.AppVersion }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end -}} + +{{- define "pulse-bridge.selectorLabels" -}} +app.kubernetes.io/name: {{ include "pulse-bridge.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end -}} \ No newline at end of file diff --git a/pulse-bridge/templates/configmap.yaml b/pulse-bridge/templates/configmap.yaml new file mode 100644 index 0000000..81e2cfd --- /dev/null +++ b/pulse-bridge/templates/configmap.yaml @@ -0,0 +1,7 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "pulse-bridge.name" . }}-config +data: + config.yml: | +{{ .Values.config.yaml | indent 4 }} \ No newline at end of file diff --git a/pulse-bridge/templates/deployment.yaml b/pulse-bridge/templates/deployment.yaml new file mode 100644 index 0000000..0fed918 --- /dev/null +++ b/pulse-bridge/templates/deployment.yaml @@ -0,0 +1,48 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "pulse-bridge.name" . }} + labels: + {{- include "pulse-bridge.labels" . | nindent 4 }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + {{- include "pulse-bridge.selectorLabels" . | nindent 6 }} + template: + metadata: + labels: + {{- include "pulse-bridge.selectorLabels" . | nindent 8 }} + spec: + containers: + - name: {{ include "pulse-bridge.name" . }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - containerPort: {{ .Values.service.port }} + env: + - name: PULSE_BRIDGE_CONFIG + value: "/config/config.yml" + volumeMounts: + - name: config-volume + mountPath: /config + {{- with .Values.resources }} + resources: + {{- toYaml . | nindent 12 }} + {{- end }} + volumes: + - name: config-volume + configMap: + name: {{ include "pulse-bridge.name" . }}-config + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} \ No newline at end of file diff --git a/pulse-bridge/templates/service.yaml b/pulse-bridge/templates/service.yaml new file mode 100644 index 0000000..7d2a586 --- /dev/null +++ b/pulse-bridge/templates/service.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "pulse-bridge.name" . }} + labels: + {{- include "pulse-bridge.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + selector: + {{- include "pulse-bridge.selectorLabels" . | nindent 4 }} + ports: + - protocol: TCP + port: {{ .Values.service.port }} + targetPort: {{ .Values.service.port }} \ No newline at end of file diff --git a/pulse-bridge/values.yaml b/pulse-bridge/values.yaml new file mode 100644 index 0000000..6685870 --- /dev/null +++ b/pulse-bridge/values.yaml @@ -0,0 +1,35 @@ +replicaCount: 1 + +image: + repository: pulse-bridge + tag: latest + pullPolicy: IfNotPresent + +service: + type: LoadBalancer + port: 8080 + +# The default config that will be inserted into the ConfigMap. +# Users can override this entire block in their own values.yaml or with --set-file. +config: + yaml: | + monitors: + HTTP service monitoring + - name: "HTTP Service" + type: "http" + interval: "30s" + timeout: "5s" + http: + url: "http://helloworld-http:8080/ping" + method: "GET" + headers: + Authorization: "Bearer secret-token" + Content-Type: "application/json" + +resources: {} + +nodeSelector: {} + +tolerations: [] + +affinity: {} \ No newline at end of file