Skip to content
Merged
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
57 changes: 57 additions & 0 deletions .github/workflows/validate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Validate

on:
push:
branches: [main]
pull_request:

jobs:
kustomize-build:
name: Validate Kustomize configs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- name: Set up kubectl
uses: azure/setup-kubectl@v4

- name: Build base layer
run: kubectl kustomize base/

- name: Build stack layer
run: kubectl kustomize stack/

- name: Verify quick-start labels in base
run: |
kubectl kustomize base/ | grep -q 'app.kubernetes.io/part-of: streamshub-developer-quickstart'

- name: Verify quick-start labels in stack
run: |
kubectl kustomize stack/ | grep -q 'app.kubernetes.io/part-of: streamshub-developer-quickstart'

shellcheck:
name: Lint shell scripts
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- name: Run ShellCheck
uses: ludeeus/action-shellcheck@2.0.0
with:
version: v0.11.0
scandir: "."
additional_files: "install.sh uninstall.sh update-version.sh"

yamllint:
name: Lint YAML files
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- name: Install yamllint
run: |
sudo apt-get update
sudo apt-get install -y yamllint

- name: Run yamllint
run: yamllint -d relaxed .
203 changes: 201 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,201 @@
# developer-quickstart
A kustomize-based quick start setup for deploying the StreamsHub event stack in a local ephemeral or remote development kubernetes cluster.
# StreamsHub Developer Quick-Start

A Kustomize-based repository for deploying the StreamsHub event-streaming stack on a local or development Kubernetes cluster using only `kubectl`.

> **Note:** This is a **development-only** configuration. Resource limits, security settings and storage configurations are **not** suitable for production use.

## What Gets Deployed

| Component | Namespace | Description |
|-----------|-----------|-------------|
| Strimzi Kafka Operator | `strimzi` | Manages Kafka clusters via CRDs |
| Kafka cluster (`dev-cluster`) | `kafka` | Single-node Kafka for development |
| Apicurio Registry Operator | `apicurio-registry` | Manages schema registry instances |
| Apicurio Registry instance | `apicurio-registry` | In-memory schema registry |
| StreamsHub Console Operator | `streamshub-console` | Manages console instances |
| StreamsHub Console instance | `streamshub-console` | Web UI for Kafka management |

## Prerequisites

- `kubectl` v1.27 or later (for Kustomize v5.0 `labels` transformer support)
- A running Kubernetes cluster (minikube, KIND, etc.)
- An Ingress controller for StreamsHub Console access (e.g. `minikube addons enable ingress`)

## Quick-Start Install

Deploy the entire stack with a single command:

```shell
curl -sL https://raw.githubusercontent.com/streamshub/developer-quickstart/main/install.sh | bash
```

This script installs operators, waits for them to become ready, then deploys the operands.

### Configuration

The install script accepts the following environment variables:

| Variable | Default | Description |
|----------|---------|-------------|
| `REPO` | `streamshub/developer-quickstart` | GitHub repository path |
| `REF` | `main` | Git ref, branch, or tag |
| `TIMEOUT` | `120s` | `kubectl wait` timeout |

Example with a pinned version:

```shell
curl -sL https://raw.githubusercontent.com/streamshub/developer-quickstart/main/install.sh | REF=v1.0.0 bash
```

## Manual Install

If you prefer to control each step, the stack is installed in two phases:

### Phase 1 — Operators and CRDs

```shell
kubectl apply -k 'https://github.com/streamshub/developer-quickstart//base?ref=main'
```

Wait for the operators to become ready:

```shell
kubectl wait --for=condition=Available deployment/strimzi-cluster-operator -n strimzi --timeout=120s
kubectl wait --for=condition=Available deployment/apicurio-registry-operator -n apicurio-registry --timeout=120s
kubectl wait --for=condition=Available deployment/streamshub-console-operator -n streamshub-console --timeout=120s
```

### Phase 2 — Operands

```shell
kubectl apply -k 'https://github.com/streamshub/developer-quickstart//stack?ref=main'
```

## Accessing the Console

### Minikube

