Build, Publish, and Install Crossplane Package

About Crossplane Package

The crossplane.yaml file

apiVersion: meta.pkg.crossplane.io/v1
kind: Configuration
metadata:
name: my-test-configuration
annotations:
provider: kubernetes
spec:
crossplane:
version: ">=v1.0.0-0"
dependsOn:
- provider: quay.io/morningspace/provider-kubernetes-amd64
version: ">=v0.0.0-0"
  • When specify the provider as dependency using spec.dependsOn, you should not append the provider version (i.e. the image tag) after the provider name. This may lead to the missing dependency error when Crossplane tries to install the provider.
  • When specify the version constraint, you should strictly follow the semver spec. Otherwise, it may not be able to find the appropriate version even dependency is found. This may lead to the incompatible dependency error.

Build Package

# To build a provider package
kubectl crossplane build provider
# To build a configuration package
kubectl crossplane build configuration
make build
make build.all

Publish Package

# To push a provider package
kubectl crossplane push provider $ORG_NAME/$PROVIDER_NAME:$PROVIDER_VERSION
# To push a configuration package
kubectl crossplane push configuration $ORG_NAME/$CONFIGURATION_NAME:$CONFIGURATION_VERSION
kubectl crossplane push configuration quay.io/morningspace/my-test-configuration:v0.0.1
make publish
PLATFORMS=linux_amd64 make publish

Push to Registry other than Docker Hub

apiVersion: meta.pkg.crossplane.io/v1alpha1
kind: Provider
metadata:
name: provider-kubernetes
annotations:
descriptionShort: |
The Crossplane Kubernetes provider enables management of Kubernetes Objects.
spec:
controller:
image: quay.io/morningspace/provider-kubernetes-controller-amd64:VERSION
# DOCKER_REGISTRY = crossplane
DOCKER_REGISTRY = quay.io/morningspace

Install Package

# To install a provider package
kubectl crossplane install provider $ORG_NAME/$PROVIDER_NAME:$PROVIDER_VERSION
# To install a configuration package
kubectl crossplane install configuration $ORG_NAME/$CONFIGURATION_NAME:$CONFIGURATION_VERSION
kubectl crossplane install configuration quay.io/morningspace/my-test-configuration:v0.0.1

Troubleshooting Tips

kubectl get crossplane
NAME                                                                INSTALLED   HEALTHY   PACKAGE                                                             AGE
provider.pkg.crossplane.io/morningspace-provider-kubernetes-amd64 True True quay.io/morningspace/provider-kubernetes-amd64:v0.0.0-29.ga50151c 6d
NAME HEALTHY REVISION IMAGE STATE DEP-FOUND DEP-INSTALLED AGE
providerrevision.pkg.crossplane.io/morningspace-provider-kubernetes-amd64-f098e786458d True 1 quay.io/morningspace/provider-kubernetes-amd64:v0.0.0-29.ga50151c Active 6d
NAME INSTALLED HEALTHY PACKAGE AGE
configuration.pkg.crossplane.io/morningspace-my-test-configuration True True quay.io/morningspace/my-test-configuration:v0.0.1 5d1h
NAME HEALTHY REVISION IMAGE STATE DEP-FOUND DEP-INSTALLED AGE
configurationrevision.pkg.crossplane.io/morningspace-my-test-configuration-6c6e494f5a22 True 1 quay.io/morningspace/my-test-configuration:v0.0.1 Active 1 1 5d1h
kubectl get lock -o yaml

--

--

--

Life is coding and writing! I am a software engineer who have been in IT field for 10+ years. I would love to write beautiful code and story for people.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

CS373 Fall 2021: Kang (Kevin) Hou

To run Python interpreter/code over the Docker container

Data ETL using Apache Beam — Part One…

KM Conversations: KM Integration Part 3: Software Integration

Gitlab Automation Deployment For Fast API to Heroku with MongoDB Atlas Cloud Database

Why Flutter for Mobile App Development

What is the difference between the “Salesforce” and “Salesforce Platform” licenses?

chrome “Managed by your organization” Issue

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
MorningSpace

MorningSpace

Life is coding and writing! I am a software engineer who have been in IT field for 10+ years. I would love to write beautiful code and story for people.

More from Medium

Using Kyverno policies with ArgoCD

Streamlining your Kubernetes adoption with Helmfile / ArgoCD and GitOps

Photo of a playground

Canary Deployment in Kubernetes (Part 3) — Smart Canary Deployment using Argo Rollouts and…

Demystifying GitOps -Bootstrapping Argo CD