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: examples/kcp-certs/README.md
+27-96Lines changed: 27 additions & 96 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -315,66 +315,14 @@ The resource-broker will see the Certificate in the virtual workspace of the API
315
315
> The original consumer-side name `cert-from-consumer` becomes `{hash}-cert-from-consumer` in
316
316
> the provider's virtual workspace.
317
317
318
-
In the provider's virtual workspace the Certificate looks like this.
318
+
Wait for the certificate to appear on the internalca provider cluster:
319
319
320
-
Grab the hash-prefixed name from the VW:
321
-
322
-
<!--
323
-
Wait for the certificate to appear in the provider's virtual workspace:
324
-
```bash ci
325
-
kubectl::wait::list \
326
-
kubeconfigs/workspaces/internalca.vw.kubeconfig \
327
-
certificates.example.platform-mesh.io \
328
-
--all-namespaces
329
-
```
330
-
-->
331
-
332
-
```bash ci
333
-
provider_cert="$(kubectl --kubeconfig kubeconfigs/workspaces/internalca.vw.kubeconfig get certificates.example.platform-mesh.io -A -o jsonpath="{.items[0].metadata.name}")"
334
-
```
335
-
336
-
```bash ci
337
-
kubectl --kubeconfig kubeconfigs/workspaces/internalca.vw.kubeconfig get certificates.example.platform-mesh.io "$provider_cert" -o yaml
338
-
```
339
-
340
-
```yaml
341
-
apiVersion: v1
342
-
items:
343
-
- apiVersion: example.platform-mesh.io/v1alpha1
344
-
kind: Certificate
345
-
metadata:
346
-
# ...
347
-
name: {hash}-cert-from-consumer
348
-
namespace: default
349
-
# ...
350
-
spec:
351
-
fqdn: app.internal.corp
352
-
status:
353
-
# ...
354
-
relatedResources:
355
-
secret:
356
-
gvk:
357
-
group: core
358
-
kind: Secret
359
-
version: v1
360
-
name: {hash}-cert-from-consumer
361
-
namespace: default
362
-
# ...
363
-
kind: List
364
-
metadata:
365
-
resourceVersion: ""
366
-
```
367
-
368
-
On the compute cluster, api-syncagent further transforms the name using its own cluster IDs and hashes:
369
-
370
-
<!--
371
320
```bash ci
372
321
kubectl::wait::list \
373
322
kubeconfigs/internalca.kubeconfig \
374
323
certificates.example.platform-mesh.io \
375
-
--all-namespaces -l kro.run/owned=true
324
+
--all-namespaces
376
325
```
377
-
-->
378
326
379
327
```bash ci
380
328
kubectl --kubeconfig kubeconfigs/internalca.kubeconfig get certificates.example.platform-mesh.io --all-namespaces
@@ -420,21 +368,24 @@ metadata:
420
368
Grab the name and namespace from the compute cluster:
421
369
422
370
```bash ci
423
-
secret_name="$(kubectl --kubeconfig kubeconfigs/internalca.kubeconfig get certificates.example.platform-mesh.io --all-namespaces -o jsonpath="{.items[0].metadata.name}")"
424
-
secret_namespace="$(kubectl --kubeconfig kubeconfigs/internalca.kubeconfig get certificates.example.platform-mesh.io --all-namespaces -o jsonpath="{.items[0].metadata.namespace}")"
371
+
cert_name="$(kubectl --kubeconfig kubeconfigs/internalca.kubeconfig get certificates.example.platform-mesh.io --all-namespaces -o jsonpath="{.items[0].metadata.name}")"
372
+
cert_namespace="$(kubectl --kubeconfig kubeconfigs/internalca.kubeconfig get certificates.example.platform-mesh.io --all-namespaces -o jsonpath="{.items[0].metadata.namespace}")"
get secrets --namespace "$secret_namespace""$provider_cert" \
424
+
get secrets --namespace "$secret_namespace""$secret_name" \
477
425
-o jsonpath="{.data.tls\.crt}" \
478
426
| base64 --decode \
479
427
| openssl x509 -noout -serial
@@ -508,68 +456,51 @@ The internalca and externalca providers have the same setup, with KRO
508
456
relaying the Certificate example resource to a cert-manager Certificate
509
457
and back, so the secret name and namespace can be grabbed the same way:
510
458
511
-
<!--
512
459
```bash ci
513
460
kubectl::wait::list \
514
461
kubeconfigs/externalca.kubeconfig \
515
462
certificates.example.platform-mesh.io \
516
-
--all-namespaces -l kro.run/owned=true
517
-
```
518
-
-->
519
-
520
-
Grab the hash-prefixed name from the externalca VW:
521
-
522
-
<!--
523
-
Wait for the certificate to appear in the externalca provider's virtual workspace:
524
-
```bash ci
525
-
kubectl::wait::list \
526
-
kubeconfigs/workspaces/externalca.vw.kubeconfig \
527
-
certificates.example.platform-mesh.io \
528
463
--all-namespaces
529
464
```
530
-
-->
531
-
532
-
```bash ci
533
-
provider_cert="$(kubectl --kubeconfig kubeconfigs/workspaces/externalca.vw.kubeconfig get certificates.example.platform-mesh.io -A -o jsonpath="{.items[0].metadata.name}")"
534
-
```
535
465
536
466
```bash ci
537
-
secret_name="$(kubectl --kubeconfig kubeconfigs/externalca.kubeconfig get certificates.example.platform-mesh.io --all-namespaces -o jsonpath="{.items[0].metadata.name}")"
538
-
secret_namespace="$(kubectl --kubeconfig kubeconfigs/externalca.kubeconfig get certificates.example.platform-mesh.io --all-namespaces -o jsonpath="{.items[0].metadata.namespace}")"
467
+
cert_name="$(kubectl --kubeconfig kubeconfigs/externalca.kubeconfig get certificates.example.platform-mesh.io --all-namespaces -o jsonpath="{.items[0].metadata.name}")"
468
+
cert_namespace="$(kubectl --kubeconfig kubeconfigs/externalca.kubeconfig get certificates.example.platform-mesh.io --all-namespaces -o jsonpath="{.items[0].metadata.namespace}")"
0 commit comments