Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions pulse-bridge/.helmignore
Original file line number Diff line number Diff line change
@@ -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/
12 changes: 12 additions & 0 deletions pulse-bridge/Chart.yaml
Original file line number Diff line number Diff line change
@@ -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
167 changes: 167 additions & 0 deletions pulse-bridge/README.md
Original file line number Diff line number Diff line change
@@ -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.

15 changes: 15 additions & 0 deletions pulse-bridge/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -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 -}}
7 changes: 7 additions & 0 deletions pulse-bridge/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "pulse-bridge.name" . }}-config
data:
config.yml: |
{{ .Values.config.yaml | indent 4 }}
48 changes: 48 additions & 0 deletions pulse-bridge/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
14 changes: 14 additions & 0 deletions pulse-bridge/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
35 changes: 35 additions & 0 deletions pulse-bridge/values.yaml
Original file line number Diff line number Diff line change
@@ -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: {}