Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
4 changes: 3 additions & 1 deletion .github/actions/smoke-test/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ inputs:
overlay:
description: 'Overlay name for component verification (matches .github/config/overlays/<name>.env)'
required: false
default: 'base'
default: 'core'

runs:
using: 'composite'
Expand All @@ -18,6 +18,7 @@ runs:
shell: bash
env:
LOCAL_DIR: .
OVERLAY: ${{ inputs.overlay }}
TIMEOUT: ${{ inputs.timeout }}
run: ./install.sh

Expand All @@ -31,6 +32,7 @@ runs:
shell: bash
env:
LOCAL_DIR: .
OVERLAY: ${{ inputs.overlay }}
TIMEOUT: ${{ inputs.timeout }}
run: ./uninstall.sh

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Components expected in the base (default) deployment.
# Used by verify-install.sh, verify-uninstall.sh, and debug.sh.
# Components expected in the core (default) deployment.
# Used by verify-install.sh and debug.sh.
#
# Format:
# OPERATORS - "namespace:deployment" pairs (space-separated)
Expand Down
11 changes: 11 additions & 0 deletions .github/config/overlays/metrics.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Components expected in the metrics overlay deployment.
# Used by verify-install.sh and debug.sh.
#
# Format:
# OPERATORS - "namespace:deployment" pairs (space-separated)
# CUSTOM_RESOURCES - "namespace:resource" pairs (space-separated)
# NAMESPACES - namespaces to inspect on failure (space-separated)

OPERATORS="strimzi:strimzi-cluster-operator apicurio-registry:apicurio-registry-operator streamshub-console:streamshub-console-operator monitoring:prometheus-operator"
CUSTOM_RESOURCES="kafka:kafka/dev-cluster apicurio-registry:apicurioregistry3/apicurio-registry streamshub-console:console.console.streamshub.github.com/streamshub-console monitoring:prometheus.monitoring.coreos.com/prometheus"
NAMESPACES="strimzi kafka apicurio-registry streamshub-console monitoring"
4 changes: 2 additions & 2 deletions .github/scripts/debug.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
# Reads component definitions from an overlay config file.
#
# Environment variables:
# OVERLAY - overlay name (default: "base")
# OVERLAY - overlay name (default: "core")
#

set +e

OVERLAY="${OVERLAY:-base}"
OVERLAY="${OVERLAY:-core}"
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
CONFIG_FILE="${SCRIPT_DIR}/../config/overlays/${OVERLAY}.env"

Expand Down
4 changes: 2 additions & 2 deletions .github/scripts/verify-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
# Reads component definitions from an overlay config file.
#
# Environment variables:
# OVERLAY - overlay name (default: "base")
# OVERLAY - overlay name (default: "core")
# TIMEOUT - kubectl wait timeout (default: "600s")
#

set -euo pipefail

OVERLAY="${OVERLAY:-base}"
OVERLAY="${OVERLAY:-core}"
TIMEOUT="${TIMEOUT:-600s}"
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
CONFIG_FILE="${SCRIPT_DIR}/../config/overlays/${OVERLAY}.env"
Expand Down
16 changes: 14 additions & 2 deletions .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ on:

