kadet-hub logokadet-hub

k3d

Renders k3d cluster config files (k3d.io/v1alpha5 Simple) for k3d cluster create --config.

kubernetesclusters

Latest
1.0.0 ·
License
Apache-2.0
Owners
Moep90
Source
github.com/kadet-hub/generators · 0 repo stars, shared by 35 generators
Thumbs up
👍 0 on GitHub Discussions
Popularity
16 · 223 pulls

Request a feature Report a problem

Badge

Show the latest listed version in your README. shields.io draws the badge from this page's badge.json, which every catalog build updates; once no version is listed, it reads "not listed".

[![kadet-hub](https://img.shields.io/endpoint?url=https://kadet-hub.org/generators/k3d/badge.json)](https://kadet-hub.org/generators/k3d/)

K3d Generator

Published on kadet-hub: pin a released version by digest from its catalog page.

Kapitan kadet generator for k3d cluster config files. Every entry under clusters becomes one k3d.io/v1alpha5 Simple config that k3d cluster create --config reads. Built for k3d 5.9.0.

Usage

Kapitan Configuration

parameters:
  kapitan:
    dependencies:
      - type: oci
        source: ghcr.io/kadet-hub/k3d@sha256:<digest>
        output_path: lib/k3d
    compile:
      - output_path: k3d/
        input_type: kadet
        output_type: yml
        input_paths:
          - lib/k3d
k3d cluster create --config compiled/<target>/k3d/<cluster>.yml

Inventory Contract

All keys live under parameters.generators.k3d.clusters.<cluster>. The cluster key becomes metadata.name and the output file <cluster>.yml. The keys are the k3d v1alpha5 config fields and pass through unchanged, apart from the forms below:

Key Accepted input Output
servers, agents, image, network, subnet, token value same field
kubeAPI host, hostIP, hostPort values rendered as strings, so hostPort: 6443 is valid
ports, volumes, env plain value, {port|volume|envVar: ..., nodeFilters} or {value: ..., nodeFilters} {port|volume|envVar: "<string>", nodeFilters}
files source, destination, description, nodeFilters same
registries create (name, host, hostPort, image, proxy, volumes, enforcePortMatch), use, config same
hostAliases ip, hostnames same
options k3d, k3s (extraArgs, nodeLabels), kubeconfig, runtime same

There is no spec passthrough and the generator sets no defaults: an empty cluster entry gives a config with only apiVersion, kind and metadata, and k3d applies its own defaults. One of them is kubeAPI.hostIP: 0.0.0.0, so the API listens on all host interfaces unless you set hostIP: 127.0.0.1; the same holds for registries.create.host.

Keys outside the v1alpha5 config are dropped from the output with a warning that names them. The generator does not validate at compile time; the shipped schema below is what the gate checks the output against.

Node filters: loadbalancer, server:*, server:0, agent:*, agent:1, all. A port without node filter goes to the load balancer when the cluster has more than one node.

token is the cluster join secret; set it from a Kapitan ref (?{...}), not as plain text.

Example

parameters:
  generators:
    k3d:
      clusters:
        dev:
          servers: 1
          agents: 2
          image: rancher/k3s:v1.32.5-k3s1
          kubeAPI:
            hostIP: 127.0.0.1
            hostPort: 6443
          ports:
            - port: "8080:80"
              nodeFilters: ["loadbalancer"]
          registries:
            create:
              name: registry.localhost
              host: 127.0.0.1
              hostPort: "5000"
              proxy:
                remoteURL: https://registry-1.docker.io
            config: |
              mirrors:
                "docker.io":
                  endpoint:
                    - "http://registry.localhost:5000"
          options:
            k3s:
              extraArgs:
                - arg: --disable=traefik
                  nodeFilters: ["server:*"]

The registry is created under the given name and is reachable from the nodes as registry.localhost:5000; with proxy.remoteURL it acts as a pull-through cache for Docker Hub.

Output

File Content
<cluster>.yml k3d.io/v1alpha5 Simple, one per cluster

Schemas

schemas/k3d.io/simple_v1alpha5.json is the SimpleConfig schema k3d publishes at v5.9.0 (MIT, see schemas/k3d.io/LICENSE), closed so that unknown fields fail. All output is checked against it. The k3s manifests or registry config embedded as strings in files[].source and registries.config are not schema-checked.

Versions

Add a version's inventory entry, then compile with the consumer workflow, which verifies the artifact and runs Kapitan in the sandbox.

Free of charge, as is and on a best-effort basis: use at your own risk, and review the compiled output before you apply it. Terms

This catalog was built from index serial 47. Set index_serial: 47 in .kapitan-sandbox.yaml and the consumer workflow refuses any older index, so a rolled-back index cannot bring back a yanked version.

Checks find known patterns; they do not prove a generator safe. What a listing covers

VersionBuilt for (schema-checked)
1.0.0k3d 5.9.0
1.0.0

Inventory

parameters:
  kapitan:
    dependencies:
      - type: oci
        source: ghcr.io/kadet-hub/k3d:1.0.0@sha256:c854e7b73eb11c5945c8aa4f76759626916c9944cfd0f1f02d12d2631dda6710
        output_path: lib/k3d

Verify

gh attestation verify \
  oci://ghcr.io/kadet-hub/k3d@sha256:c854e7b73eb11c5945c8aa4f76759626916c9944cfd0f1f02d12d2631dda6710 \
  --owner kadet-hub \
  --cert-identity https://github.com/kadet-hub/registry/.github/workflows/release.yml@refs/heads/main

Transparency log: Rekor entry 3220554395, in Sigstore's public, append-only log, so the attestation stays checkable independent of this site.

Kapitan declared
>=0.36.3,<0.37
Kapitan checked
0.36.3
Backends checked
not recorded
With --cache
not recorded
krab
compatible
Built for (schema-checked)
k3d 5.9.0
Source
k3d-v1.0.0 · 313f1ca5e57679c11b891880f2cf10687832e4fc · k3d
Binaries
none
Output capabilities
none
Digest
sha256:c854e7b73eb11c5945c8aa4f76759626916c9944cfd0f1f02d12d2631dda6710

Checks

Checked by the release run on , gate at e79f456106a6.

  • Secrets gitleaks 8.30.1
    No secret matched the marketplace's gitleaks rules.
  • Malware ClamAV 1.5.4
    No file matched a ClamAV signature.
  • Malicious package heuristics GuardDog 3.2.0
    No GuardDog threat rule matched.
  • Dangerous code Semgrep 1.180.0
    No marketplace Semgrep rule matched, such as eval, subprocess or network calls.
  • Python errors Ruff 0.17.0
    No syntax error or undefined name (Ruff, error rules only).
  • File tree tree_check.py
    No symlink, executable or banned file; imports within the allowlist.
  • Sandboxed compile gVisor 20261005, Kapitan 0.36.3
    The fixture compiled without network, with decoy credentials; no undeclared program ran, no decoy was read.
  • Output capabilities Conftest 0.71.1
    The compiled output uses only the capabilities the manifest declares.
  • CI detection Kapitan 0.36.3
    The output is the same with CI variables set.

SBOM (SPDX 2.3)

Output diff

No output diff recorded: this version was published before the release run recorded one.