Repository navigation
feat(installers): replace per-service install scripts with unified install.sh - #1871
Open
rackerchris wants to merge 20 commits into
Open
rackerchris wants to merge 20 commits into
rackerchris wants to merge 20 commits into
Conversation
Introduce bin/install.sh as the single entry point for installing any genestack service via per-service YAML configs in bin/services/: install.sh --service nova [--rotate-secrets] [--check-secrets] [--wait ...] The install pipeline (config load, air-gap service-config overrides, version/repo resolution, secret bootstrap, helm arg assembly, kustomize post-render, multi-chart and CRD-first installs, pre/post-install actions) already existed in helpers.sh behind the per-service install-*.sh wrappers; this exposes it as the unified CLI. - parse_cli: add --config/--gateway-config, applied post-install via setup-envoy-gateway.sh (replaces install-envoy-gateway.sh flag) - default GENESTACK_INSTALL_BIN to install.sh for rotation fan-out - resolve_chart_version: fall back to chart.service_name key - install.sh wires main's secret pipeline including the non-blocking default-password scan Co-Authored-By: Erebine co-engineer co-engineer <noreply@erebine.ai>
…s installer to ops-tools - helm-chart-versions.yaml: rename envoyproxy-gateway -> envoy-gateway to match the service name; add openstack-api-exporter and tempest entries so the unified version resolution covers them - resolve qonos via kustomize (not helm): keep the kustomize-based flow as ops-tools/qonos/install-qonos.sh with an ops-tool usage banner Co-Authored-By: Erebine co-engineer co-engineer <noreply@erebine.ai>
…nstall.sh Remove the 50 bin/install-*.sh bootstrap scripts. Every helm-managed service installs through: install.sh --service <name> [HELM_FLAGS...] - setup-openstack.sh, setup-infrastructure.sh, hyperconverged lab scripts, and kube-ovn-convert.sh retargeted to the unified entry point; runTrackErator now takes multi-arg commands - qonos stays kustomize-based: ops-tools/qonos/install-qonos.sh - rotation fan-out uses install.sh exclusively (no wrapper fallback) - stale install-*.sh references updated in helm overrides, ansible roles, rotate-barbican-kek.py, and docs Co-Authored-By: Erebine co-engineer co-engineer <noreply@erebine.ai>
…e release notes - Port tests/test_unified_installer.sh from the unified-install-script branch, adapted to main's evolved secret model (rackerlabs#1832): - nova-ssh replaces nova-service-keypair as the nova SSH secret - --set-file keypair handling and value_from.secret_data file path - fake kubectl stubs -o json (secret_has_keys), patch, and the bracketed jsonpath key form - rotation expectations match main's per-service owned secrets - Skip the default-password guardrail during --dry-run so the offline test path does not invoke helm show values - Add manual unified-installer-regression pre-commit hook - Rewrite the release note for reality: entry point replaces 50 scripts, secrets already k8s-managed, air-gap service-configs overrides, service-name chart version keys, qonos moved to ops-tools Co-Authored-By: Erebine co-engineer co-engineer <noreply@erebine.ai>
- Replace bin/install-<svc>.sh references with install.sh --service <svc> across current documentation; historical release notes and migration guides keep their original script names - Replace --8<-- "bin/install-<svc>.sh" snippet includes (the scripts no longer exist) with the unified command - fluentbit docs now use install.sh --service fluent-bit - magnum upgrade docs pin the chart version via helm-chart-versions.yaml instead of editing the removed script - envoy-gateway multi-gateway docs reference install.sh --config - smoke-deploy-lab workflow: add git safe.directory for the self-hosted runner so recursive submodule checkout is trusted Co-Authored-By: Erebine co-engineer co-engineer <noreply@erebine.ai>
Conflict resolutions: - Observability migration (rackerlabs#1807): upstream deleted the observability install scripts and moved installs to install-observability.sh. Kept upstream's deletions and rewritten observability docs; our unified installer keeps bin/services/*.yaml and helpers.sh support so secret management still works in-repo. Removed the prometheus install line from setup-infrastructure.sh (dropped upstream). ironic-monitoring doc now points at install-observability.sh for opentelemetry. - Blazar service-user fix (rackerlabs#1862): upstream hardened install-blazar.sh with verify_blazar_os_admin_password; ported the guard into helpers.sh, wired into install.sh as a pre-helm check for blazar (parses the tab-delimited secret arg stream plus pass-through flags, same last-wins semantics). Took upstream's blazar.yaml os_admin_password entry and the rotation-doc cleanup. - kube-ovn OCI migration (rackerlabs#1865): applied the oci://ghcr.io/kubeovn/ charts/kube-ovn source change to bin/services/kube-ovn.yaml repo_url, which the unified installer resolves via its OCI path. - fluentbit doc deleted upstream alongside install-fluentbit.sh. - Replaced the --dry-run skip of the default-password scan with the explicit GENESTACK_SKIP_DEFAULT_PASSWORD_SCAN=1 escape hatch; test suite sets the variable where it exercises install paths. Co-Authored-By: Erebine co-engineer co-engineer <noreply@erebine.ai>
Contributor
|
Welcome, new contributor! |
Contributor
Author
|
references: #1853 |
Harden how install.sh resolves chart sources, versions and values from merged service configuration, and bring Envoy Gateway back to the behavior of the old install-envoy-gateway.sh. Chart metadata resolution - load_service_config() skips family files when service.family is empty and, with --log-sources, prints the files it merged in load order. Merge order (later wins): bin/services/<family>.yaml, bin/services/<service>.yaml, /etc/genestack/service-configs/<family>.yaml, /etc/genestack/service-configs/<service>.yaml. - New resolve_service_chart() resolves chart.repo_url, repo_name and service_name from the merged config through resolve_helm_repo(): HTTP(S) uses <repo_name>/<chart>, OCI uses the complete chart path in repo_url, and an empty repo_url selects base-helm-configs/<chart>. install.sh no longer defaults to the openstack-helm repository. - resolve_helm_repo() rejects incomplete metadata and returns errors instead of exiting. helm repo add/update failures now stop the install. - Chart versions resolve before any hook or cluster change: --version, then service.version, then charts.<service> in helm-chart-versions.yaml, with chart.service_name as a fallback key. The install fails when no version resolves instead of installing the latest chart. - build_helm_args() accepts extra base values files (validated, kept in caller order, after base-helm-configs and before global overrides) and logs every values file in -f order. - helm_install_crds() resolves the CRD chart as a sibling of the operator chart (same repo, OCI registry or local directory) and installs it in the service namespace instead of kube-system. - bootstrap.sh creates /etc/genestack/service-configs. - Standalone charts (Fluent Bit, Kube-OVN, Longhorn, MetalLB, Postgres Operator, Pushgateway, Redis Sentinel, Envoy Gateway) set family: "". Kube-OVN now installs in kube-system, and Postgres Operator uses the Zalando chart repository the old installer used. - ensureYq, ensureHelm and ensureCmctl honor YQ_VERSION, HELM_VERSION and CMCTL_VERSION and reinstall when the installed version differs. Envoy Gateway - The service is envoyproxy-gateway again: bin/services/envoyproxy-gateway.yaml, helm-chart-versions key envoyproxy-gateway, and install.sh --service envoyproxy-gateway in setup-infrastructure.sh and the docs. The Helm release name and values directory (base-helm-configs/envoyproxy-gateway) match the old installer. - install.sh --config uses kustomize.gateway_config_overlay_path (envoyproxy-gateway/config-mode), which leaves out the legacy flex-gateway. A missing overlay is linked from base-kustomize, or the install stops before Helm runs. - After a successful Helm install, --config waits up to 5 minutes for deployments.apps/envoy-gateway before running setup-envoy-gateway.sh. If the wait fails the config is not applied and install.sh exits non-zero. Tests - Cover overlay selection, overlay linking, the end-to-end --config flow (overlay, wait before setup, failed wait, no --config) and a guard that every install.sh --service reference has a service file and Envoy resolves its release, values directory and version. - Fix test_manifest_invariants on yq >= 4.52. The owner list relied on yq expanding "\t", which older yq left literal, so the fan-out, duplicate-owner and shared-secret checks never ran there. Use a "|" separator, and match consumers with grep -Fx instead of a space-delimited pattern against a newline-separated list. Upgrade notes (operator action may be required) 1. Move chart.repo_url, repo_name and service_name from /etc/genestack/helm-configs/<service>/*.yaml to /etc/genestack/service-configs/<service>.yaml. Files in service-configs are never passed to Helm as values. 2. OCI chart.repo_url must be the complete chart path, for example oci://registry.example.com/charts/cert-manager. 3. A missing chart version is now an error. Add entries for fluent-bit and qonos if you install them through install.sh, or set service.version. 4. Existing /etc/genestack/helm-chart-versions.yaml files are kept by bootstrap. Add openstack-api-exporter and tempest entries there. Signed-off-by: Vishal Kapoor <vishal.kapoor@rackspace.com>
- Add installEgctl/ensureEgctl to scripts/lib/functions.sh and call ensureEgctl from bootstrap.sh, restoring the egctl install that install-envoy-gateway.sh used to do. - Set helm_enabled: false in the Kubespray inventory so Kubespray's older Helm (3.18.4) no longer overwrites the one installed by bootstrap.sh, which broke `helm repo update --timeout` in the smoke lab. Signed-off-by: Vishal Kapoor <vishal.kapoor@rackspace.com>
…aller-script # Conflicts: # docs/monitoring-getting-started.md
…urces Align bin/services defaults with the chart sources the old installers used, so install.sh resolves the same charts. - cert-manager: install from the OCI registry, oci://quay.io/jetstack/charts/cert-manager, instead of the https://charts.jetstack.io Helm repository, as install-cert-manager.sh did. - kube-prometheus-stack: use the prometheus-community repo alias, as the observability installer does, so the chart resolves as prometheus-community/kube-prometheus-stack. Signed-off-by: Vishal Kapoor <vishal.kapoor@rackspace.com>
The unified installer dropped the Kube-OVN SSL handling that install-neutron.sh and install-octavia.sh had. With Kube-OVN's ENABLE_SSL=true, Neutron was given ssl: OVN connections but no client certificates, so its API never became ready in the smoke lab. - Add an ovn_tls_values pre_install_check action. After detect_kube_ovn_tls, when CONNECTION_STRING is ssl, it adds ssl/<service>-ovn-tls-overrides.yaml from the chart's base directory to the Helm -f list, after the base values and before the global and site overrides. It fails if the file is missing while SSL is on. neutron.yaml and octavia.yaml use it. - Add kustomize.post_renderer so a service can name its own Helm post-renderer, a path relative to GENESTACK_BASE_DIR. A missing, non-executable, absolute or ".." path fails the install. octavia.yaml uses base-kustomize/octavia/post-renderer.sh, as install-octavia.sh did, which adds the ovn-tls mount to the octavia-agent sidecar when SSL is on and removes the ovn-tls mounts and volume when it is off. - detect_kube_ovn_tls exports GENESTACK_KUBE_OVN_ENABLE_SSL, which that post-renderer reads, and install.sh exports GENESTACK_OVERRIDES_DIR. Signed-off-by: Vishal Kapoor <vishal.kapoor@rackspace.com>
The unified installer dropped the legacy handling of a custom cluster domain. install-mariadb-operator.sh wrote clusterName into the site values file when CLUSTER_NAME was not cluster.local, and the unified installer never did. Add a cluster_name_site_value pre-install action that records the domain in /etc/genestack/helm-configs/<chart>/<chart>-helm-overrides.yaml, under the helm_key set in the service file. - With CLUSTER_NAME unset or cluster.local, nothing is written, so a domain set by hand in a site values file is left untouched. - With a custom CLUSTER_NAME, only the helm_key is replaced. Other settings and comments in the file are kept. - An invalid CLUSTER_NAME or helm_key fails before anything is written. - Later site files and --set flags still take precedence. Enable it for mariadb-operator (clusterName) and redis-operator (redisOperator.serviceDNSDomain). redis-replication and redis-sentinel have no cluster-domain value. Update the mariadb and redis docs to use --set for a custom domain, and document the action in example-service.yaml and the release note. Add regression tests, including one that checks an existing site file stays byte-identical when CLUSTER_NAME is unset. Signed-off-by: Vishal Kapoor <vishal.kapoor@rackspace.com>
install.sh ignored the result of pre_install_actions and pre_install_check_actions, so a failing hook logged an error and Helm still ran. - A failing pre-install hook or check now stops install.sh before Helm and exits non-zero, with "Pre-install hook/checks for '<svc>' failed; not running Helm." - The namespace is ensured and reported before the hooks run, so hooks can create secrets in it. - Kube-OVN stops when no node has the kube-ovn/role=master label, as the old install-kube-ovn.sh did, instead of installing with replicaCount=0. To consider - This affects every service that has hooks: kube-ovn, nova, neutron, octavia, grafana, mariadb-operator and redis-operator. - grafana's hook sources monitoring-common.sh, which is not in this repo, so grafana now fails when that file is absent. Signed-off-by: Vishal Kapoor <vishal.kapoor@rackspace.com>
…te_certs The unified installer no longer pre-generated kube-system/kube-ovn-tls. The old install-kube-ovn.sh created it with DNS SANs; the chart's own certificate has CN=ovn and none. Features - New kube_ovn_tls_secret pre-install action. On a new install it creates the secret with a private CA and a 3650-day certificate for ovn, ovn-nb, ovn-sb and ovn-northd (plain and .kube-system.svc), then annotates and labels it so the chart adopts it. The DNS names, lifetime and secret name are set in kube-ovn.yaml. - regenerate_certs (default false) replaces the certificate on purpose. Set it in service-configs/kube-ovn.yaml, or for one run with KUBE_OVN_REGENERATE_CERTS=true, which wins over the file. - When the secret is kept, the installer logs the certificate's subject, validity dates, days left and DNS names. It warns when the certificate expires within 30 days or has expired. Fixes - An existing kube-ovn-tls is never changed or deleted. If kubectl cannot say whether it exists (anything other than NotFound), the install stops instead of generating over a live secret. If the new secret cannot be marked for Helm, the error prints the kubectl commands to fix it by hand. - Neutron and Octavia copy the Kube-OVN client secret to the openstack namespace only when Kube-OVN uses SSL, so tcp clusters do not get a copy of the private key. With SSL on, a missing kube-ovn-tls stops the install. Tests and docs - Tests cover the certificate contents and verification, the Helm markers, the existing-secret report, lookup failures, the regenerate switch from the file and the environment variable, namespace ordering, and every hook failure path through install.sh. - Add a note to docs/k8s-cni-kube-ovn.md, document the action in example-service.yaml, and add release notes. To consider - The tests and release notes in this commit also cover the Neutron and Octavia OVN changes in the next commit, so the suite does not pass on this commit alone. It passes once both are applied. - Existing secrets keep their certificate, including chart-generated ones without SANs. Adding SANs means regenerating, which needs an OVN and client restart. - Whether Neutron and Octavia need the SANs is unconfirmed: they connect to ssl:<cluster IP>:<port>. Signed-off-by: Vishal Kapoor <vishal.kapoor@rackspace.com>
…d octavia - Neutron again sets conf.ovn_metadata_agent.ovn.ovn_nb_connection and ovn_sb_connection, as install-neutron.sh did. They were missing from neutron.yaml, so the metadata agent did not get the cluster's OVN endpoints. - An unresolved ovn-nb or ovn-sb service now stops Neutron and Octavia instead of skipping the setting and leaving chart-default connections. - An API error reading the ovn-central deployment now stops the install instead of silently using tcp. Only "not found" still means no SSL. The tests and release notes for these changes are already in the previous commit, which fails the suite without this one. With the fake cluster in the tests, Neutron, Octavia and Nova produce the same OVN Helm arguments as their legacy installers with Kube-OVN SSL on and off. To consider - The legacy scripts read SSL from `helm get values kube-ovn`. The unified installer reads ENABLE_SSL from the ovn-central deployment. Signed-off-by: Vishal Kapoor <vishal.kapoor@rackspace.com>
…abled The unified installer no longer synced keystone-shibd-etc. The old install-keystone.sh built it from /etc/genestack/keystone-sp/shibboleth/ on every run, and the federation guide still said install.sh does this. Features - New secret_sync_directory pre-install action, configured in keystone.yaml. It syncs every file of the directory into openstack/keystone-shibd-etc on each install, using the existing secret_sync_from_directory helper. - It runs when the Keystone overlay (/etc/genestack/kustomize/keystone/overlay/kustomization.yaml) lists the federation base under resources. Otherwise it logs that and does not touch the secret. - The directory and shibboleth2.xml, sp-cert.pem, sp-key.pem and idp-metadata.xml must exist. If not, the install stops before Helm and lists the missing files. - KEYSTONE_SHIBBOLETH_DIR points it at another directory. SKIP_SHIBBOLETH_SECRET=1 or --dry-run skips the sync. Docs and tests - Fix openstack-keystone-federation.md: describe the real detection, say the required-files check applies when the overlay includes the federation base, and correct the secret name keystone-shib-etc to keystone-shibd-etc. - Document the action in example-service.yaml and add a release note. - Tests cover the action and install.sh --service keystone with and without federation, missing directory and files, the directory override, SKIP_SHIBBOLETH_SECRET and --dry-run. Five mutations of the action each make the suite fail. - The fake kubectl in the tests now prints a line on apply, as real kubectl does, because the shared secret helper returns 1 when apply prints nothing. To consider - Upgrade impact: an existing federation deployment now needs the directory and all four files on every install.sh --service keystone run, or the install stops. The legacy script did the same. A secret built by hand from a different layout needs checking first, or set SKIP_SHIBBOLETH_SECRET=1. - Federation is detected from the overlay file, not from a rendered chart as before. A federation base wired in some other way is not detected. - Without federation, behavior is unchanged apart from one info line. Signed-off-by: Vishal Kapoor <vishal.kapoor@rackspace.com>
Restore Barbican KEK and SoftHSM handling through install.sh. - Generate KEKs for new installations and adopt deployed KEKs on upgrades. - Preserve historical default KEK adoption with an operator warning. - Retain the rewrap guard and inject KEK values using --set-string. - Reuse existing HSM credentials and initialize SoftHSM after Helm succeeds. - Skip HSM initialization during dry runs. - Extract Barbican logic into bin/lib/barbican.sh, sourced through helpers.sh. - Document upgrade behavior and dry-run secret creation. - Add regression coverage for Barbican installation and upgrade paths. Inherited HSM failure-handling and values-precedence issues remain separate follow-up work. Signed-off-by: Vishal Kapoor <vishal.kapoor@rackspace.com>
Add bin/lib/*.sh to the unified-installer-regression file filter so library-only changes qualify when running the manual hook. Signed-off-by: Vishal Kapoor <vishal.kapoor@rackspace.com>
initBarbicanHSMKeys ran its kubectl steps without checking their results. When pod readiness, pod lookup, token inspection or creation, MKEK generation or HMAC generation failed, it still printed "SoftHSM2 initialization complete" and returned 0, so install.sh --service barbican exited 0 and post_install_fatal could not catch it. Fixes - Stop at the first failing step and return 1 with an error message: pod readiness, pod lookup (including an empty result), token inspection, token creation, MKEK generation, removal of a leftover AES HMAC key, and HMAC generation. - Token inspection no longer hides a failed kubectl exec behind a grep. Before, a failed exec looked like "no token" and went on to create one. - Print "initialization complete" and return 0 only after every step succeeded. Existing tokens and keys are still skipped when their checks succeed, so reruns stay idempotent. Tests and docs - Run the real initializer through install.sh --service barbican with mocked Kubernetes commands. Cover the success path, existing keys, a leftover legacy HMAC key, and a failure at each step, including a pod lookup that returns nothing. Check the order of the steps, that Helm ran first, that initialization stops at the failed step, and that a failing Helm upgrade or --dry-run skips initialization. - Update docs/openstack-barbican.md and the release note. To consider - A failure does not roll back Helm or the HSM steps that already succeeded. Rerunning the install continues from there. - Only bin/lib/barbican.sh calls the initializer, so the lab scripts are not affected. - The PIN is still passed on the kubectl exec command line, as in the legacy script. Signed-off-by: Vishal Kapoor <vishal.kapoor@rackspace.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the 50 individual bin/install-*.sh bootstrap scripts with a single unified entry point, bin/install.sh --service , driven entirely by the per-service YAML configs in bin/services/. The service YAMLs (already on main via the secret-management work in #1832) are now the single source of truth for chart selection, secret wiring, kustomize post-rendering, and Helm timeouts.
This is the mainline landing of the unified-install-script branch, re-based onto main's evolved secret engine (main's helpers.sh was verified as a strict superset: 73 shared functions identical, 0 UIS-only, 17 main-only additions), so the secret layer ships unchanged.
Changes
Unified installer (48515a8)
New bin/install.sh: --service is the only required flag; remaining --* flags pass through to helm upgrade --install. Supports --check-secrets, --rotate-secrets, --yes-i-really-want-to, and --version.
New first-class --config / --gateway-config option (envoy-gateway post-install hook, replaces the old script-specific flag).
helpers.sh: parse_cli extended, GENESTACK_INSTALL_BIN now defaults to install.sh so rotation fan-out works after the old scripts are gone.
Version keys + qonos (a39dad2)
helm-chart-versions.yaml keys aligned to service names: envoyproxy-gateway → envoy-gateway; added openstack-api-exporter and tempest entries.
resolve_chart_version falls back to chart.service_name (matches secret_schema_validator semantics).
qonos is kustomize-based, not helm: moved to ops-tools/qonos/install-qonos.sh; bin/services/qonos.yaml kept for secret bootstrapping.
Script removal (a91f075)
Deleted all 50 bin/install-*.sh (no deprecation wrappers).
Retargeted every caller: setup-openstack.sh (35 refs), setup-infrastructure.sh (12 refs, --config preserved), kube-ovn-convert.sh, hyperconverged scripts/libs, ansible roles, rotate-barbican-kek.py, rotation reinstall path simplified to install.sh-only.
Regression suite (947cb05)
tests/test_unified_installer.sh (21 test groups) covering CLI parsing, secret arg formatting, helm command construction, rotation ownership/impacts/secret shapes, check-secrets, dry-run install paths, CRD/timeout propagation, and manifest invariants across all 52 service YAMLs.
Fake kubectl/helm stubs adapted to main's secret model (nova-ssh, --set-file keypairs, value_from.secret_data).
Manual unified-installer-regression pre-commit hook; rewritten release note.
Docs + CI (af8f706)
All current docs retargeted from install-.sh to install.sh --service ; historical release notes/migration guides intentionally keep original names.
Magnum upgrade docs now pin chart versions via helm-chart-versions.yaml instead of editing the removed script.
Smoke workflow: git safe.directory fix for recursive submodule checkout on the self-hosted runner.
Breaking changes
bin/install-.sh no longer exists → use bin/install.sh --service (flags pass through).
Config-mode envoy-gateway: install-envoy-gateway.sh --config → install.sh --service envoy-gateway --config.
Rotation workflows that fanned out to per-service scripts now invoke install.sh directly.