Reference
Kubernetes foundation / Kubernetes
Provision Kubernetes with an optional bastion and platform services.
Overview
Setup overview
Manifest file
Edit kubernetes-foundation-kubernetes.environment.yaml to change this environment.
Rendered output
OPSd renders the manifest into OpenTofu under rendered/kubernetes-foundation-kubernetes.
Supported changes
This setup defines which add, remove, and scale operations are supported.
Good fit
Kubernetes is already the intended operating model; the team expects cluster-first operations; platform conventions such as GitOps are already part of the rollout plan
Tradeoff
Highest operational overhead of the currently supported variants.
What gets created for this setup
This diagram shows the result you get after rendering the selected setup.
Infrastructure shape
Before you start
Shared setup is covered in Installation and the Introduction. This section lists the minimum things you need before the first render for DigitalOcean.
- Installation install the shared OPSd CLI.
- Introduction understand the workflow boundary and required toolchain.
- Have a container image or build artifact ready.
Initialize this variant
This is the starting configuration for a new environment.
Initialization sequence
opsd list blueprints
opsd init blueprint kubernetes-foundation kubernetes-foundation-kubernetes.environment.yaml --variant kubernetes
opsd validate manifest kubernetes-foundation-kubernetes.environment.yaml
opsd render manifest kubernetes-foundation-kubernetes.environment.yaml --output rendered/kubernetes-foundation-kubernetes
cd rendered/kubernetes-foundation-kubernetes
tofu init
tofu plan
# review the rendered output before planning
cd rendered/kubernetes-foundation-kubernetes
tofu init
tofu plan Edit the manifest
After deployment, update the manifest only with changes supported by this setup. Then validate and render it again.
Supported change commands
Scale the primary compute group
Adjust the replica count on the existing group.
opsd scale compute-group kubernetes-foundation-kubernetes.environment.yaml primary --replicas 2 Add a managed database
Add a supported managed database entry.
opsd add database postgres kubernetes-foundation-kubernetes.environment.yaml --id primary-db Remove a managed database
Clear the database list when the variant supports removal.
opsd remove database kubernetes-foundation-kubernetes.environment.yaml db-main Add a managed cache
Add a supported cache entry when the variant allows it.
opsd add cache valkey kubernetes-foundation-kubernetes.environment.yaml --id primary-cache Remove a managed cache
Clear the cache list when the variant supports removal.
opsd remove cache kubernetes-foundation-kubernetes.environment.yaml cache-main Add a support node
Add a bastion or helper node and remove it again if needed.
opsd add node vm kubernetes-foundation-kubernetes.environment.yaml --id bastion --role bastion --profile s-1vcpu-1gb Remove a support node
Drop a helper node when the variant supports removal.
opsd remove node kubernetes-foundation-kubernetes.environment.yaml bastion Add a load balancer
Add a public entrypoint in the manifest.
opsd add load-balancer kubernetes-foundation-kubernetes.environment.yaml --id lb-public --visibility public --port 80 --target-port 80 Remove a load balancer
Clear the load balancer list when the variant supports removal.
opsd remove load-balancer kubernetes-foundation-kubernetes.environment.yaml web-public Add a CDN endpoint
Add a CDN-backed endpoint for public assets.
opsd add cdn-endpoint kubernetes-foundation-kubernetes.environment.yaml --origin assets-main --id assets-cdn Remove a CDN endpoint
Clear the CDN endpoint list when the variant supports removal.
opsd remove cdn-endpoint kubernetes-foundation-kubernetes.environment.yaml assets-cdn Add object storage
Add a private object storage bucket to the manifest.
opsd add object-storage kubernetes-foundation-kubernetes.environment.yaml --id assets-main Remove object storage
Clear the object storage list when the variant supports removal.
opsd remove object-storage kubernetes-foundation-kubernetes.environment.yaml assets-main Edit, validate, render
# edit kubernetes-foundation-kubernetes.environment.yaml
# validate the config before rendering
opsd validate manifest kubernetes-foundation-kubernetes.environment.yaml
# render the updated output and review it
opsd render manifest kubernetes-foundation-kubernetes.environment.yaml --output rendered/kubernetes-foundation-kubernetes
cd rendered/kubernetes-foundation-kubernetes
# plan and apply only after the diff is clear
tofu plan
tofu apply Supported changes
These examples come from the variant capability map and show the supported add, remove, and scale operations for this setup.
Scale the primary compute group
Adjust the replica count on the existing group.
opsd scale compute-group kubernetes-foundation-kubernetes.environment.yaml primary --replicas 2 Add a managed database
Add a supported managed database entry.
opsd add database postgres kubernetes-foundation-kubernetes.environment.yaml --id primary-db Remove a managed database
Clear the database list when the variant supports removal.
opsd remove database kubernetes-foundation-kubernetes.environment.yaml db-main Add a managed cache
Add a supported cache entry when the variant allows it.
opsd add cache valkey kubernetes-foundation-kubernetes.environment.yaml --id primary-cache Remove a managed cache
Clear the cache list when the variant supports removal.
opsd remove cache kubernetes-foundation-kubernetes.environment.yaml cache-main Add a support node
Add a bastion or helper node and remove it again if needed.
opsd add node vm kubernetes-foundation-kubernetes.environment.yaml --id bastion --role bastion --profile s-1vcpu-1gb Remove a support node
Drop a helper node when the variant supports removal.
opsd remove node kubernetes-foundation-kubernetes.environment.yaml bastion Add a load balancer
Add a public entrypoint in the manifest.
opsd add load-balancer kubernetes-foundation-kubernetes.environment.yaml --id lb-public --visibility public --port 80 --target-port 80 Remove a load balancer
Clear the load balancer list when the variant supports removal.
opsd remove load-balancer kubernetes-foundation-kubernetes.environment.yaml web-public Add a CDN endpoint
Add a CDN-backed endpoint for public assets.
opsd add cdn-endpoint kubernetes-foundation-kubernetes.environment.yaml --origin assets-main --id assets-cdn Remove a CDN endpoint
Clear the CDN endpoint list when the variant supports removal.
opsd remove cdn-endpoint kubernetes-foundation-kubernetes.environment.yaml assets-cdn Add object storage
Add a private object storage bucket to the manifest.
opsd add object-storage kubernetes-foundation-kubernetes.environment.yaml --id assets-main Remove object storage
Clear the object storage list when the variant supports removal.
opsd remove object-storage kubernetes-foundation-kubernetes.environment.yaml assets-main Changes are not active yet
Editing the manifest changes the desired state. To make it real, validate the manifest, render the updated output, and then run `tofu apply` against the rendered directory.
opsd validate manifest kubernetes-foundation-kubernetes.environment.yaml
opsd render manifest kubernetes-foundation-kubernetes.environment.yaml --output rendered/kubernetes-foundation-kubernetes
cd rendered/kubernetes-foundation-kubernetes
tofu plan
tofu apply