Packages and CI/CD shared by the sarak.sh Karpenter providers
- Go 99.5%
- Nix 0.5%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .beads | ||
| .forgejo/workflows | ||
| apis | ||
| app | ||
| bootstrap | ||
| catalogue | ||
| cloudapi | ||
| cloudprovider | ||
| config | ||
| controllers | ||
| internal/example | ||
| metrics | ||
| nodeclass | ||
| nodename | ||
| offering | ||
| operator | ||
| overhead | ||
| ownership | ||
| providerid | ||
| reservedaddr | ||
| typename | ||
| .gitattributes | ||
| .gitignore | ||
| .golangci.yaml | ||
| CHANGELOG.md | ||
| flake.lock | ||
| flake.nix | ||
| GLOSSARY.md | ||
| go.mod | ||
| go.sum | ||
| LICENSE | ||
| README.md | ||
| renovate.json | ||
| Taskfile.yaml | ||
kit
Go packages shared by the sarak.sh Karpenter cloud providers: the parts of a provider that do not depend on the cloud it drives.
go get sarak.sh/karpenter/kit
internal/example is a worked example of a provider on kit, against an in-memory cloud: start there when writing a new provider, and replace fakecloud.go with your cloud's API client.
CI/CD
Providers run kit's reusable Forgejo workflows and carry no pipeline of their own: each workflow file in a provider is a call with inputs. Every job runs on the nixos runner with tools from the caller's flake.
| Workflow | Runs |
|---|---|
.forgejo/workflows/go-ci.yaml |
nix flake check, nix build of the build installables, the verify tasks (any check beyond the flake's: stale generated files, chart renders, envtest), changelog validation on pull requests |
.forgejo/workflows/go-security.yaml |
the command input in the dev shell, govulncheck ./... by default |
.forgejo/workflows/go-release.yaml |
the changelog-driven release commit, the checks on it, the per-arch image and its index, the chart, then the release and its tag |
Each input is documented in the workflow's workflow_call block. A provider calls them like this:
# .forgejo/workflows/ci.yaml
on:
pull_request:
jobs:
ci:
uses: karpenter/kit/.forgejo/workflows/go-ci.yaml@main
with:
build: .#default .#image-amd64 .#image-arm64
verify: generate-verify chart-crds-verify
# .forgejo/workflows/release.yaml
on:
workflow_dispatch:
inputs:
prerelease: { type: boolean, default: false }
version: { type: string, default: "" }
concurrency:
group: release
cancel-in-progress: false
jobs:
release:
uses: https://sarak.sh/karpenter/kit/.forgejo/workflows/go-release.yaml@<sha>
runs-on: nixos
enable-openid-connect: true
with:
prerelease: ${{ inputs.prerelease }}
version: ${{ inputs.version }}
build: .#default .#image-amd64 .#image-arm64
verify: generate-verify chart-crds-verify
image: sarak.sh/karpenter/provider-vultr
chart-dir: charts/karpenter-provider-vultr
registry-audience: ${{ vars.REGISTRY_AUDIENCE }}
What the workflows need from the caller's flake:
- a dev shell carrying
jqandcurl, plusgovulncheckfor the default scan,cranefor an image andhelmfor a chart .#image-<arch>for each ofimage-arches, a script that streams the image tarball, asdockerTools.streamLayeredImagebuilds- a
VERSIONfile the flake reads, unless the call setsversion-file: false
Development
The flake's dev shell carries the toolchain; task lists the commands.
nix develop
task test
task lint
task check # tests and lint in the nix sandbox, as CI runs them