Azure provider
Install the Azure provider
Install the provider into the Kubernetes cluster with a Kubernetes configuration file.
The Crossplane Provider
Custom Resource Definitions tells Kubernetes how to connect to the provider.
Verify the provider installed with kubectl get providers
.
TipIt may take up to five minutes for the provider to list HEALTHY
as True
.
A provider installs their own Kubernetes Custom Resource Definitions (CRDs). These CRDs allow you to create Azure resources directly inside Kubernetes.
You can view the new CRDs with kubectl get crds
. Every CRD maps to a unique Azure service Crossplane can provision and manage.
Create a Kubernetes secret for Azure
The provider requires credentials to create and manage Azure resources. Providers use a Kubernetes Secret to connect the credentials to the provider.
This guide generates an Azure service principal JSON file and saves it as a Kubernetes Secret.
TipOther authentication methods exist and are beyond the scope of this guide. The Provider documentation contains information on alternative authentication methods.
Install the Azure command-line
Generating an authentication file requires the Azure command-line. Follow the documentation from Microsoft to Download and install the Azure command-line.
Log in to the Azure command-line.
Create an Azure service principal
Follow the Azure documentation to find your Subscription ID from the Azure Portal.
Using the Azure command-line and provide your Subscription ID create a service principal and authentication file.
Save your Azure JSON output as azure-credentials.json
.
Create a Kubernetes secret with the Azure credentials
A Kubernetes generic secret has a name and contents. Use kubectl create secret
to generate the secret object named azure-secret
in the crossplane-system
namespace.
Use the --from-file=
argument to set the value to the contents of the azure-credentials.json
file.
View the secret with kubectl describe secret
Create a ProviderConfig
A ProviderConfig
customizes the settings of the Azure Provider.
Apply the ProviderConfig
with the command:
This attaches the Azure credentials, saved as a Kubernetes secret, as a secretRef
.
The spec.credentials.secretRef.name
value is the name of the Kubernetes secret containing the Azure credentials in the spec.credentials.secretRef.namespace
.
Last updated