Getting started with UpCloud Crossplane provider
In this getting started guide you will learn how to:
- Install Crossplane related tooling into your Kubernetes cluster
- Install UpCloud Crossplane Provider and required provider configuration
- Create an SDN network and a Cloud Server with Crossplane
Prerequisites
You need kubectl and Helm on your local machine, and access to a Kubernetes cluster of any kind.
- To create an UpCloud Kubernetes cluster, follow the guide available here.
- You can also use kind to create a local development cluster with
kind create cluster -n crossplane-test.
Prepare the kubeconfig for accessing your cluster. Ensure you have the right configuration and the right context in use by running:
kubectl config get-contextsOnce you are ready, install Crossplane into the crossplane-system namespace with its Helm chart. This installs the Crossplane pods and custom resource definitions (CRD) into your cluster.
helm repo add crossplane-stable https://charts.crossplane.io/stable
helm repo update
helm install crossplane --namespace crossplane-system --create-namespace crossplane-stable/crossplaneInstalling the provider
Install the Crossplane UpCloud provider. The simplest way to do that is to just apply the following YAML manifest with kubectl:
apiVersion: pkg.crossplane.io/v1
kind: Provider
metadata:
name: provider-upcloud
spec:
package: xpkg.crossplane.io/crossplane-contrib/provider-upcloud:v1.1.0The provider is ready to use when kubectl get providers shows it as installed and healthy.
kubectl get providersNAME INSTALLED HEALTHY PACKAGE AGE
provider-upcloud True True xpkg.crossplane.io/crossplane-contrib/provider-upcloud:v1.1.0 3m7sNext, create a Secret with your UpCloud API credentials and a ProviderConfig that will use them to provision your infra. Add your credentials to the following manifest and apply it with kubectl:
apiVersion: v1
kind: Secret
metadata:
name: upcloud-creds
namespace: crossplane-system
type: Opaque
stringData:
creds: |
{
"token": "ucat_TOKEN"
}
---
apiVersion: provider.upcloud.com/v1beta1
kind: ProviderConfig
metadata:
name: default
spec:
credentials:
source: Secret
secretRef:
name: upcloud-creds
namespace: crossplane-system
key: credsFor namespace-scoped provider configurations, see the examples in the UpCloud Crossplane provider repository.
Create a network
First, lets create an SDN network.
apiVersion: network.upcloud.com/v1alpha1
kind: Network
metadata:
name: example
spec:
forProvider:
ipNetwork:
address: 10.100.0.0/24
dhcp: true
dhcpDefaultRoute: false
family: IPv4
name: crossplane-example-net
zone: de-fra1Verify the network status:
kubectl get network.network.upcloud.com/exampleNAME SYNCED READY EXTERNAL-NAME AGE
example True True 035b1dba-ca4f-43bc-bdfc-4ae7daf49b0a 2m33sCreate a server
Finally, create a Cloud Server to the network we created in the previous step.
apiVersion: server.upcloud.com/v1alpha1
kind: Server
metadata:
name: example
spec:
forProvider:
hostname: crossplane-example-server
title: crossplane-example-server
labels:
env: dev
production: "false"
login:
user: example
networkInterface:
- type: public
- type: private
networkRef:
name: example
plan: PREMIUM-1xCPU-1GB
metadata: true
template:
size: 25
storage: Ubuntu Server 24.04 LTS (Noble Numbat)
zone: de-fra1See server status and wait until the resource has been created:
kubectl get server.server.upcloud.com/example -wNAME SYNCED READY EXTERNAL-NAME AGE
example 21s
...
example True True 008c89ff-3e59-4c5b-8b05-c40eb360f911 4m20sYou can list server details, such as IP addresses, through kubectl describe server.server.upcloud.com/example.
Next steps
For a complete list of examples, check the examples in the GitHub repository to see what other Managed Resources you can use and how.
Have fun!