jobs:
smoke-minikube:
name: smoke-minikube
name: smoke-minikube (${{ matrix.overlay }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
overlay: [core, metrics]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

Expand All @@ -24,10 +28,16 @@ jobs:

- name: Smoke test
uses: ./.github/actions/smoke-test
with:
overlay: ${{ matrix.overlay }}

smoke-kind:
name: smoke-kind
name: smoke-kind (${{ matrix.overlay }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
overlay: [core, metrics]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

Expand All @@ -46,3 +56,5 @@ jobs:
- name: Smoke test
uses: ./.github/actions/smoke-test
with:
overlay: ${{ matrix.overlay }}
30 changes: 22 additions & 8 deletions .github/workflows/validate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,33 @@ jobs:
- name: Set up kubectl
uses: azure/setup-kubectl@776406bce94f63e41d621b960d78ee25c8b76ede # v4.0.1

- name: Build base layer
run: kubectl kustomize base/
- name: Build core overlay base
run: kubectl kustomize overlays/core/base/

- name: Build stack layer
run: kubectl kustomize stack/
- name: Build core overlay stack
run: kubectl kustomize overlays/core/stack/

- name: Verify quick-start labels in base
- name: Build metrics overlay base
run: kubectl kustomize overlays/metrics/base/

- name: Build metrics overlay stack
run: kubectl kustomize overlays/metrics/stack/

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

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

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

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

shellcheck:
name: Lint shell scripts
Expand Down
78 changes: 60 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ A Kustomize-based repository for deploying the StreamsHub event-streaming stack
| StreamsHub Console Operator | `streamshub-console` | Manages console instances |
| StreamsHub Console instance | `streamshub-console` | Web UI for Kafka management |

> **Optional:** The [metrics overlay](#install-with-metrics) adds Prometheus Operator, a Prometheus instance, and Kafka metrics collection via PodMonitors.

## Prerequisites

- `kubectl` v1.27 or later (for Kustomize v5.0 `labels` transformer support)
Expand All @@ -39,6 +41,7 @@ The install script accepts the following environment variables:
|----------|---------|-------------|
| `REPO` | `streamshub/developer-quickstart` | GitHub repository path |
| `REF` | `main` | Git ref, branch, or tag |
| `OVERLAY` | *(empty)* | Overlay to apply (e.g. `metrics`) |
| `TIMEOUT` | `120s` | `kubectl wait` timeout |

Example with a pinned version:
Expand All @@ -47,14 +50,24 @@ Example with a pinned version:
curl -sL https://raw.githubusercontent.com/streamshub/developer-quickstart/main/install.sh | REF=v1.0.0 bash
```

### Install with Metrics

Deploy the stack with Prometheus metrics collection:

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

This adds the Prometheus Operator and a Prometheus instance (namespace: `monitoring`), enables Kafka metrics via [Strimzi Metrics Reporter](https://strimzi.io/docs/operators/latest/deploying#proc-metrics-kafka-str), and wires Console to display metrics.

## 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'
kubectl apply -k 'https://github.com/streamshub/developer-quickstart//overlays/core/base?ref=main'
```

Wait for the operators to become ready:
Expand All @@ -68,7 +81,23 @@ kubectl wait --for=condition=Available deployment/streamshub-console-operator -n
### Phase 2 — Operands

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

### Manual Install with Metrics

To include the metrics overlay, use the `overlays/metrics` paths instead of `overlays/core`.

```shell
# Phase 1
kubectl create -k 'https://github.com/streamshub/developer-quickstart//overlays/metrics/base?ref=main'
kubectl wait --for=condition=Available deployment/prometheus-operator -n monitoring --timeout=120s
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
kubectl apply -k 'https://github.com/streamshub/developer-quickstart//overlays/metrics/stack?ref=main'
```

## Accessing the Console
Expand Down Expand Up @@ -142,6 +171,9 @@ 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

# If installed with the metrics overlay:
curl -sL https://raw.githubusercontent.com/streamshub/developer-quickstart/main/uninstall.sh | OVERLAY=metrics bash
```

The script:
Expand All @@ -156,7 +188,7 @@ The script:
**Phase 1 — Delete operands:**

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

Wait for all custom resources to be fully removed before proceeding.
Expand All @@ -169,9 +201,11 @@ Wait for all custom resources to be fully removed before proceeding.
> ```

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

For the metrics overlay, use `overlays/metrics/base` and `overlays/metrics/stack` instead.

### Finding Quick-Start Resources

All resources carry the label `app.kubernetes.io/part-of=streamshub-developer-quickstart`:
Expand Down Expand Up @@ -201,7 +235,7 @@ Use the `update-version.sh` script to update component versions:
./update-version.sh strimzi 0.52.0
```

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

### Testing scripts locally

Expand Down Expand Up @@ -229,17 +263,25 @@ 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
components/ # Reusable Kustomize components
├── core/ # Core stack component
│ ├── base/ # Operators & CRDs
│ │ ├── strimzi-operator/ # Strimzi Kafka Operator
│ │ ├── apicurio-registry-operator/ # Apicurio Registry Operator
│ │ └── streamshub-console-operator/ # StreamsHub Console Operator
│ └── stack/ # Operands (Custom Resources)
│ ├── kafka/ # Single-node Kafka cluster
│ ├── apicurio-registry/ # In-memory registry instance
│ └── streamshub-console/ # Console instance
└── metrics/ # Prometheus metrics component
├── base/ # Prometheus Operator
└── stack/ # Prometheus instance, PodMonitors, patches

overlays/ # Deployable configurations
├── core/ # Default install (core only)
│ ├── base/ # Phase 1: Operators & CRDs
│ └── stack/ # Phase 2: Operands
└── metrics/ # Core + Prometheus metrics
├── base/ # Phase 1: Operators & CRDs + Prometheus Operator
└── stack/ # Phase 2: Operands + Prometheus instance & monitors
```
7 changes: 0 additions & 7 deletions base/kustomization.yaml

This file was deleted.

24 changes: 24 additions & 0 deletions components/core/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component

resources:
- strimzi-operator
- apicurio-registry-operator
- streamshub-console-operator

patches:
# The streamshub-console-operator install YAML includes a ServiceMonitor
# that requires the Prometheus Operator CRD (monitoring.coreos.com).
# Since the base install does not include Prometheus, we remove it here.
# The metrics component re-adds monitoring via its own ServiceMonitor.
- 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
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,3 @@ patches:
- 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
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component

resources:
- kafka
Expand Down
5 changes: 5 additions & 0 deletions components/metrics/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component

resources:
- prometheus-operator
22 changes: 22 additions & 0 deletions components/metrics/base/prometheus-operator/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: monitoring

resources:
- https://github.com/prometheus-operator/prometheus-operator/releases/download/v0.89.0/bundle.yaml
- namespace.yaml

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

patches:
- target:
kind: ClusterRoleBinding
name: prometheus-operator
patch: |-
- op: replace
path: /subjects/0/namespace
value: monitoring
4 changes: 4 additions & 0 deletions components/metrics/base/prometheus-operator/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: monitoring
Loading
Loading