// Why this matters
Kubernetes-native tooling is what platform teams build when they want developers to self-serve without learning every cloud console. Crossplane, Concourse and a storage layer such as Portworx are common pieces, and each is easy to demo and hard to run well. This post collects the working shape of four builds so you can rebuild them rather than rediscover the sharp edges.
The common thread is declarative control. Whether the thing being reconciled is an S3 bucket, a pipeline or a volume replica set, the system is easier to hand over when its desired state is in git. The self-service ideas here scale up into Kubernetes-Native Self-Service Infrastructure with Crossplane and the CI side connects to GKE Platform with Concourse CI, Vault and Pub/Sub.
// The problem
Terraform is excellent at creating infrastructure and poor at being a service. A developer who needs a bucket either learns HCL and gets state-locking errors, or files a ticket. Crossplane moves provisioning behind the Kubernetes API, which already has RBAC, an audit trail and a reconciliation loop, but it introduces a new abstraction layer you have to design.
Concourse has the opposite problem: the pieces are simple, but a production install has several parts that must agree. The web nodes, the worker pool, the database, the secrets backend and the ingress each have settings that interact. Getting TLS, a stable external URL and worker registration right takes some care.
Storage and local clusters are where surprises surface late. A stateful workload that works on a single-node lab can fail on a real cluster because of volume topology, and nobody wants to rehearse a kubeadm upgrade on the only cluster.
// The solution
For Crossplane the design has three layers. Providers are installed as packages; a ProviderConfig tells them how to authenticate. Compositions map an abstract resource, say a Bucket with a region and a visibility flag, onto managed resources with the dull but critical settings fixed: encryption on, public access blocked, tags applied. A CompositeResourceDefinition publishes the schema and namespaced claims are what teams actually create.
Authentication deserves the most thought. A static access key in a Kubernetes secret defeats the point of a hardened platform. On EKS the provider pod uses IRSA; on GKE it uses workload identity. The provider config then references the environment rather than a secret, and the credentials rotate for free.
Concourse on GKE is built in two stages. Terraform creates the cluster, a node pool for workers and the supporting database. A helm_release resource then installs the chart with a values file, so cluster and application upgrade through the same plan. Terraform workspaces give each environment its own state and variable set. Pipelines themselves are not Terraform's job; they are YAML in git applied with fly.
The Vagrant lab uses kubeadm on a few VMs to mirror production topology: one control plane node and two workers. It is not production, but it lets you test CNI choices, kubelet flags and storage drivers cheaply. Portworx is installed through its operator and a StorageCluster object, and consumed with a StorageClass whose replication factor decides how many copies of each volume exist.
- Terraformcluster and network for the platform
- Crossplaneinstall core, then the cloud provider package
- ProviderConfigauthenticate with workload identity, no static keys
- Composition gate gateplatform team reviews the abstraction before teams use it
- Claima team requests a bucket or database with a few fields
- ConcourseHelm release on GKE, web and worker pools
- Pipelinesfly set-pipeline from git
- LabVagrant kubeadm cluster to rehearse changes
// Before you start
- A running Kubernetes cluster (EKS for Crossplane) with kubectl and Helm 3
- Terraform 1.5 or newer and a GCP project with permission to create GKE clusters
- Vagrant with VirtualBox or another provider, and at least 12 GB of free RAM for the lab
- Cloud IAM permission to create an IRSA role and trust the cluster OIDC provider
- A Portworx licence or the free tier, and block devices on each storage node
// Step-by-step implementation
01 Install Crossplane and the AWS provider
Crossplane core runs in its own namespace. Providers are packages pulled as OCI images; installing one creates the CRDs for its managed resources. Pin both versions: provider upgrades can change resource schemas.
The upbound S3 family provider installs only the S3 resources, which keeps the CRD count and memory use small compared with the monolithic provider.
02 Authenticate the provider with IRSA, not a key file
Create an IAM role trusted by the provider's service account through the cluster OIDC provider, then tell the provider to use the web identity credentials already injected into its pod. A DeploymentRuntimeConfig annotates the provider service account with the role ARN.
Scope the role to the services the provider manages. For the S3 family that means S3 only, with a permissions boundary if your organisation uses them.
03 Publish an abstraction: XRD and Composition
The XRD defines the API developers see: a bucket with a region and an optional versioning flag. The Composition maps it onto managed resources and hard-codes the policy: encryption and public access blocking are not parameters, so they cannot be forgotten.
Use the function pipeline mode with patch-and-transform; the older resource mode is deprecated.
04 Consume it with a claim
This is all a developer writes. It lives in the application repository next to the Deployment, and a GitOps controller applies it. The claim is namespaced, so existing Kubernetes RBAC decides who can create buckets where.
Watch the claim until Ready; failures surface in
kubectl describeon the composite and its managed resources.05 Build the Concourse cluster with Terraform
Create a regional or zonal GKE cluster with a separate worker node pool, and keep default node pool removal on so you control machine types. Use workspaces so dev and prod share code but not state. Workload identity is enabled on the cluster so pods can reach cloud APIs without key files.
Variables for each environment live in a workspace-keyed map; adding an environment is an entry plus
terraform workspace new.06 Install Concourse with Helm from the same plan
A
helm_releaseresource installs the chart so cluster and application upgrade together. Web handles the UI and API; workers do the container work and need persistent disks. The external URL must be the address users and workers actually reach, or login redirects and worker registration break.Secrets for the admin user and database are injected from a Kubernetes secret created by Terraform from variables kept out of git.
07 Rehearse in a Vagrant kubeadm lab
A three-VM lab catches the problems that a single-node minikube hides: CNI configuration, kubelet cgroup drivers and node-to-node networking. The Vagrantfile defines one control plane and two workers on a private network with fixed addresses; a shared provisioning script installs containerd and kubeadm.
Use it to practise an upgrade or a storage driver change, then destroy it. The point is cheap, disposable fidelity.
08 Add Portworx storage and a replicated StorageClass
Portworx runs as a daemonset managed by its operator and turns node-local disks into a pool. You declare a StorageCluster, then expose it with a StorageClass. The replication factor
replis the important number: 3 survives losing two nodes but triples raw capacity use.Check the pool before creating volumes; an empty or degraded pool is the usual reason claims hang.
// How to verify it works
- Run
kubectl get providersand confirm INSTALLED and HEALTHY are both True for the AWS provider. - Apply a Bucket claim and confirm
kubectl get bucket -n team-ashows READY True, then confirm the bucket exists with encryption and public access block enabled. - Run
terraform plantwice for Concourse; the second plan should show no changes. - Run
fly -t ci workersand confirm every worker reports running. - In the lab run
kubectl get nodesand confirm three Ready nodes; runpxctl statusand confirm Portworx is operational.
// Design decisions and trade-offs
- Install Crossplane providers as packages and authenticate through IRSA or workload identity instead of static keys
- Offer developers a Composition and a claim so they never write raw cloud resources
- Deploy Concourse with its Helm chart and keep pipelines, secrets backend and workers as separate concerns
- Use Terraform for the cluster and the Helm release, with workspaces per environment
- Reproduce production topology in a Vagrant lab before touching the real cluster
// Pitfalls and lessons learned
- Providers that are healthy but unauthenticated create resources that fail with access denied; check the ProviderConfig source first.
- Deleting a claim deletes the cloud resource by default; set a deletion policy of Orphan for data you cannot lose.
- Concourse external URL mismatches cause endless login redirects and workers that never register.
- Running web and worker pools on the same small nodes lets a heavy build starve the UI.
- Vagrant host-only networks conflict with the pod CIDR if you reuse the same range.
- A Portworx replication factor higher than the number of storage nodes prevents volumes from provisioning.
- Crossplane CRD counts grow quickly; install only the provider families you need.
// Frequently asked questions
What is Crossplane and how is it different from Terraform?
Crossplane runs inside Kubernetes and continuously reconciles cloud resources from custom resources, while Terraform applies a plan on demand. Crossplane suits self-service through claims; Terraform suits foundational infrastructure.
How do I authenticate the Crossplane AWS provider without access keys?
Use IRSA on EKS: annotate the provider service account with an IAM role trusted by the cluster OIDC provider and set the ProviderConfig credentials source to IRSA.
How do I deploy Concourse CI on GKE with Terraform?
Create the cluster and worker pool with google_container_cluster and google_container_node_pool, then install the official Concourse chart with a helm_release resource and an external URL that matches your ingress.
Is a Vagrant cluster useful if I run managed Kubernetes?
Yes for rehearsing node-level changes and storage drivers safely. It does not replace staging, but it catches mistakes before they cost a real node.
What replication factor should I use with Portworx?
Three for production data that must survive two node failures; two for balance; one only for scratch data.
// The outcome
Four separate builds share one idea: describe the platform declaratively and let a controller or a plan reconcile it. Each can be rebuilt from a repository, which is what made handover to the client teams possible.
// Where to take it next
- Wrap claims in GitOps so teams request resources by pull request, as in Kubernetes-Native Self-Service Infrastructure with Crossplane.
- Connect Concourse to Vault for secrets, as in GKE Platform with Concourse CI, Vault and Pub/Sub.
- Add Compositions for databases and queues with sensible defaults.
- Move the lab provisioning script into an image so rebuilds take minutes.