crossplane-provider-equinix-metal

module
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 7, 2021 License: Apache-2.0

README

Crossplane Equinix Metal Provider

GitHub release Go Report Card Slack Twitter Follow

Overview

From Crossplane's Provider documentation:

Providers extend Crossplane to enable infrastructure resource provisioning. In order to provision a resource, a Custom Resource Definition(CRD) needs to be registered in your Kubernetes cluster and its controller should be watching the Custom Resources those CRDs define. Provider packages contain many Custom Resource Definitions and their controllers.

This is the Crossplane Provider package for Equinix Metal infrastructure. The provider that is built from this repository can be installed into a Crossplane control plane.

This repository is Maintained meaning that this software is supported by Equinix Metal and its community - available to use in production environments.

Getting Started and Documentation

For getting started guides, installation, deployment, and administration, see the Crossplane Documentation.

Pre-requisites

  • Kubernetes cluster
    • For example Minikube, minimum version v0.28+
  • Helm, minimum version v3.0.0+.

Installing Crossplane

For the most up to date, detailed, instructions, check Crossplane's documentation.

The following instructions are provided for convenience.

kubectl create namespace crossplane-system
helm repo add crossplane-alpha https://charts.crossplane.io/alpha
helm install crossplane --namespace crossplane-system crossplane-alpha/crossplane
Install the Crossplane CLI
curl -sL https://raw.githubusercontent.com/crossplane/crossplane/release-0.14/install.sh | sh

Install the Equinix Metal Provider

kubectl crossplane install provider equinix/crossplane-provider-equinix-metal

The following commands will require your Equinix Metal API key and a project ID. Entering your API key and project ID when prompted:

read -s -p "API Key: " APIKEY; echo
read -p "Project ID: " PROJECT_ID; echo
Create a Provider Secret

Create a Equinix Metal Project and a project level API key.

Create a Kubernetes secret with the API Key and Project ID.

kubectl create -n crossplane-system secret generic packet-creds --from-file=key=<(echo '{"apiKey":"'$APIKEY'", "projectID":"'$PROJECT_ID'"}')
Create a Provider record

Get the project id from the Equinix Metal Portal or using the Equinix Metal CLI (packet project get). With PROJECT_ID in your environemnt, run the command below:

cat << EOS | kubectl apply -f -
apiVersion: metal.equinix.com/v1beta1
kind: ProviderConfig
metadata:
  name: default
spec:
  projectID: $PROJECT_ID
  credentials:
    source: Secret
    secretRef:
      namespace: crossplane-system
      name: packet-creds
      key: key
EOS

Provision an Equinix Metal Device

Save the following as device.yaml:

apiVersion: server.metal.equinix.com/v1alpha2
kind: Device
metadata:
  name: devices
spec:
  forProvider:
    hostname: crossplane
    plan: c1.small.x86
    facility: any
    operatingSystem: centos_7
    billingCycle: hourly
    hardware_reservation_id: next_available
    locked: false
    tags:
    - crossplane
    - development
  writeConnectionSecretToRef:
    name: devices-creds
    namespace: crossplane-system
$ kubectl create -f device.yaml
device.server.metal.equinix.com/devices created
secret/devices-creds created

To view the device in the cluster:

$ kubectl get equinix -o wide
NAME                                            PROJECT-ID                             AGE   SECRET-NAME
provider.metal.equinix.com/packet-provider   0ac84673-b679-40c1-9de9-8a8792675515   38m   packet-creds

NAME                                         READY   SYNCED   STATE    ID                                     HOSTNAME     FACILITY   IPV4            RECLAIM-POLICY   AGE
device.server.metal.equinix.com/devices   True    True     active   1c73767a-e16a-485c-89b4-4b553e1458b3   crossplane   sjc1       139.178.88.35   Delete           19m

SSH Connection credentials (including IP address, username, and password) can be found in the provider managed secret defined by writeConnectionSecretToRef.

Caution - Secret data is Base64 encoded, access to the namespace where this secret is stored offers root access to the provisioned device.

$ kubectl get secret -n crossplane-system devices-creds -o jsonpath='{.data}'; echo
map[endpoint:MTM5LjE3OC44OC41Nw== password:cGFzc3dvcmQ== port:MjI= username:cm9vdA==]

To delete the device:

$ kubectl delete -f device.yaml
device.server.metal.equinix.com/devices deleted
secret/devices-creds deleted

Roadmap and Stability

This Crossplane provider is alpha quality and not intended for production use.

Equinix Metal devices, virtual networks, and ports can be managed through this provider, which provides basic integration. Advanced features like BGP, VPN, Volumes are not currently planned. If you are interested in these features, please let us know by opening issues and reaching out.

Contributing

crossplane-provider-equinix-metal is a community driven project and we welcome contributions. See the Crossplane Contributing guidelines to get started.

Report a Bug

For filing bugs, suggesting improvements, or requesting new features, please open an issue.

Contact

Please use the following Slack channels to reach members of the community:

Directories

Path Synopsis
Package apis contains Kubernetes API groups for Equinix Metal cloud provider.
Package apis contains Kubernetes API groups for Equinix Metal cloud provider.
ports
Package ports contains Equinix Metal ports API versions
Package ports contains Equinix Metal ports API versions
ports/v1alpha1
Package v1alpha1 contains ports Equinix Metal resources.
Package v1alpha1 contains ports Equinix Metal resources.
server
Package server contains Equinix Metal server API versions
Package server contains Equinix Metal server API versions
server/v1alpha2
Package v1alpha2 contains core Equinix Metal resources.
Package v1alpha2 contains core Equinix Metal resources.
v1beta1
Package v1beta1 contains core Equinix Metal resources.
Package v1beta1 contains core Equinix Metal resources.
vlan
Package vlan contains Equinix Metal vlan API versions
Package vlan contains Equinix Metal vlan API versions
vlan/v1alpha1
Package v1alpha1 contains vlan Equinix Metal resources.
Package v1alpha1 contains vlan Equinix Metal resources.
cmd
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL