You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 11, 2025. It is now read-only.
> 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.
14
+
> 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.
14
15
15
16
This is the Crossplane Provider package for [Equinix Metal](https://metal.equinix.com)
16
17
infrastructure. The provider that is built from this repository can be installed
@@ -30,55 +31,84 @@ For getting started guides, installation, deployment, and administration, see th
30
31
31
32
## Installing Crossplane
32
33
33
-
For the most up to date, detailed, instructions, check [Crossplane's documentation](https://crossplane.io/docs/v0.13/getting-started/install-configure.html).
34
+
For the most up to date, detailed, instructions, check [Crossplane's documentation](https://crossplane.io/docs/v1.2/getting-started/install-configure.html#install-crossplane).
34
35
35
36
The following instructions are provided for convenience.
The following commands will require your [Equinix Metal API key and a project ID](https://metal.equinix.com/developers/docs/). Entering your API key and project ID when prompted:
72
+
After the package has been fetched and installed, you should see that the provider package is ready:
Create a [Equinix Metal Project and a project level API key](https://metal.equinix.com/developers/docs/).
65
83
66
-
Create a Kubernetes secret with the API Key and Project ID.
84
+
The following commands will require your [Equinix Metal API key and a project ID](https://metal.equinix.com/developers/docs/). Enter your API key and project ID when prompted:
85
+
86
+
```console
87
+
read -s -p "API Key: " APIKEY; echo
88
+
read -p "Project ID: " PROJECT_ID; echo
89
+
```
90
+
91
+
_(The `read` command may need to be modified for shells other than bash.)_
92
+
93
+
Create a Kubernetes secret called `metal-creds` with the API Key and Project ID stored as JSON in a key called `credentials`.
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:
100
+
The secret name and key name are configurable. Whatever names you choose must match the settings in the `ProviderConfig` below.
101
+
102
+
### Create a Provider Config record
103
+
104
+
Get the project id from the Equinix Metal Portal or using the Equinix Metal CLI (`packet project get`). With `PROJECT_ID` in your environment, run the command below:
75
105
76
106
```bash
77
107
cat <<EOS | kubectl apply -f -
78
108
apiVersion: metal.equinix.com/v1beta1
79
109
kind: ProviderConfig
80
110
metadata:
81
-
name: default
111
+
name: equinix-metal-provider
82
112
spec:
83
113
projectID: $PROJECT_ID
84
114
credentials:
@@ -90,6 +120,8 @@ spec:
90
120
EOS
91
121
```
92
122
123
+
_TIP: If the `ProviderConfig` is given the special name "**default**", Equinix Metal Crossplane resources will choose this configuration making the `providerConfigRef` field optional._
124
+
93
125
## Provision an Equinix Metal Device
94
126
95
127
Save the following as `device.yaml`:
@@ -98,47 +130,58 @@ Save the following as `device.yaml`:
98
130
apiVersion: server.metal.equinix.com/v1alpha2
99
131
kind: Device
100
132
metadata:
101
-
name: devices
133
+
name: crossplane-example
102
134
spec:
103
135
forProvider:
104
-
hostname: crossplane
105
-
plan: c1.small.x86
106
-
facility: any
107
-
operatingSystem: centos_7
136
+
hostname: crossplane-example
137
+
plan: c3.small.x86
138
+
facility: sv15
139
+
operatingSystem: ubuntu_20_04
108
140
billingCycle: hourly
109
141
hardware_reservation_id: next_available
110
142
locked: false
143
+
networkType: hybrid
111
144
tags:
112
145
- crossplane
113
-
- development
146
+
providerConfigRef:
147
+
name: equinix-metal-provider
114
148
writeConnectionSecretToRef:
115
-
name: devices-creds
149
+
name: crossplane-example
116
150
namespace: crossplane-system
151
+
reclaimPolicy: Delete
117
152
```
118
153
119
-
```bash
154
+
Create the resource:
155
+
156
+
```sh
120
157
$ kubectl create -f device.yaml
121
158
device.server.metal.equinix.com/devices created
122
-
secret/devices-creds created
123
159
```
124
160
125
-
To view the device in the cluster:
161
+
To view the device and other Equinix Metal resources in the cluster:
SSH Connection credentials (including IP address, username, and password) can be found in the provider managed secret defined by `writeConnectionSecretToRef`.
137
180
138
181
**Caution** - Secret data is Base64 encoded, access to the namespace where this secret is stored offers `root` access to the provisioned device.
139
182
140
183
```bash
141
-
$ kubectl get secret -n crossplane-system devices-creds -o jsonpath='{.data}';echo
184
+
$ kubectl get secret -n crossplane-system crossplane-example -o jsonpath='{.data}';echo
@@ -156,6 +198,8 @@ This Crossplane provider is alpha quality and not intended for production use.
156
198
157
199
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](#report-a-bug) and [reaching out](#contact).
158
200
201
+
See <https://github.com/packethost/crossplane-provider-equinix-metal/milestones> for project milestones.
202
+
159
203
## Contributing
160
204
161
205
crossplane-provider-equinix-metal is a community driven project and we welcome contributions. See the Crossplane [Contributing](https://github.com/crossplane/crossplane/blob/master/CONTRIBUTING.md) guidelines to get started.
0 commit comments