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
Copy file name to clipboardExpand all lines: docs/content/usage/integrations/crossplane.md
+63-30Lines changed: 63 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,16 +7,27 @@ weight: 20
7
7
8
8
# Crossplane Integration
9
9
10
-
This document provides an example deployment walkthrough showing how to integrate kube-bind with Crossplane and how to deploy a sample managed MySQL resource using two kind clusters: a provider cluster (where Crossplane runs and kube-bind backend to export APIs) and a consumer cluster (which allows to bind those APIs using kube-bind konnector).
10
+
This document provides an example deployment walkthrough showing how to integrate kube-bind with
11
+
Crossplane and how to deploy a sample managed MySQL resource using two kind clusters: a provider
12
+
cluster (where Crossplane runs and kube-bind backend to export APIs) and a consumer cluster (which
13
+
allows to bind those APIs using kube-bind konnector).
11
14
12
15
!!! note
13
-
Currently for permission claims to work properly, it is required to run namespaced Crossplane resources.
14
-
16
+
Currently for permission claims to work properly, it is required to run namespaced Crossplane
17
+
resources.
15
18
16
19

17
20
18
-
1.**Install Crossplane** in your Kubernetes cluster where the kube-bind backend will run.
19
-
You can follow the official installation guide [here](https://docs.crossplane.io/v2.1/get-started/install).
21
+
## Setup
22
+
23
+
The following sections will guide you through the one-time setup that is required for providing
24
+
MySQL databases using Crossplane and kube-bind.
25
+
26
+
### Install Crossplane
27
+
28
+
Install Crossplace in your Kubernetes cluster where the kube-bind backend will run. You can follow
29
+
the [official installation guide](https://docs.crossplane.io/v2.1/get-started/install) from the
3.**Set up the mysql deployment in the provider cluster**
60
-
61
-
Create and set up Deployment, PersistentVolume, PersistentVolumeClaim and Service for MySQL instance
71
+
Create and set up `Deployment`, `PersistentVolume`, `PersistentVolumeClaim` and `Service` for the
72
+
MySQL instance.
62
73
63
74
```yaml
64
75
kubectl apply -f - <<EOF
@@ -135,9 +146,9 @@ spec:
135
146
EOF
136
147
```
137
148
138
-
4.**Create a Crossplane XRD and Composition for a managed MySQL database**
149
+
### Configure Crossplane
139
150
140
-
Apply both manifests:
151
+
Time to create a Crossplane XRD and Composition for a managed MySQL database. Apply both manifests:
141
152
142
153
```yaml
143
154
kubectl apply -f - <<EOF
@@ -181,6 +192,7 @@ spec:
181
192
EOF
182
193
```
183
194
195
+
{% raw %}
184
196
```yaml
185
197
kubectl apply -f - <<'EOF'
186
198
apiVersion: apiextensions.crossplane.io/v1
@@ -317,9 +329,11 @@ spec:
317
329
step: create-mysql-resources
318
330
EOF
319
331
```
332
+
{% endraw %}
333
+
334
+
### Export the Database API
320
335
321
-
5.**Export the database API using kube-bind.**
322
-
Create an APIServiceExportTemplate for the mysqldatabase.mangodb.com resource:
336
+
Create an `APIServiceExportTemplate` for the `mysqldatabase.mangodb.com` resource:
323
337
324
338
```yaml
325
339
kubectl apply -f - <<EOF
@@ -344,16 +358,28 @@ spec:
344
358
EOF
345
359
```
346
360
347
-
6.**Login to kube-bind and request a binding to the exported database API.**
361
+
## Usage
348
362
349
-
```bash
350
-
kubectl bind login https://kube-bind.example.com
351
-
# Authenticate and select the mysqldatabase export
352
-
kubectl bind
353
-
```
363
+
Now that everything is set up, users can begin to bind to your backend and begin consuming the new
364
+
API.
354
365
366
+
### Login to kube-bind
355
367
356
-
7. **Wait forthe binding to be established.** Once the binding is active, you can create `MySQLDatabase` resourcesin your consumer cluster, and you will get `MySQLDatabase` objects synced from the provider cluster.
368
+
```bash
369
+
kubectl bind login https://kube-bind.example.com
370
+
```
371
+
372
+
### Request a Binding
373
+
374
+
```bash
375
+
# Authenticate and select the mysqldatabase export
376
+
kubectl bind
377
+
```
378
+
379
+
### Wait for the Binding to be Established
380
+
381
+
Once the binding is active, you can create `MySQLDatabase` resources in your consumer cluster,
382
+
and you will get `MySQLDatabase` objects synced from the provider cluster.
357
383
358
384
```bash
359
385
kubectl bind
@@ -373,14 +399,17 @@ Created 1 APIServiceBinding(s):
373
399
Resources bound successfully!
374
400
```
375
401
376
-
8. **Create a managed database in your consumer cluster.**
377
-
Verify that mysqldatabases.mangodb.com CRD is synced to the consumer cluster:
402
+
### Create a Managed Database
403
+
404
+
Verify that a `mysqldatabases.mangodb.com` CRD is synced to the consumer cluster:
405
+
378
406
```bash
379
407
k get crd mysqldatabases.mangodb.com
380
408
NAME CREATED AT
381
409
mysqldatabases.mangodb.com 2025-11-27T14:22:18Z
382
410
```
383
-
Order a new consumer-database instance in the provider cluster
411
+
412
+
Order a new consumer database instance in the provider cluster:
384
413
385
414
```yaml
386
415
kubectl apply -f - <<EOF
@@ -394,7 +423,10 @@ spec:
394
423
EOF
395
424
```
396
425
397
-
9. **Observe the provisioned database and connection secret in the provider cluster.**
426
+
### Wait for Provisioning
427
+
428
+
The kube-bind konnector and the CloudNativePG operator should now be busy provisioning your
429
+
database. You can observe the provisioned database and connection Secret in the provider cluster:
398
430
399
431
```bash
400
432
kubectl get mysqldatabases.mangodb.com kube-bind-bp52k-consumer-database
kubectl get mysqldatabases.mangodb.com kube-bind-bp52k-consumer-database -o yaml
417
449
```
450
+
418
451
```yaml
419
452
apiVersion: mangodb.com/v1
420
453
kind: MySQLDatabase
@@ -472,18 +505,18 @@ status:
472
505
ready: true
473
506
```
474
507
475
-
You should see your MySQL instance created in the provider cluster and a secret with connection details, once Crossplane finishes provisioning of the database.
508
+
You should see your MySQL instance created in the provider cluster and a secret with connection
509
+
details, once Crossplane finishes provisioning of the database.
476
510
477
-
Observe that the requested secret with connection details for user is synced to consumer cluster.
511
+
Observe that the requested Secret with connection details for user is synced to consumer cluster.
0 commit comments