When using minikube, (if you didn't enable it when you created the minikube cluster) enable the ingress addon and run `minikube tunnel`:

```bash
minikube addons enable ingress
minikube tunnel
```

Then use port-forwarding to access the console:

```bash
kubectl port-forward -n streamshub-console svc/streamshub-console-console-service 8080:80
```

Open [http://localhost:8080](http://localhost:8080) in your browser.

## Teardown

### Using the Uninstall Script

The uninstall script handles safe teardown with shared-cluster safety checks:

```shell
curl -sL https://raw.githubusercontent.com/streamshub/developer-quickstart/main/uninstall.sh | bash
```

The script:
1. Deletes operand custom resources and waits for finalizers to complete
2. Checks each operator group for non-quick-start CRs on the cluster
3. Fully removes operator groups with no shared CRDs
4. For shared operator groups, removes only the operator deployment (retaining CRDs)
5. Reports any retained groups and remaining resources

### Manual Teardown

**Phase 1 — Delete operands:**

```shell
kubectl delete -k 'https://github.com/streamshub/developer-quickstart//stack?ref=main'
```

Wait for all custom resources to be fully removed before proceeding.

**Phase 2 — Delete operators and CRDs:**

> **Warning:** On shared clusters, deleting CRDs will cascade-delete ALL custom resources of that type cluster-wide. Check for non-quick-start resources first:
> ```shell
> kubectl get kafkas -A --selector='!app.kubernetes.io/part-of=streamshub-developer-quickstart'
> ```

```shell
kubectl delete -k 'https://github.com/streamshub/developer-quickstart//base?ref=main'
```

### Finding Quick-Start Resources

All resources carry the label `app.kubernetes.io/part-of=streamshub-developer-quickstart`:

```shell
kubectl get all -A -l app.kubernetes.io/part-of=streamshub-developer-quickstart
kubectl get crds,clusterroles,clusterrolebindings -l app.kubernetes.io/part-of=streamshub-developer-quickstart
```

## Development

### Updating Component Versions

Use the `update-version.sh` script to update component versions:

```shell
# List available versions
./update-version.sh --list strimzi

# Preview changes
./update-version.sh --dry-run strimzi 0.52.0

# Check if a release exists
./update-version.sh --check apicurio-registry 3.2.0

# Update a component
./update-version.sh strimzi 0.52.0
```

Supported components: `strimzi`, `apicurio-registry`, `streamshub-console`

### Testing scripts locally

When developing changes to the kustomization files, use the `LOCAL_DIR` environment
variable to point the install and uninstall scripts at your local checkout instead
of the remote GitHub repository:

```shell
# Install from local repo
LOCAL_DIR=. ./install.sh

# Uninstall from local repo
LOCAL_DIR=. ./uninstall.sh
```

When `LOCAL_DIR` is set, `REPO` and `REF` are ignored — the scripts resolve
kustomization paths relative to the given directory.

You can also provide an absolute path:

```shell
LOCAL_DIR=/home/user/repos/developer-quickstart ./install.sh
```

## Repository Structure

```
base/ # Phase 1: Operators & CRDs
├── kustomization.yaml # Composes all operator sub-components
├── strimzi-operator/ # Strimzi Kafka Operator
├── apicurio-registry-operator/ # Apicurio Registry Operator
└── streamshub-console-operator/ # StreamsHub Console Operator

stack/ # Phase 2: Operands (Custom Resources)
├── kustomization.yaml # Composes all operand sub-components
├── kafka/ # Single-node Kafka cluster
├── apicurio-registry/ # In-memory registry instance
└── streamshub-console/ # Console instance

overlays/ # Future: variant configurations
```
47 changes: 47 additions & 0 deletions base/apicurio-registry-operator/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: apicurio-registry

resources:
- https://raw.githubusercontent.com/Apicurio/apicurio-registry/3.1.7/operator/install/install.yaml
- namespace.yaml

labels:
- pairs:
app.kubernetes.io/part-of: streamshub-developer-quickstart
includeSelectors: false

patches:
- target:
kind: ClusterRoleBinding
patch: |-
- op: replace
path: /subjects/0/namespace
value: apicurio-registry
# Strip version suffix from operator Deployment name
- target:
kind: Deployment
labelSelector: app.kubernetes.io/name=apicurio-registry-operator
patch: |-
- op: replace
path: /metadata/name
value: apicurio-registry-operator
# Set watched namespaces (replace OLM valueFrom with direct value)
- target:
kind: Deployment
name: apicurio-registry-operator
patch: |-
apiVersion: apps/v1
kind: Deployment
metadata:
name: apicurio-registry-operator
spec:
template:
spec:
containers:
- name: apicurio-registry-operator
env:
- name: APICURIO_OPERATOR_WATCHED_NAMESPACES
value: '*'
valueFrom: null
4 changes: 4 additions & 0 deletions base/apicurio-registry-operator/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: apicurio-registry
7 changes: 7 additions & 0 deletions base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- strimzi-operator
- apicurio-registry-operator
- streamshub-console-operator
40 changes: 40 additions & 0 deletions base/streamshub-console-operator/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: streamshub-console

resources:
- https://github.com/streamshub/console/releases/download/0.11.0/streamshub-console-operator.yaml
- namespace.yaml

labels:
- pairs:
app.kubernetes.io/part-of: streamshub-developer-quickstart
includeSelectors: false

patches:
- target:
kind: ClusterRoleBinding
patch: |-
- op: replace
path: /subjects/0/namespace
value: streamshub-console
- target:
kind: RoleBinding
patch: |-
- op: replace
path: /subjects/0/namespace
value: streamshub-console
# Remove ServiceMonitor — requires Prometheus Operator CRD which is not
# part of the base install. A metrics overlay will be added separately.
- target:
group: monitoring.coreos.com
version: v1
kind: ServiceMonitor
name: streamshub-console-operator
patch: |-
$patch: delete
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: streamshub-console-operator
4 changes: 4 additions & 0 deletions base/streamshub-console-operator/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: streamshub-console
Loading
Loading