Skip to content

Commit 749d401

Browse files
authored
fix(kubernetes, opensearch, foundationdb)!: restrict managed application images (#5085)
## What this PR does Image overrides let tenants run arbitrary containers in management cluster, including helpers with access to Talos CA secrets and Kubernetes API credentials. This PR removes those overrides and uses images shipped by the platform. Replaces [the original PR](#4287) for 1.7. Andrei Kvapil's commits keep his authorship. - Kubernetes and KubernetesNodes helpers use the bundled image references through `cozy-lib.image`. OpenSearch uses its version map. Talos installer settings for tenant worker VMs stay available. - FoundationDB uses `version: v7.3` or `v7.4`, mapped to `7.3.63` and `7.4.1`. Migration 60 carries the old `cluster.version` over to its release line, records releases needing attention and preserves the legacy value while the old chart can still render it. - The FoundationDB chart refuses a render when `cluster.version` and `version` name different release lines. This also covers variants without platform migrations. - OpenSearch and FoundationDB get version-map update scripts. They retain the current default while it remains supported. Application types and schemas are still generated from the charts. ### Upgrade notes Stored image overrides are accepted without new admission warnings and ignored by the charts. On the first reconcile, OpenSearch nodes move to the image for their selected version, and Kubernetes components whose images changed restart. Check custom OpenSearch images before upgrading: if one runs a newer version than the chart's map, switching back can leave nodes unable to read their data. Air-gapped installations need `docker.io` and `ghcr.io` mirrored on management-cluster nodes. FoundationDB preserves the release line, not an arbitrary patch: 7.3.x moves to 7.3.63 and 7.4.x to 7.4.1. Check these versions before upgrading. A cluster on 7.1 needs an upgrade to 7.3 first. On variants without migrations, set `version` to the line the cluster runs. To change release lines later, remove the leftover `cluster.version` as directed by the chart error. Migration 60 records affected releases in the `cozystack.io/migration-60-needs-attention` annotation on the `cozystack-version` ConfigMap. Dry-run reports patch changes without patching, annotating or advancing the migration stamp. Migration 56 no longer carries the removed kubectl override into adopted node pools. An explicit OpenSearch `version: null` now fails rendering instead of falling back to `v2`. ### Validation - `make unit-tests` passed, including migrations 56 and 60. - Four-chart regression run: 750 tests passed. - API Create/Update, admission, defaulting and existing warning regression tests passed. `cmd/`, `internal/` and `pkg/` match main. - Shell test lanes passed with `/bin/sh` as dash throughout the process tree. - `make generate manifests` passed with no generated drift, using cozyvalues-gen v1.7.0. E2E passed on e694b05. ### Screenshots Not a UI change. ### Downstream repositories - [ ] No downstream repository is affected by this change - [ ] [cozystack/website](https://github.com/cozystack/website) - existing generated parameter tables are refreshed by the release docs job. - [x] [cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack) - follow-up: [schema updates](cozystack/terraform-provider-cozystack#74). - [ ] [cozystack/ansible-cozystack](https://github.com/cozystack/ansible-cozystack) - follow-up: - [ ] [cozystack/ccp](https://github.com/cozystack/ccp) - follow-up: - [ ] [cozystack/talm](https://github.com/cozystack/talm) - follow-up: - [ ] [cozystack/cozyhr](https://github.com/cozystack/cozyhr) - follow-up: - [ ] [cozystack/cozy-proxy](https://github.com/cozystack/cozy-proxy) - follow-up: - [ ] [cozystack/cozystack-telemetry-server](https://github.com/cozystack/cozystack-telemetry-server) - follow-up: - [ ] [cozystack/external-apps-example](https://github.com/cozystack/external-apps-example) - follow-up: - [ ] [cozystack/examples](https://github.com/cozystack/examples) - follow-up: - [ ] [cozystack/community](https://github.com/cozystack/community) - follow-up: The provider follow-up removes the Kubernetes and KubernetesNodes image blocks and adds FoundationDB version selection. No other downstream follow-up is needed for these fields. ### Release note ```release-note fix(kubernetes, opensearch, foundationdb)!: Remove tenant image overrides from Kubernetes, KubernetesNodes and OpenSearch. Existing overrides switch to platform images on reconciliation, which can roll OpenSearch nodes and restart Kubernetes components. Air-gapped installations must mirror the upstream registries on management-cluster nodes. FoundationDB replaces cluster.version with version (v7.3 or v7.4); migration 60 preserves the release line and records patch changes. Check running image versions before upgrading. Variants without migrations must set the FoundationDB version before upgrading, and the chart refuses mismatched legacy release lines. OpenSearch rejects an explicit version: null. ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **New Features** * FoundationDB now supports selecting version lines `v7.3` and `v7.4`, with `v7.3` as the default. * Added automatic migration of existing FoundationDB version settings, with warnings for settings that need attention. * **Changes** * Removed per-application image overrides for Kubernetes, Kubernetes Nodes, and OpenSearch. These charts now use their bundled images, which can still be routed through the configured image registry. * OpenSearch now reports an error when its version is missing or unsupported. * Existing FoundationDB settings with conflicting version lines are reported for review. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2 parents 55aad6f + e694b05 commit 749d401

57 files changed

Lines changed: 1400 additions & 304 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎api/apps/v1alpha1/foundationdb/types.go‎

Lines changed: 6 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎api/apps/v1alpha1/kubernetes/types.go‎

Lines changed: 0 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎api/apps/v1alpha1/kubernetes/zz_generated.deepcopy.go‎

Lines changed: 0 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎api/apps/v1alpha1/kubernetesnodes/types.go‎

Lines changed: 0 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎api/apps/v1alpha1/kubernetesnodes/zz_generated.deepcopy.go‎

Lines changed: 0 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎api/apps/v1alpha1/opensearch/types.go‎

Lines changed: 0 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎api/apps/v1alpha1/opensearch/zz_generated.deepcopy.go‎

Lines changed: 0 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎examples/backups/foundationdb/03-create-foundationdb-src.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ metadata:
1919
name: ${FDB_NAME}
2020
namespace: ${NAMESPACE}
2121
spec:
22+
version: v7.3
2223
cluster:
23-
version: "7.3.63"
2424
processCounts:
2525
storage: 1
2626
stateless: -1

‎examples/backups/foundationdb/06-restore-to-copy.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ metadata:
2020
name: ${FDB_RESTORE_NAME}
2121
namespace: ${NAMESPACE}
2222
spec:
23+
version: v7.3
2324
cluster:
24-
version: "7.3.63"
2525
processCounts:
2626
storage: 1
2727
stateless: -1

‎hack/e2e-chainsaw/foundationdb/foundationdb.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ kind: FoundationDB
33
metadata:
44
name: test
55
spec:
6+
version: v7.3
67
cluster:
7-
version: "7.3.63"
88
processCounts:
99
storage: 3
1010
stateless: -1

0 commit comments

Comments
 (0)