Skip to content

Commit 265a38b

Browse files
authored
(structure review): Crossplane Provider quickstart (#11)
1 parent f5ae20c commit 265a38b

1 file changed

Lines changed: 59 additions & 52 deletions

File tree

README.md

Lines changed: 59 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -5,51 +5,47 @@ is built using [Upjet](https://github.com/upbound/upjet) code
55
generation tools and exposes XRM-conformant managed resources for
66
[Scaleway](https://www.scaleway.com/).
77

8-
To install and use this provider:
8+
Complete the following steps to:
99
* Install Upbound Universal Crossplane (UXP) into your Kubernetes cluster.
1010
* Install the `Provider` and apply a `ProviderConfig`.
1111
* Create a *managed resource* in Scaleway with Kubernetes.
1212

1313
## Prerequisites
14-
This quickstart requires:
15-
* a Kubernetes cluster with permissions to create pods and secrets
16-
* a host with `kubectl` installed and configured to access the Kubernetes
14+
To perform the following steps, make sure you have:
15+
* Your Scaleway [credentials](https://console.scaleway.com/project/credentials)
16+
* A Kubernetes cluster with permissions to create pods and secrets
17+
* A host with `kubectl` installed and configured to access the Kubernetes
1718
cluster
18-
* your Scaleway [credentials](https://console.scaleway.com/project/credentials)
1919

2020
## Getting started
2121

22-
Run each command individually or copy to a local to prevent issues
23-
running the commands in the terminal.
22+
You can run each command individually or copy them to a local to avoid issues related to running commands in a terminal.
2423

25-
_Note:_ all commands use the current `kubeconfig` context and configuration.
24+
_Note:_ All commands use the current `kubeconfig` context and configuration.
2625

2726
### Install the Up command-line
28-
Download and install the Upbound `up` command-line.
27+
28+
Run the following command to download and install the Upbound `up` command-line.
29+
_Note:_ To learn more about the Up command-line, refer to the [official dedicated documentation](https://docs.upbound.io/cli/).
2930

3031
```shell
3132
curl -sL "https://cli.upbound.io" | sh
3233
sudo mv up /usr/local/bin/
3334
```
3435

35-
More information about the Up command-line is available in the [Upbound Up
36-
documentation](https://docs.upbound.io/cli/).
37-
3836
### Install Upbound Universal Crossplane
39-
Install Upbound Universal Crossplane (UXP) with the Up command-line `up uxp
40-
install` command.
37+
38+
Run the Up command-line `up uxp install` to install Upbound Universal Crossplane (UXP).
39+
_Note:_ To learn more about Upbound Universal Crossplane (UXP), refer to the [official dedicated documentation](https://docs.upbound.io/uxp/).
4140

4241
```shell
4342
$ up uxp install
4443
UXP 1.9.0-up.3 installed
4544
```
4645

47-
Find more information in the [Upbound UXP
48-
documentation](https://docs.upbound.io/uxp/).
49-
5046
### Install the provider
5147

52-
Install the provider into the Kubernetes cluster with a Kubernetes
48+
1. Install the provider into the Kubernetes cluster with a Kubernetes
5349
configuration file.
5450

5551
```yaml
@@ -63,38 +59,33 @@ spec:
6359
EOF
6460
```
6561

66-
Verify the provider installed with `kubectl get providers`.
62+
2. Run `kubectl get providers` to verify the installed provider. The `INSTALLED` value should return as `True`.
63+
64+
_Note:_ The procedure may take up to 5 minutes for `HEALTHY` to report true.
65+
66+
You should get an output similar to the following one, providing details about the provider.
6767

68-
The `INSTALLED` value should be `True`. It may take up to 5 minutes for
69-
`HEALTHY` to report true.
7068
```shell
7169
$ kubectl get provider
7270
NAME INSTALLED HEALTHY PACKAGE AGE
7371
provider-scaleway True True xpkg.upbound.io/scaleway/provider-scaleway:v0.1 11s
7472
```
7573

76-
If there are issues downloading and installing the provider the `INSTALLED`
77-
field is empty.
74+
If there are any issue during the process of downloading and installing the provider, the `INSTALLED` field will return as empty. In that case, run `kubectl describe providers` to get more information.
7875

7976
```shell
8077
$ kubectl get providers
8178
NAME INSTALLED HEALTHY PACKAGE AGE
8279
provider-scaleway xpkg.upbound.io/scaleway/provider-scaleway:v0.1 76s
8380
```
8481

85-
Use `kubectl describe providers` for more information.
86-
8782
### Create a Kubernetes secret resource for Scaleway
88-
The provider requires credentials to create and manage Scaleway resources.
8983

90-
In a new folder, create a `secret.yaml` file and adapt it to your credentials.
84+
The provider requires credentials to create and manage Scaleway resources.
9185

92-
Create `crossplane-system` namespace if not exists
93-
```shell
94-
$ kubectl create namespace crossplane-system --dry-run=client -o yaml | kubectl apply -f -
95-
```
86+
1. In a new folder, create a `secret.yaml` file.
9687

97-
Create a `secret.yaml` file
88+
Modify the values in the example according to your needs, using the information in the Configuration reference table to help.
9889

9990
```yaml
10091
apiVersion: v1
@@ -114,6 +105,12 @@ stringData:
114105
}
115106
```
116107
108+
2. If it does not already exist, run the following command to create a `crossplane-system` namespace:
109+
110+
```shell
111+
$ kubectl create namespace crossplane-system --dry-run=client -o yaml | kubectl apply -f -
112+
```
113+
117114
#### Configuration reference
118115

119116
| Provider Argument | Description |
@@ -125,8 +122,10 @@ stringData:
125122
| `zone` | The [zone](https://developers.scaleway.com/en/quickstart/#region-and-zone) that will be used as default value for all resources. (`fr-par-1` if none specified) |
126123

127124
### Create a ProviderConfig
128-
Create a `ProviderConfig` Kubernetes configuration file to attach your Scaleway
129-
credentials to the installed provider.
125+
126+
1. Create a `ProviderConfig` Kubernetes configuration file to attach your Scaleway credentials to the previously installed provider.
127+
128+
Modify the values in the example according to your needs. Refer to the configuration reference information to understand the requested values.
130129

131130
```yaml
132131
apiVersion: scaleway.upbound.io/v1beta1
@@ -142,19 +141,22 @@ spec:
142141
key: credentials
143142
```
144143

144+
2. Run `kubectl apply -f your-folder/` to apply this configuration with the secret.
145+
146+
3. Run `kubectl describe providerconfigs` to verify the `ProviderConfig`.
147+
148+
#### Configuration reference
149+
145150
The `spec.secretRef` describes the parameters of the secret to use.
146151
* `namespace` is the Kubernetes namespace the secret is in.
147152
* `name` is the name of the Kubernetes `secret` object.
148153
* `key` is the `Data` field from `kubectl describe secret`.
149154

150-
Apply this configuration with the secret `kubectl apply -f your-folder/`.
151-
152-
You can verify the `ProviderConfig` with `kubectl describe providerconfigs`.
153-
154155
### Create a managed resource
155-
Create a managed resource to verify the provider is functioning.
156156

157-
This example creates a Scaleway Object Storage Bucket.
157+
1. Create a managed resource to see if the provider is properly functioning.
158+
159+
The following example creates a Scaleway Object Storage bucket.
158160

159161
```yaml
160162
apiVersion: object.scaleway.upbound.io/v1alpha1
@@ -168,22 +170,27 @@ spec:
168170
name: default
169171
```
170172

171-
Use `kubectl get buckets` to verify bucket creation.
173+
2. Run `kubectl get buckets` to get details on the bucket's creation.
174+
175+
You should get an output similar to the following one, providing details about the bucket.
172176

173177
```shell
174178
$ kubectl get buckets
175179
NAME READY SYNCED EXTERNAL-NAME AGE
176180
object-bucket True True fr-par/crossplane-object-bucket 9s
177181
```
178182

179-
Upbound created the bucket when the values `READY` and `SYNCED` are `True`.
183+
The bucket is successfully created when both the values for `READY` and `SYNCED` are `True`.
180184

181-
If the `READY` or `SYNCED` are blank or `False` use `kubectl describe` to
182-
understand why.
185+
3. If there are any issue during the bucket creation process, the `READY` and/or `SYNCED` fields will return as empty. In that case, run `kubectl describe` to get more information.
183186

184187
### Delete the managed resource
185-
Remove the managed resource by using `kubectl delete -f` with the same `Bucket`
186-
object file. Verify removal of the bucket with `kubectl get buckets`
188+
189+
1. Run `kubectl delete -f` (with the same `Bucket` file) to remove the managed resource.
190+
191+
2. Run `kubectl get buckets` to verify whether the bucket was properly removed.
192+
193+
You should get an output similar to this, providing details about the status of the bucket.
187194

188195
```shell
189196
$ kubectl delete -f bucket.yml
@@ -195,30 +202,30 @@ No resources found
195202

196203
## Developing
197204

198-
Run code-generation pipeline:
205+
- To run code-generation pipeline:
206+
199207
```console
200208
go run cmd/generator/main.go "$PWD"
201209
```
202210

203-
Run against a Kubernetes cluster:
211+
- To run against a Kubernetes cluster:
204212

205213
```console
206214
make run
207215
```
208216

209-
Build, push, and install:
217+
- To build, push, and install:
210218

211219
```console
212220
make all
213221
```
214222

215-
Build binary:
223+
- To build binary:
216224

217225
```console
218226
make build
219227
```
220228

221229
## Report a Bug
222230

223-
For filing bugs, suggesting improvements, or requesting new features, please
224-
open an [issue](https://github.com/scaleway/crossplane-provider-scaleway/issues).
231+
To file bugs, suggest improvements, or request new features, please open an [issue](https://github.com/scaleway/crossplane-provider-scaleway/issues).

0 commit comments

Comments
 (0)