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/kro.md
+19-24Lines changed: 19 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,9 +8,9 @@ weight: 30
8
8
# kro Integration (providing LoadBalancer as a Service)
9
9
10
10
This guide demonstrates how to use [kro](https://kro.run/) and [Envoy Gateway](https://gateway.envoyproxy.io/) to offer a "LoadBalancer as a Service" API.
11
-
Consumers create a simple `LoadBalancer` object, and theprovider automatically provisions an Envoy Gateway and HTTPRoute to expose the service between two kind clusters.
11
+
Consumers create a simple `LoadBalancer` object, and the provider automatically provisions an Envoy Gateway and HTTPRoute to expose the service between two kind clusters.
12
12
13
-
This example includes support for **custom configuration** (via ConfigMaps).
13
+
This example includes support for syncing **custom configuration (via ConfigMaps or Secrets)** from consumer clusters to the provider.
14
14
15
15
## Prerequisites
16
16
@@ -86,17 +86,17 @@ EOF
86
86
2.**Install kro.**
87
87
kro allows you to define custom APIs (ResourceGroups) and map them to underlying resources.
Create a kro `ResourceGraphDefinition` that defines the API `loadbalancers.networking.kro.run`.
97
97
98
98
This definition includes:
99
-
***Configuration:** References a ConfigMap for custom routing rules (e.g., adding headers).
99
+
***Configuration:** References a ConfigMap for custom routing rules (e.g., adding headers). The same way user could reference a Secret with Certificate to setup TLS.
100
100
101
101
```yaml
102
102
kubectl apply -f - <<'EOF'
@@ -111,17 +111,14 @@ spec:
111
111
group: networking.kro.run
112
112
spec:
113
113
domain: string
114
-
tlsSecretRef: string
115
114
configMapRef: string
116
115
targetService: string
117
-
targetServiceNamespace: string | default=default
116
+
targetServiceNamespace: string
118
117
targetPort: integer | default=8080
119
118
status:
120
119
address: string
121
120
resources:
122
121
- id: configmap
123
-
includeWhen:
124
-
- ${schema.spec.configMapRef != ""}
125
122
template:
126
123
apiVersion: v1
127
124
kind: ConfigMap
@@ -179,12 +176,7 @@ spec:
179
176
requestHeaderModifier:
180
177
add:
181
178
- name: X-Custom-Message
182
-
value: ${configmap.data["custom-header"]}
183
-
- type: ResponseHeaderModifier
184
-
responseHeaderModifier:
185
-
add:
186
-
- name: X-Response-Message
187
-
value: ${configmap.data["custom-header"]}
179
+
value: ${configmap.?data["custom-header"]}
188
180
EOF
189
181
```
190
182
@@ -340,6 +332,7 @@ spec:
340
332
domain: "www.example.com"
341
333
configMapRef: "my-lb-config"
342
334
targetService: "backend"
335
+
targetServiceNamespace: "default"
343
336
targetPort: 30080
344
337
EOF
345
338
```
@@ -374,9 +367,15 @@ kube-root-ca.crt 1 3h14m
374
367
my-lb-config 1 15s
375
368
```
376
369
377
-
Test the connection with provisioned load balancer and verify that `hello-kube-bind` header was added from the ConfigMap.
370
+
5. **Appendix.**
371
+
* Test the connection with provisioned load balancer and verify that `hello-kube-bind` header was added from the ConfigMap.
372
+
373
+
!!! note
374
+
For this to work end-to-end, the consumer's service (`backend`) must be reachable from the provider cluster (e.g., via multi-cluster networking) or synced to the provider cluster.
For this to work end-to-end, the consumer's service (`backend`) must be reachable from the provider cluster (e.g., via multi-cluster networking) or synced to the provider cluster.
0 commit comments