Development Setup¶
This guide walks through setting up a local development environment with Kind, PostgreSQL, and Valkey. By the end you will have a working Superset instance running on your laptop.
Prerequisites¶
| Tool | Version | Install |
|---|---|---|
| Docker daemon | 20+ | Docker Desktop, Colima (brew install colima), or Podman |
| kubectl | Within one minor version of your cluster (skew policy) | kubernetes.io |
| Kind | Version in .github/supported-k8s.json (kind_version) |
brew install kind or go install sigs.k8s.io/kind@latest |
| Go | Version in go.mod |
brew install go or go.dev |
| Helm | 4+ | brew install helm or helm.sh — used by make lint (Helm chart lint) and the chart tests |
macOS notes¶
-
Colima is a lightweight alternative to Docker Desktop. Start it with enough headroom for Kind plus a Superset deployment:
The Docker CLI auto-switches to the
colimacontext. - If you previously ran Docker Desktop and have switched to Colima, the leftovercredsStore: desktopin~/.docker/config.jsonwill fail everydocker pullwith a keychain error in non-interactive shells. Remove thecredsStoreandplugins/features.hookskeys from that file (they only apply to Docker Desktop).
1. Create a Kind cluster¶
2. Deploy PostgreSQL and Valkey¶
kubectl apply -f config/samples/dev-dependencies.yaml
kubectl wait --for=condition=available deployment/postgres deployment/valkey --timeout=120s
This creates a throwaway PostgreSQL (user, password, and database superset) and a Valkey (password superset) with ephemeral storage. The Development-mode samples are configured to match it.
3. Run the operator¶
There are two ways to run the operator:
Option A: Run locally (outside the cluster)¶
make install applies the CRDs to the cluster; make run then compiles and runs the operator process on your machine, connecting to the Kind cluster via your kubeconfig. Leave this terminal open — it streams reconciliation logs.
Option B: Deploy in-cluster¶
make docker-build IMG=superset-operator:dev
kind load docker-image superset-operator:dev --name superset
make deploy IMG=superset-operator:dev
This builds the operator image, loads it into Kind, and deploys it as a Deployment with all RBAC and CRDs. View logs with:
make deploy is a superset of make install — it installs CRDs, RBAC, and the operator Deployment in one step.
4. Deploy Superset¶
The sample manifest deploys a web server in dev mode, runs the migrate and init tasks, and points at the PostgreSQL and Valkey created above.
5. Access Superset¶
Open http://localhost:8088.
6. Clean up¶
Make Commands¶
License¶
| Command | Description |
|---|---|
make check-license |
Check Apache license headers using Apache Rat. |
Documentation¶
| Command | Description |
|---|---|
make docs-lock |
Regenerate hash-pinned Python dependencies for documentation. |
make docs-serve |
Serve documentation locally with live reload. |
make docs-build |
Build the standalone documentation preview. |
make docs-build-ci |
Assemble the root and versioned docs like CI; set DOCS_SERVE=true to serve. |
make docs-build-versioned |
Assemble docs under a minor version path; set DOCS_VERSION=X.Y and DOCS_SERVE=true to serve. |
make docs-api |
Generate API reference documentation from Go types. |
make supported-versions |
Regenerate the supported-Kubernetes-versions table in README.md and docs. |
make make-commands |
Regenerate the make-commands tables in the contributing docs. |
make sync-supported-versions |
Sync .github/supported-k8s.json with the pinned kind release's node images. |
make verify-supported-versions |
Verify supported-k8s.json matches the pinned kind release and docs are up to date. |
make sync-helm-checksum |
Sync the pinned Helm tarball SHA-256 in install-helm.sh with the published checksum for HELM_VERSION. |
make verify-helm-checksum |
Verify install-helm.sh pins the correct Helm tarball SHA-256 for its HELM_VERSION. |
make sync-tool-checksums |
Sync hack/tool-checksums.txt with the pinned binary tool checksums. |
make verify-tool-checksums |
Verify hack/tool-checksums.txt matches the pinned binary tool releases. |
Helm¶
| Command | Description |
|---|---|
make helm-sync-crds |
Sync generated CRDs into the Helm chart. |
make helm-docs |
Generate Helm chart README from values.yaml annotations. |
make helm |
Sync CRDs into Helm chart and package it. The chart appVersion is derived from VERSION at package time. |
make helm-lint |
Lint the Helm chart (syncs CRDs first). |
make helm-test |
Run the Helm chart unit tests (requires the helm-unittest plugin; see scripts/install-helm-unittest.sh). |
make helm-values-covered |
Verify every values.yaml knob is exercised by the comprehensive chart test. |
Development¶
| Command | Description |
|---|---|
make codegen |
Regenerate all generated artifacts (CRDs, DeepCopy, Helm CRDs, chart README, API docs, supported-versions table, make-commands tables). |
make clean |
Remove build artifacts, downloaded tools, and test cache. |
make manifests |
Generate ClusterRole and CustomResourceDefinition objects. |
make generate |
Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations. |
make fmt |
Run go fmt against code. |
make vet |
Run go vet against code. |
make test |
Run all tests (unit + integration + e2e). |
make test-unit |
Run unit tests (no envtest or cluster required). |
make test-integration |
Run integration tests (requires envtest). |
make fuzz |
Run all fuzz targets for a bounded duration (FUZZTIME per target, default 30s). |
make setup-test-e2e |
Set up a Kind cluster for e2e tests if it does not exist |
make test-e2e |
Run the e2e tests. Expected an isolated environment using Kind. |
make cleanup-test-e2e |
Tear down the Kind cluster used for e2e tests |
make lint |
Run all linters (Go, Markdown, Helm chart). |
make lint-fix |
Auto-fix all linters that support it (Go, Markdown). |
make lint-go |
Run the Go linter (golangci-lint). |
make lint-go-fix |
Run the Go linter and apply fixes. |
make lint-go-config |
Verify the golangci-lint configuration. |
make lint-md |
Lint Markdown files (check only). |
make lint-md-fix |
Auto-fix Markdown formatting in place. |
make hooks |
Configure git to use .githooks/ for pre-commit hooks |
Build¶
| Command | Description |
|---|---|
make build |
Build manager binary. |
make run |
Run a controller from your host. Pass flags via ARGS, e.g. make run ARGS="--zap-log-level=2". |
make docker-build |
Build docker image with the manager. |
make docker-push |
Push docker image with the manager. |
make build-installer |
Generate a consolidated YAML with CRDs and deployment. |
Deployment¶
| Command | Description |
|---|---|
make install |
Install CRDs into the K8s cluster specified in ~/.kube/config. |
make uninstall |
Uninstall CRDs from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion. |
make deploy |
Deploy controller to the K8s cluster specified in ~/.kube/config. |
make undeploy |
Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion. |
Pre-Commit Hooks¶
The project includes a lightweight git hook at .githooks/pre-commit that runs before each commit. It runs make lint-go (golangci-lint, which covers gofmt, goimports, go vet, and all configured linters) and reformats any staged Markdown with rumdl. If rumdl changes a file, the commit is aborted so you can review the changes and re-stage them — nothing is silently amended. rumdl is a pinned binary downloaded on demand into bin/.
Markdown formatting is also enforced in CI. To check or fix Markdown by hand:
Formatting rules — including single-line-per-paragraph prose (no hard wrapping) — live in .rumdl.toml.
Setup¶
This sets core.hooksPath to .githooks/ for this repository. To bypass the hook for a specific commit, use git commit --no-verify.
Documentation¶
The docs are built with Zensical. To set up and preview locally:
virtualenv venv
source venv/bin/activate
python -m pip install --require-hashes -r docs-requirements.txt
make docs-serve
This starts a live-reloading server at http://localhost:8000. Edit Markdown files in docs/ and changes appear instantly.
The documentation dependency lock is generated from docs-requirements.in. After changing documentation dependencies, run make docs-lock and commit the updated docs-requirements.txt.
To build the standalone local preview:
To assemble the root and versioned pages using the same link preparation and publishing flow as CI:
make docs-build-ci builds into a temporary directory, then removes it when the command exits. It does not rewrite files in the working tree. To build and serve the assembled site in one command, use make docs-build-ci DOCS_SERVE=true and open http://localhost:8000/superset-kubernetes-operator/. Press Ctrl-C to stop the server and remove the temporary build.
The local CI assembly already includes the main docs slice. To check how the current docs render under a release-style minor path, run make docs-build-versioned DOCS_VERSION=0.3. Add DOCS_SERVE=true to serve it locally. This uses current docs content; it does not fetch historical docs for that release.
Docs CI uses two Zensical configs: zensical-unversioned.toml builds shared project pages at the site root, while zensical-versioned.toml builds version-sensitive docs under /main/ or a release path. Add new pages to the appropriate navigation. Links to shared and versioned pages include /superset-kubernetes-operator/, the repository's GitHub Pages project path.
Diagrams¶
Use Mermaid for flow diagrams. Keep them compact with the following conventions:
- Use
flowchart TD(top-down) for state machines and lifecycle flows - Set font size to 12px via init config:
%%{init: {'theme': 'neutral', 'themeVariables': {'fontSize': '12px'}}}%% - Use short node labels (abbreviate where clear from context)
- Prefer single-letter node IDs (
A,B,C) for readability of the source
API Reference¶
The API reference is generated from Go type definitions using crd-ref-docs. After modifying types in api/v1alpha1/, run make codegen to regenerate all generated artifacts (CRDs, DeepCopy, Helm CRDs, API docs). CI verifies nothing is stale.
The API reference only documents operator-defined types. Built-in Kubernetes types (e.g., Affinity, Container, Volume) are linked out to pkg.go.dev rather than rendered inline. When adding new fields that reference a K8s type, add a corresponding knownTypes entry in hack/api-ref-config.yaml so it renders as a link.
Helm Chart README¶
charts/superset-operator/README.md is generated by helm-docs from # -- annotations in values.yaml. After modifying values.yaml or values.schema.json, run make codegen (or make helm-docs) to regenerate it. CI verifies nothing is stale.
The overall structure of the README is controlled by charts/superset-operator/README.md.gotmpl. Fields that accept Kubernetes types carry a description in values.schema.json that links to pkg.go.dev, making both helm-docs output and ArtifactHub display self-explanatory without inlining the full K8s schemas.