Cloud Provider Zero
Helper tool to get some of the benefits of a cloud provider with kubernetes without the overhead of the cloud provider
Features
- Set
Node.Spec.ProviderID from Label Information
Node.Spec.ProviderID
The mutating webhook server will set the ProviderID of the node, which is useful for several reasons, to include
but not limited to karpenter based on label information that can be set on the node during
registration time.
If you are using a non-EKS deployment but still want to have the benefits of tooling and providers written for EKS and
other cloud distributions this solution can be helpful.
cpz.ekristen.dev/instance-id=i-000000000000
cpz.ekristen.dev/provider=aws
topology.kubernetes.io/zone=us-east-2a
These labels are used to build a providerID is it is currently empty. This would be the case if you aren't running
an actual cloud provider operator in your cluster.
Building
The following will build binaries in snapshot order.
goreleaser --clean --snapshot
- Rename Repository
- Generate Cosign Keys
- Update
.goreleaser.yml, search/replace go-project-template with new project name, adjust GitHub owner
- Update
main.go,
- Update
go.mod, rename go project (using IDE is best so renames happen across all files)
Signing
- Create a password
- Recommend exporting in environment as
COSIGN_PASSWORD using something like direnv
- Generate cosign keys
cosign generate-key-pair
- Create GitHub Action Secrets
COSIGN_KEY -> populate with cosign.key value
COSIGN_PASSWORD -> populate with password from step 1
Releases
In order for Release Drafter and GoReleaser to work properly you have to create a PAT to run Release Drafter
so it's actions against the repository can trigger other workflows. Unfortunately there is no way to trigger
a workflow from a workflow if both are run by the automatically generated GitHub Actions secret.
- Create PAT that has write contents permissions to the repository
- Create GitHub Action Secret
RELEASE_DRAFTER_SECRET -> populated with PAT from step 1
- Done
Documentation
The project is built to have the documentation right alongside the code in the docs/ directory leveraging Mkdocs Material.
In the root of the project exists mkdocs.yml which drives the configuration for the documentation.
This README.md is currently copied to docs/index.md and the documentation is automatically published to the GitHub
pages location for this repository using a GitHub Action workflow. It does not use the gh-pages branch.
Running Locally
make docs-serve
OR (if you have docker)
docker run --rm -it -p 8000:8000 -v ${PWD}:/docs squidfunk/mkdocs-material