Expand description
Bootstrap logic for bindy bootstrap.
§bindy bootstrap operator
Applies all operator prerequisites to a Kubernetes cluster in order:
- Namespace (
bindy-systemby default, or--namespace) - CRDs — generated from Rust types, always in sync with the operator
- ServiceAccount (
bindy) - ClusterRole (
bindy-role) — operator permissions - ClusterRole (
bindy-admin-role) — admin/destructive permissions - ClusterRole (
bindcar-tokenreview) —create tokenreviewsfor the bindcar sidecar - ClusterRoleBinding (
bindy-rolebinding) — binds SA to operator role - ClusterRoleBinding (
bindcar-tokenreview) — binds the operandbind9SA (in the requested--namespace) to the TokenReview ClusterRole - Role + RoleBinding (
bindy-secrets-writer) — namespaced Secret write access - Deployment (
bindy) — the operator itself, with a projected SA token (audience: bindcar) andPOD_NAMESPACEfrom the downward API so it can authenticate to bindcar 0.7.0 sidecars
§bindy bootstrap scout
Applies all scout prerequisites to a Kubernetes cluster in order:
- Namespace (
bindy-systemby default, or--namespace) - CRDs — same 12 CRDs as the operator (shared types)
- ServiceAccount (
bindy-scout) - ClusterRole (
bindy-scout) — scout cluster-scoped permissions - ClusterRoleBinding (
bindy-scout) — binds scout SA to scout ClusterRole - Role (
bindy-scout-writer) — namespaced ARecord write permissions - RoleBinding (
bindy-scout-writer) — binds scout SA to writer Role - Deployment (
bindy-scout) — the scout controller itself
§bindy bootstrap mc
Sets up remote access so a scout running on a child (workload) cluster can write
ARecords to the queen-ship (bindy) cluster. Run this command against the
queen-ship cluster (KUBECONFIG must point at it):
- ServiceAccount (
bindy-scout-remoteby default, or--service-account) — one SA per child cluster so access can be revoked independently - Role (
bindy-scout-remote) — namespaced ARecord CRUD + DNSZone read permissions on the queen-ship. A namespaced Role is sufficient because the scout watches DNSZones viaApi::namespaced(notApi::all) in the same target namespace. - RoleBinding (
bindy-scout-remote) — binds the SA to the namespaced Role - SA token Secret — a long-lived token for the SA
- Kubeconfig Secret (
bindy-scout-remote-remote-kubeconfig) — a ready-to-use kubeconfig for the SA, printed to stdout as YAML
The stdout output is applied to the child cluster where scout runs:
bindy bootstrap mc | kubectl --context=<child-cluster> apply -f -Then set BINDY_SCOUT_REMOTE_SECRET=bindy-scout-remote-kubeconfig on the
scout Deployment so it picks up the remote kubeconfig at startup.
Structs§
- Scout
Deployment Options - Configuration options for the Scout Deployment and bootstrap process.
Constants§
- BINDCAR_
TOKENREVIEW_ CLUSTER_ ROLE_ BINDING_ YAML - Embedded TokenReview ClusterRoleBinding (bindcar
0.7.0Mode B). - BINDCAR_
TOKENREVIEW_ CLUSTER_ ROLE_ YAML - Embedded TokenReview ClusterRole (bindcar
0.7.0Mode B). - BINDCAR_
TOKENREVIEW_ NAME - Name shared by the TokenReview ClusterRole and ClusterRoleBinding.
- BINDCAR_
TOKEN_ EXPIRATION_ SECONDS - Expiration (seconds) for the projected bindcar token.
- BINDCAR_
TOKEN_ FILENAME - File name of the projected token inside
BINDCAR_TOKEN_MOUNT_PATH. - BINDCAR_
TOKEN_ MOUNT_ PATH - Mount path of the projected bindcar token volume inside the operator container.
- BINDCAR_
TOKEN_ VOLUME_ NAME - Volume name for the projected ServiceAccount token carrying the
bindcaraudience. - BINDY_
ADMIN_ ROLE_ YAML - BINDY_
ROLE_ YAML - Embedded RBAC YAML files — compiled into the binary so bootstrap is self-contained.
- CLUSTER_
ROLE_ BINDING_ NAME - ClusterRoleBinding name.
- DEFAULT_
IMAGE_ TAG - Default image tag for operator and scout Deployments.
- DEFAULT_
NAMESPACE - Default namespace for the bindy operator deployment.
- DEFAULT_
SCOUT_ CLUSTER_ NAME - Default logical cluster name stamped on ARecord labels by the scout controller.
- MC_
DEFAULT_ SERVICE_ ACCOUNT_ NAME - Default ServiceAccount name created by
bootstrap mcon the queen-ship cluster. - OPERATOR_
CLUSTER_ ROLE_ YAMLS - Embedded ClusterRole manifests applied by
bindy bootstrap operator, in apply order. - OPERATOR_
DEPLOYMENT_ NAME - Operator Deployment name.
- OPERATOR_
IMAGE_ BASE - Container image registry and repository (without tag).
- OPERATOR_
ROLE_ NAME - Operator ClusterRole name.
- POD_
NAMESPACE_ ENV - Downward-API environment variable carrying the operator pod’s namespace.
- REMOTE_
KUBECONFIG_ SECRET_ SUFFIX - Suffix appended to the service account name when naming the remote kubeconfig Secret.
- REMOTE_
KUBECONFIG_ SECRET_ TYPE - Secret type for the kubeconfig Secret placed on a child (workload) cluster.
- SA_
TOKEN_ SECRET_ SUFFIX - Suffix appended to the service account name when naming the SA token Secret.
- SCOUT_
CLUSTER_ ROLE_ BINDING_ NAME - Scout ClusterRoleBinding name.
- SCOUT_
CLUSTER_ ROLE_ NAME - Scout ClusterRole name.
- SCOUT_
DEPLOYMENT_ NAME - Scout Deployment name.
- SCOUT_
SECRETS_ READER_ ROLE_ BINDING_ NAME - Scout namespaced RoleBinding name for
SCOUT_SECRETS_READER_ROLE_NAME. - SCOUT_
SECRETS_ READER_ ROLE_ NAME - Scout namespaced Role name (remote-cluster kubeconfig Secret read, Phase 2 only).
- SCOUT_
SERVICE_ ACCOUNT_ NAME - Scout ServiceAccount name.
- SCOUT_
WRITER_ ROLE_ BINDING_ NAME - Scout namespaced RoleBinding name.
- SCOUT_
WRITER_ ROLE_ NAME - Scout namespaced Role name (ARecord write permissions).
- SECRETS_
WRITER_ ROLE_ BINDING_ NAME - Namespaced RoleBinding name for the secrets-writer Role.
- SECRETS_
WRITER_ ROLE_ NAME - Namespaced Role granting the operator the mutating verbs on Secrets (B-5 hardening).
- SERVICE_
ACCOUNT_ NAME - ServiceAccount name created for the operator.
Functions§
- build_
all_ crds - Build all 12 CRDs in the same order as
crdgen. - build_
cluster_ role_ binding - Build the ClusterRoleBinding that binds the bindy ServiceAccount to
bindy-role. - build_
crd - Build a single CRD from a Rust type, ensuring
storage: trueandserved: true. - build_
deployment - Build the operator Deployment manifest.
- build_
kubeconfig_ yaml - Build a kubeconfig YAML string for the given service account token.
- build_
mc_ kubeconfig_ secret - Build the
bindy.firestoned.io/remote-kubeconfigSecret containing the kubeconfig YAML. - build_
mc_ sa_ token_ secret - Build the
kubernetes.io/service-account-tokenSecret that triggers token generation. - build_
mc_ service_ account - Build the multi-cluster ServiceAccount on the queen-ship cluster.
- build_
mc_ writer_ role - Build the namespaced Role for the multi-cluster service account on the queen-ship.
- build_
mc_ writer_ role_ binding - Build the RoleBinding that binds the multi-cluster SA to its Role on the queen-ship.
- build_
namespace - Build the operator namespace object.
- build_
scout_ cluster_ role - Build the scout ClusterRole with cluster-scoped permissions.
- build_
scout_ cluster_ role_ binding - Build the ClusterRoleBinding that binds the scout ServiceAccount to the scout ClusterRole.
- build_
scout_ deployment - Build the scout Deployment manifest.
- build_
scout_ secrets_ reader_ role - Build the namespaced Role granting Scout read access to the single remote-cluster kubeconfig Secret (Phase 2 / multi-cluster mode only).
- build_
scout_ secrets_ reader_ role_ binding - Build the RoleBinding pairing
build_scout_secrets_reader_rolewith the Scout ServiceAccount. - build_
scout_ service_ account - Build the scout ServiceAccount in the given namespace.
- build_
scout_ writer_ role - Build the scout writer Role (namespaced ARecord write permissions).
- build_
scout_ writer_ role_ binding - Build the scout writer RoleBinding (binds scout SA to writer Role).
- build_
secrets_ writer_ role - Build the namespaced Role granting the operator the mutating verbs on Secrets.
- build_
secrets_ writer_ role_ binding - Build the RoleBinding that binds the operator ServiceAccount to the namespaced
bindy-secrets-writerRole. - build_
service_ account - Build the bindy ServiceAccount in the given namespace.
- build_
tokenreview_ cluster_ role_ binding - Build the TokenReview ClusterRoleBinding for the requested install namespace.
- parse_
cluster_ role - Parse a ClusterRole from embedded YAML.
- parse_
cluster_ role_ binding - Parse a ClusterRoleBinding from embedded YAML.
- resolve_
image - Resolve the full container image reference for the bindy image.
- run_
bootstrap_ multi_ cluster - Run the multi-cluster bootstrap process (
bindy bootstrap multi-cluster). - run_
bootstrap_ operator - Run the operator bootstrap process (
bindy bootstrap operator). - run_
bootstrap_ scout - Run the scout bootstrap process (
bindy bootstrap scout). - run_
revoke_ multi_ cluster - Revoke all resources that
bootstrap mccreated for a given service account.