Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ For which Configuration brings which along, see [`docs/diagrams/xr-ownership.md`
| machinery | [vm-provision](machinery/vm-provision/) | v0.2.0 | Unified VM router: a namespaced `VMProvision` XR routes to a `VsphereVM` or `ProxmoxVM` (per `spec.provider`) and optionally chains an `AnsibleRun`, composing the `vsphere-vm`, `proxmox-vm` and `ansible-run` Configurations (via `function-kcl`). | [`ghcr.io/stuttgart-things/crossplane-configurations/vm-provision`](https://github.com/stuttgart-things/crossplane-configurations/pkgs/container/crossplane-configurations%2Fvm-provision) |
| machinery | [vsphere-vm](machinery/vsphere-vm/) | v0.2.0 | Provisions a VMware vSphere virtual machine from a namespaced `VsphereVM` XR. An OpenTofu `Workspace` (`provider-opentofu`) runs the [`vsphere-vm`](https://github.com/stuttgart-things/vsphere-vm) Terraform module; shared placement/credentials default from an `EnvironmentConfig`. | [`ghcr.io/stuttgart-things/crossplane-configurations/vsphere-vm`](https://github.com/stuttgart-things/crossplane-configurations/pkgs/container/crossplane-configurations%2Fvsphere-vm) |
| machinery | [vspherevm](machinery/vspherevm/) | v0.15.0 | Provisions a VMware vSphere virtual machine from a namespaced `NativeVsphereVM` XR using the NATIVE [`provider-vspherevm`](https://github.com/stuttgart-things/provider-vspherevm) managed `VirtualMachine` resource (no Terraform/OpenTofu). The native-provider sibling of `vsphere-vm`: per-environment placement MOIDs (`templateUuid`, `datastoreId`, `resourcePoolId`, `networkId`, `folder`) are loaded from a Crossplane `EnvironmentConfig`, so an XR states only intent (name/cpu/ram/disk) and the topology is injected. `vm.tags` and `vm.customAttributes` mirror proxmoxvm's, with the difference that decides how they are used: a vSphere tag is an inventory OBJECT, so the field takes its id (`urn:vmomi:InventoryServiceTag:<uuid>:GLOBAL`) and a custom attribute its numeric vCenter field id — and since `provider-vspherevm` ships only `VirtualMachine`, nothing here can create or resolve either, so an unknown id fails the clone. Tags merge with the EnvironmentConfig's and are sorted and deduped (the CRD declares the field a set, which rejects a repeat outright); custom attributes merge per key with the XR winning ([#484](https://github.com/stuttgart-things/crossplane-configurations/issues/484)). `vm.os` (v0.15.0) picks an OS from the EnvironmentConfig's `templates` table, whose entry carries `templateUuid` and `guestId` together — vCenter refuses a clone whose guestId does not match the template's, and an `os` the table lacks fails the render ([stuttgart-things#4489](https://github.com/stuttgart-things/stuttgart-things/issues/4489)). | [`ghcr.io/stuttgart-things/crossplane-configurations/vspherevm`](https://github.com/stuttgart-things/crossplane-configurations/pkgs/container/crossplane-configurations%2Fvspherevm) |
| storage | [minio](storage/minio/) | v0.1.1 | MinIO **buckets, policies and users** from a cluster-scoped `MinioBucket` XR, composed as native [provider-minio](https://github.com/vshn/provider-minio) managed resources — the bucket, one `Policy` per `spec.access` entry (`<bucket>-<entry>`, either scoped to this bucket or a raw S3 policy) and, unless `user: false`, one `User` carrying it whose keys land in a Secret as `AWS_ACCESS_KEY_ID` / `AWS_SECRET_ACCESS_KEY` — the shape an S3 backend, CNPG's barman plugin and rclone all read. Replaces the `mc` commands every bucket in the fleet was created with. `spec.deletionPolicy` decides what deleting the XR does to the BUCKET (`Orphan` by default, because a bucket holds data this Configuration did not write; `DeleteIfEmpty`, `DeleteAll`), while policies and users always go — they are access, not data. Cluster-scoped on purpose: every kind provider-minio serves is cluster-scoped and Crossplane v2 refuses to compose one from a namespaced XR, and a bucket name is unique per instance rather than per namespace anyway (reason recorded on the XRD). Two provider behaviours shape the Composition, both measured on a lab MinIO with v0.4.5: a `Policy` is named after its Kubernetes OBJECT and ignores `crossplane.io/external-name`, so a generated resource name would reach the instance and the user referencing it is refused with `policy not found` — every composed object therefore carries an explicit `metadata.name`; and an existing bucket cannot be adopted (`observe failed: bucket already exists`), so the hand-made buckets in the fleet stay outside Crossplane until that changes. A `User` is composed only once its `Policy` is Ready, because provider-minio validates the policy's existence in an admission webhook. `spec.bucketName` is immutable (v0.1.1): the user is named after it and cannot be renamed, so the XRD refuses a change instead of letting the XR stall on `Synced=False`. | [`ghcr.io/stuttgart-things/crossplane-configurations/minio`](https://github.com/stuttgart-things/crossplane-configurations/pkgs/container/crossplane-configurations%2Fminio) |
| storage | [minio](storage/minio/) | v0.1.2 | MinIO **buckets, policies and users** from a cluster-scoped `MinioBucket` XR, composed as native [provider-minio](https://github.com/vshn/provider-minio) managed resources — the bucket, one `Policy` per `spec.access` entry (`<bucket>-<entry>`, either scoped to this bucket or a raw S3 policy) and, unless `user: false`, one `User` carrying it whose keys land in a Secret as `AWS_ACCESS_KEY_ID` / `AWS_SECRET_ACCESS_KEY` — the shape an S3 backend, CNPG's barman plugin and rclone all read. Replaces the `mc` commands every bucket in the fleet was created with. `spec.deletionPolicy` decides what deleting the XR does to the BUCKET (`Orphan` by default, because a bucket holds data this Configuration did not write; `DeleteIfEmpty`, `DeleteAll`), while policies and users always go — they are access, not data. Cluster-scoped on purpose: every kind provider-minio serves is cluster-scoped and Crossplane v2 refuses to compose one from a namespaced XR, and a bucket name is unique per instance rather than per namespace anyway (reason recorded on the XRD). Two provider behaviours shape the Composition, both measured on a lab MinIO with v0.4.5: a `Policy` is named after its Kubernetes OBJECT and ignores `crossplane.io/external-name`, so a generated resource name would reach the instance and the user referencing it is refused with `policy not found` — every composed object therefore carries an explicit `metadata.name`; and an existing bucket cannot be adopted (`observe failed: bucket already exists`), so the hand-made buckets in the fleet stay outside Crossplane until that changes. A `User` is composed only once its `Policy` is Ready, because provider-minio validates the policy's existence in an admission webhook. `spec.bucketName` is immutable (v0.1.1): the user is named after it and cannot be renamed, so the XRD refuses a change instead of letting the XR stall on `Synced=False`. | [`ghcr.io/stuttgart-things/crossplane-configurations/minio`](https://github.com/stuttgart-things/crossplane-configurations/pkgs/container/crossplane-configurations%2Fminio) |
| vault | [app-secret-profile](vault/app-secret-profile/) | v0.1.1 | What an app needs in Vault, declared once per app as a **cluster-scoped** `AppSecretProfile` (group `secrets.stuttgart-things.com`, name = the app, as listed by a catalog profile's `appSecrets`): entries the app owns per cluster, each key exactly one of `generate` / `literal` / `shared` (enforced at admission), which keys an order may override, and `reads` of other apps' keys used directly, never copied. Composes nothing — publishes the resolved view and checks every read reference (`ReadsResolved`). Consumed by `xplane-cluster`; the environment half stays in `cluster-vault-<env>` (#464). Cluster-scoped on purpose: a profile decides what every order of that app receives, so only admins or the app owners may change it. | [`ghcr.io/stuttgart-things/crossplane-configurations/app-secret-profile`](https://github.com/stuttgart-things/crossplane-configurations/pkgs/container/crossplane-configurations%2Fapp-secret-profile) |
| vault | [vault-k8s-auth](vault/vault-k8s-auth/) | v0.4.2 | **Prototype.** Vault Kubernetes auth backends from a namespaced `VaultK8sAuth` XR (group `vault.stuttgart-things.com`) as native [provider-vault](https://github.com/upbound/provider-vault) managed resources — auth mount, created policies, role and TokenReview config each their own MR — instead of one OpenTofu `Workspace` per auth like [vault-auth](bootstrap/vault-auth/). The role is composed only once the mount and every policy it names are Ready (Vault accepts a role naming a missing policy and the token then silently has no permissions); `status.share` keeps vault-auth's contract. `adoption` takes over what vault-auth already created for a cluster: Observe-only first, compared with the spec, handed over without Delete — differences hold it and are named in a condition. Created policies carry the fixed prefix `xp-`, so the AppRole needs only `sys/policies/acl/xp-*`; `policies[].kvMount` is denied for admin-credential mounts (`kubeconfigs`, `ssh`, `cicd-*`) and Vault system paths at admission; everything else, including `tokenPolicies`, is bounded by RBAC on the XR. | [`ghcr.io/stuttgart-things/crossplane-configurations/vault-k8s-auth`](https://github.com/stuttgart-things/crossplane-configurations/pkgs/container/crossplane-configurations%2Fvault-k8s-auth) |
| vault | [vault-secrets](vault/vault-secrets/) | v0.4.0 | **Prototype.** Writes secrets into a Vault KV engine (v2 or v1) from a namespaced `VaultSecretSet` XR via provider-vault. Each key is a literal, a key of a Secret in the XR's own namespace, generated once at random, or adopted once from an existing Vault entry (`vaultRef`, through the XR's own credential) — kept and read back on every reconcile; the JSON sits in a composed Secret next to the XR and reaches Vault by `dataJsonSecretRef`, never in an MR spec. Losing that Secret after Vault was written holds the XR at `Ready=False` instead of silently rotating a live credential, unless `generate.regenerate: true`. A secret is written only once every source resolves; a source that disappears later keeps the last value and flags `SourcesResolved=False`. A `claim` owns an entry without its data — custom_metadata only, and every version deleted with the XR — for paths another writer fills, like `kubeconfigs/<cluster>`. Can compose the KV mount, which it never deletes. | [`ghcr.io/stuttgart-things/crossplane-configurations/vault-secrets`](https://github.com/stuttgart-things/crossplane-configurations/pkgs/container/crossplane-configurations%2Fvault-secrets) |
Expand Down
2 changes: 1 addition & 1 deletion docs/diagrams/xr-ownership.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ Entry points (nothing in this repo depends on them): `cluster`, `packer-release`
| machinery | [vm-provision](../../machinery/vm-provision/) | `VMProvision` | `resources.stuttgart-things.com` | Namespaced | v0.2.0 | `ansible-run`, `proxmox-vm`, `vsphere-vm` |
| machinery | [vsphere-vm](../../machinery/vsphere-vm/) | `VsphereVM` | `resources.stuttgart-things.com` | Namespaced | v0.2.0 | — |
| machinery | [vspherevm](../../machinery/vspherevm/) | `NativeVsphereVM` | `resources.stuttgart-things.com` | Namespaced | v0.15.0 | `ansible-run` |
| storage | [minio](../../storage/minio/) | `MinioBucket` | `storage.stuttgart-things.com` | Cluster | v0.1.1 | — |
| storage | [minio](../../storage/minio/) | `MinioBucket` | `storage.stuttgart-things.com` | Cluster | v0.1.2 | — |
| vault | [app-secret-profile](../../vault/app-secret-profile/) | `AppSecretProfile` | `secrets.stuttgart-things.com` | Cluster | v0.1.1 | — |
| vault | [vault-k8s-auth](../../vault/vault-k8s-auth/) | `VaultK8sAuth` | `vault.stuttgart-things.com` | Namespaced | v0.4.2 | — |
| vault | [vault-secrets](../../vault/vault-secrets/) | `VaultSecretSet` | `vault.stuttgart-things.com` | Namespaced | v0.4.0 | — |
Expand Down
29 changes: 17 additions & 12 deletions storage/minio/apis/composition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -165,25 +165,30 @@ spec:
{{- if and (eq $c.type "Ready") (eq $c.status "True") }}{{ $bucketReady = true }}{{ end }}
{{- end }}
{{- if $bucketReady }}
{{- /* Built first and emitted as JSON, so an EMPTY list renders as []
and not as a bare key (= null). A null failed the XR's status
update ("share.users ... must be of type array") for every
bucket without access entries or with only `user: false` ones,
and the XR stayed Ready=False with bucket and policy Available
(tofu-state on machinery-labul, 2026-11-25). */}}
{{- $policies := list }}
{{- $users := list }}
{{- range $a := $access }}
{{- $policies = append $policies (printf "%s-%s" $bucket $a.name) }}
{{- $wantUser := true }}{{ if hasKey $a "user" }}{{ $wantUser = $a.user }}{{ end }}
{{- if $wantUser }}
{{- $users = append $users (dict "name" (printf "%s-%s" $bucket $a.name) "connectionSecret" (printf "%s/%s" ((($a.connectionSecret | default dict).namespace) | default "crossplane-system") ((($a.connectionSecret | default dict).name) | default (printf "%s-%s" $bucket $a.name)))) }}
{{- end }}
{{- end }}
---
apiVersion: storage.stuttgart-things.com/v1alpha1
kind: MinioBucket
status:
share:
bucket: {{ $bucket | quote }}
region: {{ $region | quote }}
policies:
{{- range $a := $access }}
- {{ printf "%s-%s" $bucket $a.name | quote }}
{{- end }}
users:
{{- range $a := $access }}
{{- $wantUser := true }}{{ if hasKey $a "user" }}{{ $wantUser = $a.user }}{{ end }}
{{- if $wantUser }}
- name: {{ printf "%s-%s" $bucket $a.name | quote }}
connectionSecret: {{ printf "%s/%s" ((($a.connectionSecret | default dict).namespace) | default "crossplane-system") ((($a.connectionSecret | default dict).name) | default (printf "%s-%s" $bucket $a.name)) | quote }}
{{- end }}
{{- end }}
policies: {{ $policies | toJson }}
users: {{ $users | toJson }}
{{- end }}
- step: automatically-detect-ready-composed-resources
functionRef:
Expand Down
2 changes: 1 addition & 1 deletion storage/minio/crossplane.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
annotations:
# Local convention used by `task push` to bump and re-publish.
# Not a Crossplane-standard field — the true package version is the OCI tag.
meta.crossplane.io/version: v0.1.1
meta.crossplane.io/version: v0.1.2
meta.crossplane.io/maintainer: patrick.hermann@sva.de
meta.crossplane.io/source: github.com/stuttgart-things/crossplane-configurations
meta.crossplane.io/license: Apache-2.0
Expand Down
Loading
Loading