Skip to content

Commit 6dd17c1

Browse files
author
Mark Altmann
committed
docs(quick-10-01): document dockerConfigCredential across all guides
- Add "Local development with crossplane render" section to OCI guide - Add dockerConfigCredential reference to module-system.md - Add field to README input table and full config example - Add field to llms.txt input table and config section
1 parent ffce579 commit 6dd17c1

4 files changed

Lines changed: 60 additions & 0 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ All fields under `spec` in a `StarlarkInput` resource:
178178
| `modules` | map[string]string | -- | Inline modules loadable via `load("name.star", "func")` |
179179
| `modulePaths` | []string | -- | Additional filesystem directories for module resolution |
180180
| `dockerConfigSecret` | string | -- | Kubernetes Secret name for private OCI registry credentials |
181+
| `dockerConfigCredential` | string | -- | gRPC credential name for private OCI registry auth (for `crossplane render`) |
181182
| `ociDefaultRegistry` | string | -- | Default OCI registry for short-form `load()` targets |
182183
| `ociInsecureRegistries` | []string | -- | Registries to access over plain HTTP (development only) |
183184
| `usageAPIVersion` | string | `v2` | Crossplane Usage API version -- `v1` (Crossplane 1.x) or `v2` (Crossplane 2.x) |
@@ -233,6 +234,7 @@ spec:
233234
- /scripts/shared-lib
234235

235236
dockerConfigSecret: registry-creds
237+
dockerConfigCredential: registry-creds
236238
ociDefaultRegistry: "ghcr.io/my-org"
237239
ociInsecureRegistries: ["localhost:5050"]
238240
usageAPIVersion: "v2"

docs/module-system.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,12 @@ The secret must be mounted into the function pod via a
401401
DeploymentRuntimeConfig. For complete authentication setup (ACR, ECR, GHCR),
402402
see the [OCI module distribution guide](oci-module-distribution.md#authentication).
403403

404+
For local development with `crossplane render`, use `spec.dockerConfigCredential`
405+
instead -- it receives Docker credentials via the gRPC request rather than a
406+
filesystem mount. See the
407+
[OCI module distribution guide](oci-module-distribution.md#local-development-with-crossplane-render)
408+
for setup instructions.
409+
404410
## See also
405411

406412
- [OCI Module Distribution](oci-module-distribution.md) -- full guide for

docs/oci-module-distribution.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,56 @@ kubectl create secret docker-registry ghcr-creds \
408408
-n crossplane-system
409409
```
410410

411+
### Local development with `crossplane render`
412+
413+
`crossplane render` cannot mount volumes into function containers. To access
414+
private registries during local rendering, use `--function-credentials` to pass
415+
Docker credentials via gRPC:
416+
417+
**1. Generate a credentials file from your local Docker config:**
418+
419+
```bash
420+
kubectl create secret generic docker-config \
421+
--from-file=config.json=$HOME/.docker/config.json \
422+
--dry-run=client -o yaml > credentials.yaml
423+
```
424+
425+
**2. Add `credentials` block and `dockerConfigCredential` to your Composition:**
426+
427+
```yaml
428+
pipeline:
429+
- step: starlark
430+
functionRef:
431+
name: function-starlark
432+
credentials:
433+
- name: registry-creds
434+
source: Secret
435+
secretRef:
436+
name: docker-config
437+
namespace: default
438+
input:
439+
apiVersion: starlark.fn.crossplane.io/v1alpha1
440+
kind: StarlarkInput
441+
spec:
442+
dockerConfigCredential: registry-creds
443+
source: |
444+
load("oci://myregistry.azurecr.io/modules/helpers:v1/helpers.star", "*")
445+
```
446+
447+
**3. Render with credentials:**
448+
449+
```bash
450+
crossplane render xr.yaml composition.yaml functions.yaml \
451+
--function-credentials credentials.yaml
452+
```
453+
454+
This works with any registry you've authenticated to via `docker login`,
455+
`az acr login`, or similar.
456+
457+
> **Note:** The `secretRef.namespace` in the Composition's `credentials` block
458+
> must match the `metadata.namespace` in the `credentials.yaml` file used with
459+
> `crossplane render`. The CLI matches credentials by both name and namespace.
460+
411461
## Caching
412462

413463
OCI modules are cached in-memory with a two-layer architecture:

llms.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ spec:
2828
| ociDefaultRegistry | string | -- | Default OCI registry for short-form load syntax. Overrides STARLARK_OCI_DEFAULT_REGISTRY env var. |
2929
| ociInsecureRegistries | []string | -- | HTTP-only registries (dev only). Overrides STARLARK_OCI_INSECURE_REGISTRIES env var. |
3030
| dockerConfigSecret | string | -- | Secret name for private OCI registry auth. Overrides STARLARK_DOCKER_CONFIG_SECRET env var. |
31+
| dockerConfigCredential | string | -- | gRPC credential name for private OCI registry auth. Used with crossplane render --function-credentials or Composition credentials block. |
3132
| usageAPIVersion | string | v2 | Crossplane Usage API version: v1 (Crossplane 1.x) or v2 (Crossplane 2.x, default). Overrides STARLARK_USAGE_API_VERSION env var. |
3233
| sequencingTTL | duration | 10s | Response TTL when creation sequencing defers resources |
3334

@@ -241,6 +242,7 @@ Configuration (spec fields override env vars):
241242
- `spec.ociDefaultRegistry` / `STARLARK_OCI_DEFAULT_REGISTRY` env var
242243
- `spec.ociInsecureRegistries` / `STARLARK_OCI_INSECURE_REGISTRIES` env var (comma-separated)
243244
- `spec.dockerConfigSecret` / `STARLARK_DOCKER_CONFIG_SECRET` env var
245+
- `spec.dockerConfigCredential` (gRPC credential for crossplane render / Composition credentials block)
244246
- `spec.usageAPIVersion` / `STARLARK_USAGE_API_VERSION` env var
245247
- `STARLARK_OCI_CACHE_TTL` env var (pod-level only, default 5m)
246248

0 commit comments

Comments
 (0)