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
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ Coder provides secure, on-demand development environments (workspaces) that run
- **PostgreSQL**: Deployed via [CloudNativePG](https://cloudnative-pg.io/) operator (same pattern as `high-command-postgres` in the cluster)
- **Storage**: TrueNAS CSI NFS — see [docs/](docs/README.md)

### [Slashbay](https://github.com/DataKnifeAI/slashbay) — Issue-webhook herald

Slashbay receives GitHub/GitLab issue webhooks, triages with a cheap LLM, and berths a Coder `dkai-agent` workspace.

- **Path**: `slashbay/`
- **Namespace**: `slashbay`
- **Image**: `harbor.dataknife.net/library/slashbay` (GitLab CI → Harbor `library`)
- **Ingress**: `slashbay.dataknife.net` (webhooks)
- **Secrets**: [slashbay/secrets/README.md](slashbay/secrets/README.md)

## Prerequisites

- [CloudNativePG operator](https://cloudnative-pg.io/documentation/current/installation/) installed on the cluster
Expand All @@ -44,6 +54,11 @@ gitops-dev/
│ └── prd-apps/ # prd-apps cluster overlay
│ ├── fleet.yaml
│ └── kustomization.yaml
├── slashbay/
│ ├── base/ # Generic Slashbay manifests
│ ├── overlays/
│ │ └── prd-apps/ # Self-contained Fleet overlay
│ └── secrets/ # Secret examples (not live values)
├── docs/ # Deployment and operations documentation
│ └── truenas-csi/ # TrueNAS CSI driver patches and migration
└── README.md
Expand All @@ -65,6 +80,7 @@ postgres://{user}:{password}@{cluster}-rw.{namespace}:5432/{database}?sslmode=di
```bash
kubectl config use-context prd-apps
kubectl apply -k coder/overlays/prd-apps/
kubectl apply -k slashbay/overlays/prd-apps/
```

### Fleet (GitOps)
Expand Down
32 changes: 32 additions & 0 deletions fleet-gitrepo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Fleet GitRepo — register this repo to deploy Coder + Slashbay to prd-apps
# Apply to the cluster where Fleet runs (e.g. Rancher management cluster):
# kubectl apply -f fleet-gitrepo.yaml
#
# If a GitRepo named gitops-dev-prd-apps already exists, add the slashbay
# path to spec.paths instead of creating a second GitRepo.
#
# Requires: Fleet installed, prd-apps cluster registered with label
# management.cattle.io/cluster-display-name=prd-apps
# Before Slashbay starts: create secrets — see slashbay/secrets/README.md
apiVersion: fleet.cattle.io/v1alpha1
kind: GitRepo
metadata:
name: gitops-dev-prd-apps
namespace: fleet-default
labels:
app: gitops-dev
cluster: prd-apps
managed-by: gitops
spec:
repo: https://github.com/DataKnifeAI/gitops-dev.git
branch: main
paths:
- coder/overlays/prd-apps
- slashbay/overlays/prd-apps
targets:
- clusterSelector:
matchLabels:
management.cattle.io/cluster-display-name: prd-apps
correctDrift:
enabled: true
keepResources: true
36 changes: 36 additions & 0 deletions slashbay/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Slashbay

[Slashbay](https://github.com/DataKnifeAI/slashbay) — DataKnifeAI issue-webhook herald. Issues dock here, cheap-LLM triage decides if they are work, and a Coder workspace is berthed for a coding agent.

Image is built in GitLab CI (GitHub mirror) and pushed to Harbor. This repo only deploys it.

## Target

| Item | Value |
|------|--------|
| Cluster | `prd-apps` |
| Namespace | `slashbay` |
| Image | `harbor.dataknife.net/library/slashbay` |
| Fleet path | `slashbay/overlays/prd-apps` |
| Ingress | `slashbay.dataknife.net` (nginx; GitHub/GitLab webhooks) |
| Coder | `https://coder.dataknife.net` (`CODER_ACCESS_URL`) |

## Prerequisites

1. Harbor image exists (`library/slashbay`) and `harbor-registry-secret` in namespace `slashbay`
2. Application secret `slashbay-secrets` — see [secrets/README.md](secrets/README.md)
3. DNS for `slashbay.dataknife.net` if webhooks must reach the cluster from GitHub/GitLab.com

## Deployment

```bash
kubectl config use-context prd-apps
# secrets first — see secrets/README.md
kubectl apply -k overlays/prd-apps/
```

`overlays/prd-apps` is self-contained (no `../../base`) so Fleet can use that directory as the GitRepo path, same as Coder.

Leave `SLASHBAY_DRY_RUN=true` on the ConfigMap until secrets and Coder are ready. Pin the image tag after the first Harbor release (siblings pin `high-command-*:v0.N`).

App-repo copy of these manifests: [DataKnifeAI/slashbay](https://github.com/DataKnifeAI/slashbay) `deploy/`.
22 changes: 22 additions & 0 deletions slashbay/base/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: slashbay-config
namespace: slashbay
labels:
app: slashbay
app.kubernetes.io/name: slashbay
data:
SLASHBAY_DRY_RUN: "true"
SLASHBAY_STATE_DSN: "sqlite:////data/slashbay.db"
SLASHBAY_REPO_ALLOWLIST: "DataKnifeAI/*"
SLASHBAY_TRIGGER_EVENTS: "opened,reopened"
SLASHBAY_MAX_CONCURRENT: "3"
SLASHBAY_TRIAGE_MODEL: "gpt-5-nano"
SLASHBAY_TRIAGE_ESCALATE_MODEL: "gpt-5.6-luna"
SLASHBAY_TRIAGE_ESCALATE_BELOW: "0.7"
CODER_ACCESS_URL: "https://coder.dataknife.net"
CODER_TEMPLATE: "dkai-agent"
CODER_WORKSPACE_OWNER: "me"
GITHUB_API_URL: "https://api.github.com"
GITLAB_API_URL: "https://gitlab.com/api/v4"
87 changes: 87 additions & 0 deletions slashbay/base/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: slashbay
namespace: slashbay
labels:
app: slashbay
app.kubernetes.io/name: slashbay
spec:
replicas: 1
selector:
matchLabels:
app: slashbay
template:
metadata:
labels:
app: slashbay
app.kubernetes.io/name: slashbay
spec:
serviceAccountName: slashbay
imagePullSecrets:
- name: harbor-registry-secret
securityContext:
runAsNonRoot: true
runAsUser: 1000
runAsGroup: 1000
containers:
- name: slashbay
image: harbor.dataknife.net/library/slashbay:latest
imagePullPolicy: Always
ports:
- name: http
containerPort: 8080
protocol: TCP
envFrom:
- configMapRef:
name: slashbay-config
- secretRef:
name: slashbay-secrets
optional: true
env:
- name: SLASHBAY_HOST
value: "0.0.0.0"
- name: SLASHBAY_PORT
value: "8080"
livenessProbe:
httpGet:
path: /healthz
port: http
initialDelaySeconds: 10
periodSeconds: 30
timeoutSeconds: 5
successThreshold: 1
failureThreshold: 3
readinessProbe:
httpGet:
path: /healthz
port: http
initialDelaySeconds: 5
periodSeconds: 10
timeoutSeconds: 3
successThreshold: 1
failureThreshold: 2
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 500m
memory: 512Mi
securityContext:
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
volumeMounts:
- name: data
mountPath: /data
- name: tmp
mountPath: /tmp
volumes:
- name: data
persistentVolumeClaim:
claimName: slashbay-data
- name: tmp
emptyDir: {}
10 changes: 10 additions & 0 deletions slashbay/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- namespace.yaml
- serviceaccount.yaml
- configmap.yaml
- pvc.yaml
- deployment.yaml
- service.yaml
7 changes: 7 additions & 0 deletions slashbay/base/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v1
kind: Namespace
metadata:
name: slashbay
labels:
app.kubernetes.io/name: slashbay
managed-by: gitops
14 changes: 14 additions & 0 deletions slashbay/base/pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: slashbay-data
namespace: slashbay
labels:
app: slashbay
app.kubernetes.io/name: slashbay
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
17 changes: 17 additions & 0 deletions slashbay/base/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: v1
kind: Service
metadata:
name: slashbay
namespace: slashbay
labels:
app: slashbay
app.kubernetes.io/name: slashbay
spec:
type: ClusterIP
selector:
app: slashbay
ports:
- name: http
port: 80
targetPort: http
protocol: TCP
8 changes: 8 additions & 0 deletions slashbay/base/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: slashbay
namespace: slashbay
labels:
app: slashbay
app.kubernetes.io/name: slashbay
22 changes: 22 additions & 0 deletions slashbay/overlays/prd-apps/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: slashbay-config
namespace: slashbay
labels:
app: slashbay
app.kubernetes.io/name: slashbay
data:
SLASHBAY_DRY_RUN: "true"
SLASHBAY_STATE_DSN: "sqlite:////data/slashbay.db"
SLASHBAY_REPO_ALLOWLIST: "DataKnifeAI/*"
SLASHBAY_TRIGGER_EVENTS: "opened,reopened"
SLASHBAY_MAX_CONCURRENT: "3"
SLASHBAY_TRIAGE_MODEL: "gpt-5-nano"
SLASHBAY_TRIAGE_ESCALATE_MODEL: "gpt-5.6-luna"
SLASHBAY_TRIAGE_ESCALATE_BELOW: "0.7"
CODER_ACCESS_URL: "https://coder.dataknife.net"
CODER_TEMPLATE: "dkai-agent"
CODER_WORKSPACE_OWNER: "me"
GITHUB_API_URL: "https://api.github.com"
GITLAB_API_URL: "https://gitlab.com/api/v4"
88 changes: 88 additions & 0 deletions slashbay/overlays/prd-apps/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: slashbay
namespace: slashbay
labels:
app: slashbay
app.kubernetes.io/name: slashbay
spec:
replicas: 1
selector:
matchLabels:
app: slashbay
template:
metadata:
labels:
app: slashbay
app.kubernetes.io/name: slashbay
spec:
serviceAccountName: slashbay
imagePullSecrets:
- name: harbor-registry-secret
# Omit fsGroup — TrueNAS CSI NFS can fail kubelet applyFSGroup (same as Coder postgres).
securityContext:
runAsNonRoot: true
runAsUser: 1000
runAsGroup: 1000
containers:
- name: slashbay
image: harbor.dataknife.net/library/slashbay:latest

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Agentic Security Review
Severity: MEDIUM
Using a mutable image tag (:latest) in a production deployment allows the runtime artifact to change without a corresponding Git change to this PR-managed manifest.

Impact: If an attacker (or compromised CI/registry credential) can retag/push that repository, the cluster can pull and run unreviewed code on restart/rollout, weakening GitOps integrity and enabling supply-chain compromise.

Fix in Cursor Fix in Web

Reviewed by Cursor Security Reviewer for commit 448b5f5. Configure here.

imagePullPolicy: Always
ports:
- name: http
containerPort: 8080
protocol: TCP
envFrom:
- configMapRef:
name: slashbay-config
- secretRef:
name: slashbay-secrets
optional: true
env:
- name: SLASHBAY_HOST
value: "0.0.0.0"
- name: SLASHBAY_PORT
value: "8080"
livenessProbe:
httpGet:
path: /healthz
port: http
initialDelaySeconds: 10
periodSeconds: 30
timeoutSeconds: 5
successThreshold: 1
failureThreshold: 3
readinessProbe:
httpGet:
path: /healthz
port: http
initialDelaySeconds: 5
periodSeconds: 10
timeoutSeconds: 3
successThreshold: 1
failureThreshold: 2
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 500m
memory: 512Mi
securityContext:
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
volumeMounts:
- name: data
mountPath: /data
- name: tmp
mountPath: /tmp
volumes:
- name: data
persistentVolumeClaim:
claimName: slashbay-data
- name: tmp
emptyDir: {}
Loading