DEV Community

Cover image for Crossplane: GKE Installation
Carlos Nogueira
Carlos Nogueira

Posted on • Updated on

Crossplane: GKE Installation

..Crossplane is an open source Kubernetes add-on that supercharges your Kubernetes clusters enabling you to provision and manage infrastructure, services, and applications from kubectl. (crossplane.io)

Crossplane is a CNCF sandbox project, open source, community driven solution and add-on for your kubernetes API to manage and compose infrastructure.

It uses a team centric approach with Open Application Model.

The idea is to use a kubernetes cluster as a single control panel. where there is freedom to provision resources in any cloud and link these services with the cluster itself. The cluster does not need to be in the same cloud as the services.

Alt Text

Crossplane Application Architecture Example

Basically a provider is configured in the cluster linked to a service account of a specific cloud.

Crossplane CRDs use this provider to deploy and link services across the cluster.

Each cloud service has its particularity and is defined through structures of compositions, definitions and namespaced k8s specifications.

The CRDs that define the crossplane providers services are called XRDs.

Crossplane has an external CLI and its own CRDs that are deployed in the cluster.

Since CRDs and XRDs are deployed, the provisioning operation no longer requires the local CLI. Just having kubectl configured needed to re-deploy the types of resources that are already configured.

Installation

Follows ansible to automate the installation of a crossplane + GCP Provider in a GKE cluster

Requirements

  • GKE
  • Google Cloud SDK (316.+)
  • bq (2.0.62+)
  • core (2020.10.23.+)
  • gsutil (4.54.+)
  • Kubernetes(1.16.+)
  • kubectl(1.16.+)
  • Helm(3.+)
  • ansible (2.10.+)
  • openshift python client (0.11.+)
  • PyYAML (5.3.+)

Deploy

1 - Git clone the repo to bastion

  - $ git clone https://gitlab.com/cedon/crossplane-gcp.git
Enter fullscreen mode Exit fullscreen mode

2 - Check if roles/crossplane/defaults/main.yml is right for the environment you want to deploy

Alt Text

3 - Deploy with ansible command:

  - $ ansible-playbook -i ./hosts -e \ 
'ansible_python_interpreter=/usr/bin/python3' crossplane.yml 
\ --tags "install, gcp" -vvv
Enter fullscreen mode Exit fullscreen mode

After the Deploy you must take care about the file creds.json. It will be located at the repo root, and has the service account credentials.

4 - Check Crossplane Installation

  - $ kubectl get all -n crossplane-system
  - $ kubectl crossplane --help
Enter fullscreen mode Exit fullscreen mode

References

Top comments (2)

Collapse
 
jason_powell_faa3e31e5a22 profile image
Jason Powell

Have you heard of Upbound? They created Crossplane and are commercializing a Universal API to bring this concept to the masses.

Collapse
 
hugoprudente profile image
Hugo Prudente

Awesome!