Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
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
13 changes: 13 additions & 0 deletions charts/repowise/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.DS_Store
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
*.swp
*.bak
*.tmp
*.orig
*~
18 changes: 18 additions & 0 deletions charts/repowise/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: v2
name: repowise
description: A Helm chart for deploying Repowise — AI-powered codebase documentation and context engine
type: application
version: 0.1.0
appVersion: "0.1.0"
home: https://github.com/repowise-dev/repowise
sources:
- https://github.com/repowise-dev/repowise
maintainers:
- name: repowise-dev
url: https://github.com/repowise-dev
keywords:
- repowise
- code-documentation
- ai
- mcp
- codebase-context
142 changes: 142 additions & 0 deletions charts/repowise/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
# Repowise Helm Chart

Deploy [Repowise](https://github.com/repowise-dev/repowise) on Kubernetes.

## Prerequisites

- Kubernetes 1.24+
- Helm 3.x
- A container image built from `docker/Dockerfile` pushed to your registry

## Quick Start

```bash
# Build and push the image
docker build -t your-registry/repowise:0.1.0 -f docker/Dockerfile .
docker push your-registry/repowise:0.1.0

# Install the chart
helm install repowise ./charts/repowise \
--set image.repository=your-registry/repowise \
--set image.tag=0.1.0 \
--set apiKeys.anthropic=sk-ant-...
```

## Configuration

| Parameter | Description | Default |
|-----------|-------------|---------|
| `replicaCount` | Number of replicas (only 1 supported with SQLite) | `1` |
| `image.repository` | Container image repository | `repowise/repowise` |
| `image.tag` | Image tag (defaults to appVersion) | `""` |
| `repowise.embedder` | Embedder backend (`mock`, `openai`, `gemini`) | `mock` |
| `repowise.dbUrl` | Database connection URL | `sqlite+aiosqlite:////data/wiki.db` |
| `repowise.backendPort` | API server port | `7337` |
| `repowise.frontendPort` | Web UI port | `3000` |
| `apiKeys.anthropic` | Anthropic API key | `""` |
| `apiKeys.openai` | OpenAI API key | `""` |
| `apiKeys.gemini` | Gemini API key | `""` |
| `existingSecret` | Use an existing Secret for API keys | `""` |
| `persistence.enabled` | Enable PVC for `/data` | `true` |
| `persistence.size` | PVC size | `10Gi` |
| `persistence.storageClass` | Storage class (empty = cluster default) | `""` |
| `ingress.enabled` | Enable Ingress | `false` |
| `ingress.className` | Ingress class name | `""` |
| `ingress.hosts` | Ingress host rules | see `values.yaml` |

## Using an Existing Secret

If you manage secrets externally (e.g., Sealed Secrets, External Secrets):

```bash
kubectl create secret generic my-repowise-keys \
--from-literal=ANTHROPIC_API_KEY=sk-ant-... \
--from-literal=OPENAI_API_KEY= \
--from-literal=GEMINI_API_KEY=

helm install repowise ./charts/repowise \
--set existingSecret=my-repowise-keys
```

## Ingress Example

```yaml
ingress:
enabled: true
className: nginx
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
hosts:
- host: repowise.example.com
paths:
- path: /
pathType: Prefix
servicePort: frontend
tls:
- secretName: repowise-tls
hosts:
- repowise.example.com
```

## Auto-Cloning Repositories

You can declare repos in `values.yaml` and the chart will automatically clone them, register with the API, and trigger indexing via a post-install/upgrade Job.

### Public repos

```bash
helm install repowise ./charts/repowise \
--set repos[0].name=my-app \
--set repos[0].url=https://github.com/org/my-app.git \
--set repos[0].branch=main
```

### Private repos (GitHub PAT)

```bash
helm install repowise ./charts/repowise \
--set repos[0].name=my-private-app \
--set repos[0].url=https://github.com/org/my-private-app.git \
--set gitCredentials.github.username=my-user \
--set gitCredentials.github.token=ghp_...
```

### Private repos (existing Secret)

```bash
kubectl create secret generic git-creds \
--from-literal=git-credentials='https://my-user:ghp_token@github.com'

helm install repowise ./charts/repowise \
--set repos[0].name=my-private-app \
--set repos[0].url=https://github.com/org/my-private-app.git \
--set gitCredentials.secretName=git-creds
```

### Multiple repos

```yaml
repos:
- name: frontend
url: https://github.com/org/frontend.git
branch: main
- name: backend
url: https://github.com/org/backend.git
branch: develop
- name: infra
url: https://github.com/org/infra.git
```

The Job clones repos to `/data/repos/<name>`, waits for the API to be healthy, registers each repo, and triggers a sync. Monitor progress with:

```bash
kubectl logs job/repowise-repo-init -n <namespace>
```

## Persistence

Repowise stores its SQLite database and indexed repository data under `/data`. The chart creates a PVC by default. To disable (data lost on pod restart):

```bash
helm install repowise ./charts/repowise --set persistence.enabled=false
```
19 changes: 19 additions & 0 deletions charts/repowise/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Repowise has been deployed!

1. Get the application URLs:
{{- if .Values.ingress.enabled }}
{{- range $host := .Values.ingress.hosts }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}
{{- end }}
{{- else if contains "NodePort" .Values.service.type }}
export NODE_PORT_FRONTEND=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[1].nodePort}" services {{ include "repowise.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo "Web UI: http://$NODE_IP:$NODE_PORT_FRONTEND"
{{- else if contains "ClusterIP" .Values.service.type }}
kubectl --namespace {{ .Release.Namespace }} port-forward svc/{{ include "repowise.fullname" . }} 3000:{{ .Values.service.frontendPort }} 7337:{{ .Values.service.backendPort }}
echo "Web UI: http://localhost:3000"
echo "API: http://localhost:7337"
{{- end }}

2. To use as an MCP server, point your client at the API:
http://{{ include "repowise.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.service.backendPort }}
71 changes: 71 additions & 0 deletions charts/repowise/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "repowise.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
*/}}
{{- define "repowise.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version for the chart label.
*/}}
{{- define "repowise.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels.
*/}}
{{- define "repowise.labels" -}}
helm.sh/chart: {{ include "repowise.chart" . }}
{{ include "repowise.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels.
*/}}
{{- define "repowise.selectorLabels" -}}
app.kubernetes.io/name: {{ include "repowise.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use.
*/}}
{{- define "repowise.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "repowise.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{/*
Name of the Secret holding API keys.
*/}}
{{- define "repowise.secretName" -}}
{{- if .Values.existingSecret }}
{{- .Values.existingSecret }}
{{- else }}
{{- include "repowise.fullname" . }}
{{- end }}
{{- end }}
Loading