Skip to content

CNTRLPLANE-2012: Wire signer certs to read PKI config via SignerKeyParams#10595

Open
hasbro17 wants to merge 3 commits into
openshift:mainfrom
hasbro17:pki-3-signer-wiring
Open

CNTRLPLANE-2012: Wire signer certs to read PKI config via SignerKeyParams#10595
hasbro17 wants to merge 3 commits into
openshift:mainfrom
hasbro17:pki-3-signer-wiring

Conversation

@hasbro17
Copy link
Copy Markdown
Contributor

@hasbro17 hasbro17 commented Jun 3, 2026

Summary

Part 3 of splitting #10396 into smaller PRs. Depends on #10593 and #10594.

Wires all 11 signer certificates to read PKI configuration for configurable key algorithms

Problem

The challenge is that 6 of these signers previously had zero dependencies — adding InstallConfig as a dependency
would break agent-based installer (ABI) codepaths that generate signer certs without an install-config on disk (e.g. agent create certificates used by set-node-zero.sh, node-joiner add-nodes). It would
also pull in standard InstallConfig validation, rejecting configs that are valid under the agent flow's more lenient OptionalInstallConfig rules (e.g. vSphere without credentials).

Solution

To solve this, we introduce SignerKeyParams — a WritableAsset with zero dependencies that reads install-config.yaml directly from disk, extracts only the PKI and FeatureSet fields, and resolves the
effective PKI config via EffectiveSignerPKIConfig(). When no install-config is found, Load() returns (false, nil) so the asset store falls back to the state file between multi-step invocations (e.g.
create manifests followed by create cluster, where install-config.yaml is consumed after the first step). In the agent flow where neither file nor state exists, Generate() leaves PKIConfig nil
(RSA-2048).

6 previously zero-dep signers — now depend on SignerKeyParams:

  • AdminKubeConfigSignerCertKey
  • KubeAPIServerLocalhostSignerCertKey
  • KubeAPIServerLBSignerCertKey
  • RootCA
  • KubeletBootstrapCertSigner

5 signers that already depended on InstallConfig — now use EffectiveSignerPKIConfig() to resolve the effective PKI config including feature gate defaults:

  • KubeAPIServerToKubeletSignerCertKey
  • AggregatorCA
  • AggregatorSignerCertKey
  • KubeControlPlaneSignerCertKey
  • KubeletCSRSignerCertKey

With TechPreview enabled and no explicit pki config, all signer certs are generated with RSA-4096 (the current DefaultPKIProfile default). Without TechPreview, all certs remain RSA-2048.

PR chain

  1. CNTRLPLANE-2012: Add PKI config types, validation, and CR manifest generation #10593 — PKI types, validation, CRD, feature gate, PKI CR manifest
  2. CNTRLPLANE-2012: Refactor TLS cert generation to support configurable key algorithms #10594 — TLS engine refactoring
  3. This PR — Wire signer certs + SignerKeyParams
  4. Documentation

Summary by CodeRabbit

  • New Features

    • Installer supports configurable PKI in install-config: choose RSA or ECDSA signer keys (key sizes/curves) and emits a PKI configuration manifest when enabled.
    • TLS/key generation and signer assets now honor configured PKI defaults.
  • Improvements

    • Generalized private-key/certificate handling to support RSA and ECDSA and improved PEM/error handling.
  • Tests

    • Added extensive tests for PKI defaults, validation, key generation, and certificate signing.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jun 3, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

openshift-ci-robot commented Jun 3, 2026

@hasbro17: This pull request references CNTRLPLANE-2012 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target either version "5.0." or "openshift-5.0.", but it targets "openshift-4.22" instead.

Details

In response to this:

Summary

Part 3 of splitting #10396 into smaller PRs. Depends on #10593 and #10594.

Wires all 11 signer certificates to read PKI configuration for configurable key algorithms

Problem

The challenge is that 6 of these signers previously had zero dependencies — adding InstallConfig as a dependency
would break agent-based installer (ABI) codepaths that generate signer certs without an install-config on disk (e.g. agent create certificates used by set-node-zero.sh, node-joiner add-nodes). It would
also pull in standard InstallConfig validation, rejecting configs that are valid under the agent flow's more lenient OptionalInstallConfig rules (e.g. vSphere without credentials).

Solution

To solve this, we introduce SignerKeyParams — a WritableAsset with zero dependencies that reads install-config.yaml directly from disk, extracts only the PKI and FeatureSet fields, and resolves the
effective PKI config via EffectiveSignerPKIConfig(). When no install-config is present, it defaults to nil (RSA-2048).

6 previously zero-dep signers — now depend on SignerKeyParams:

  • AdminKubeConfigSignerCertKey
  • KubeAPIServerLocalhostSignerCertKey
  • KubeAPIServerLBSignerCertKey
  • RootCA
  • KubeletBootstrapCertSigner

5 signers that already depended on InstallConfig — now use EffectiveSignerPKIConfig() to resolve the effective PKI config including feature gate defaults:

  • KubeAPIServerToKubeletSignerCertKey
  • AggregatorCA
  • AggregatorSignerCertKey
  • KubeControlPlaneSignerCertKey
  • KubeletCSRSignerCertKey

With TechPreview enabled and no explicit pki config, all signer certs are generated with RSA-4096 (the current DefaultPKIProfile default). Without TechPreview, all certs remain RSA-2048.

PR chain

  1. CNTRLPLANE-2012: Add PKI config types, validation, and CR manifest generation #10593 — PKI types, validation, CRD, feature gate, PKI CR manifest
  2. CNTRLPLANE-2012: Refactor TLS cert generation to support configurable key algorithms #10594 — TLS engine refactoring
  3. This PR — Wire signer certs + SignerKeyParams
  4. Documentation

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci Bot requested review from bfournie and eranco74 June 3, 2026 20:12
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Jun 3, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign jhixson74 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 3, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 890d7362-5bc4-47d0-83b9-59dfd353e593

📥 Commits

Reviewing files that changed from the base of the PR and between 2ab8c63 and 0a3fbe6.

⛔ Files ignored due to path filters (1)
  • pkg/types/zz_generated.deepcopy.go is excluded by !**/zz_generated*
📒 Files selected for processing (39)
  • data/data/install.openshift.io_installconfigs.yaml
  • pkg/asset/ignition/machine/arbiter_ignition_customizations_test.go
  • pkg/asset/ignition/machine/arbiter_test.go
  • pkg/asset/ignition/machine/master_ignition_customizations_test.go
  • pkg/asset/ignition/machine/master_test.go
  • pkg/asset/ignition/machine/worker_ignition_customizations_test.go
  • pkg/asset/ignition/machine/worker_test.go
  • pkg/asset/imagebased/configimage/ingressoperatorsigner.go
  • pkg/asset/manifests/operators.go
  • pkg/asset/manifests/pki.go
  • pkg/asset/manifests/pki_test.go
  • pkg/asset/tls/adminkubeconfig.go
  • pkg/asset/tls/aggregator.go
  • pkg/asset/tls/apiserver.go
  • pkg/asset/tls/boundsasigningkey.go
  • pkg/asset/tls/certkey.go
  • pkg/asset/tls/certkey_test.go
  • pkg/asset/tls/ironictls.go
  • pkg/asset/tls/keypair.go
  • pkg/asset/tls/kubecontrolplane.go
  • pkg/asset/tls/kubelet.go
  • pkg/asset/tls/root.go
  • pkg/asset/tls/signerkey_params.go
  • pkg/asset/tls/tls.go
  • pkg/asset/tls/tls_test.go
  • pkg/asset/tls/utils.go
  • pkg/asset/tls/utils_test.go
  • pkg/explain/printer_test.go
  • pkg/types/defaults/installconfig.go
  • pkg/types/installconfig.go
  • pkg/types/pki/conversion.go
  • pkg/types/pki/defaults.go
  • pkg/types/pki/defaults_test.go
  • pkg/types/pki/validation.go
  • pkg/types/pki/validation_test.go
  • pkg/types/validation/featuregate_test.go
  • pkg/types/validation/featuregates.go
  • pkg/types/validation/installconfig.go
  • pkg/types/validation/installconfig_test.go
✅ Files skipped from review due to trivial changes (3)
  • pkg/asset/ignition/machine/arbiter_test.go
  • pkg/asset/ignition/machine/arbiter_ignition_customizations_test.go
  • pkg/types/defaults/installconfig.go
🚧 Files skipped from review as they are similar to previous changes (30)
  • pkg/types/validation/featuregates.go
  • pkg/asset/tls/ironictls.go
  • pkg/asset/ignition/machine/worker_test.go
  • pkg/types/validation/installconfig.go
  • pkg/asset/ignition/machine/master_ignition_customizations_test.go
  • pkg/types/validation/featuregate_test.go
  • pkg/asset/imagebased/configimage/ingressoperatorsigner.go
  • pkg/types/validation/installconfig_test.go
  • pkg/asset/tls/kubecontrolplane.go
  • pkg/types/pki/conversion.go
  • pkg/asset/tls/aggregator.go
  • pkg/asset/manifests/pki.go
  • pkg/asset/tls/boundsasigningkey.go
  • pkg/asset/tls/kubelet.go
  • pkg/asset/tls/signerkey_params.go
  • pkg/asset/tls/adminkubeconfig.go
  • pkg/types/pki/defaults_test.go
  • pkg/asset/tls/certkey_test.go
  • pkg/asset/tls/root.go
  • pkg/types/pki/defaults.go
  • pkg/asset/tls/utils_test.go
  • pkg/asset/tls/apiserver.go
  • pkg/types/installconfig.go
  • pkg/asset/tls/certkey.go
  • pkg/asset/manifests/pki_test.go
  • pkg/types/pki/validation_test.go
  • pkg/types/pki/validation.go
  • pkg/asset/tls/keypair.go
  • pkg/asset/tls/utils.go
  • pkg/asset/tls/tls.go

Walkthrough

This PR implements configurable PKI support in the OpenShift installer, enabling users to specify RSA or ECDSA key parameters for signer certificates. The change extends the CRD schema, introduces type-safe configuration structures, generalizes TLS cryptographic infrastructure to support multiple key algorithms, integrates PKI configuration through the asset system, and generates PKI cluster resource manifests.

Changes

Configurable PKI Feature Implementation

Layer / File(s) Summary
CRD Schema and PKI Configuration Types
data/data/install.openshift.io_installconfigs.yaml, pkg/types/installconfig.go
Adds spec.pki block to CRD with signerCertificates.key supporting RSA/ECDSA algorithm selection. Introduces PKIConfig, CertificateConfig, KeyConfig (with algorithm discriminator), RSAKeyConfig/ECDSAKeyConfig, and KeyAlgorithm/ECDSACurve enums to InstallConfig type.
PKI Defaults and Manifest Conversion
pkg/types/pki/defaults.go, pkg/types/pki/conversion.go, pkg/asset/manifests/pki.go, pkg/asset/manifests/pki_test.go, pkg/asset/manifests/operators.go
Adds DefaultPKIProfile() and EffectiveSignerPKIConfig(), a conversion helper for certificate config, and a PKIConfiguration asset that emits cluster-pki-02-config.yaml when the ConfigurablePKI feature is enabled; tests validate generated CR content.
PKI Validation and Feature-Gate Wiring
pkg/types/pki/validation.go, pkg/types/pki/validation_test.go, pkg/types/validation/featuregates.go, pkg/types/validation/installconfig.go, pkg/types/validation/installconfig_test.go, pkg/types/validation/featuregate_test.go
Implements ValidatePKIConfig and ValidateKeyConfig (RSA key-size and ECDSA curve checks), integrates ConfigurablePKI feature-gate validation, and adds unit tests covering valid/invalid configurations and feature-gate scenarios.
Generalized Cryptographic Key Generation & Utilities
pkg/asset/tls/tls.go, pkg/asset/tls/tls_test.go, pkg/asset/tls/utils.go, pkg/asset/tls/utils_test.go
Introduces PrivateKeyParams, PKIConfigToKeyParams(), GeneratePrivateKeyWithParams() with RSA/ECDSA implementations, generalizes PEM/parse utilities to support multiple key types, updates certificate-generation signatures to accept crypto.Signer/crypto.PrivateKey, and adds tests for key generation, usages, and signature algorithm selection.
SignerKeyParams Asset
pkg/asset/tls/signerkey_params.go
Implements SignerKeyParams asset that reads install-config.yaml (via Load) and resolves the effective signer PKIConfig for downstream certificate assets.
Certificate Asset Updates & Error Handling
pkg/asset/tls/certkey.go, pkg/asset/tls/certkey_test.go, pkg/asset/tls/root.go, pkg/asset/tls/adminkubeconfig.go, pkg/asset/tls/aggregator.go, pkg/asset/tls/apiserver.go, pkg/asset/tls/kubecontrolplane.go, pkg/asset/tls/kubelet.go, pkg/asset/tls/keypair.go, pkg/asset/tls/boundsasigningkey.go
Updates signer/RootCA assets to depend on SignerKeyParams, passes resolved PKIConfig into SelfSignedCertKey.Generate(), removes hardcoded KeyUsages (derived from algorithm), hardens private-key parsing/PEM encoding error handling, and adds tests for cross-algorithm signing.
Asset & Test Integration Updates
pkg/asset/manifests/*, pkg/asset/ignition/machine/*, pkg/asset/imagebased/configimage/ingressoperatorsigner.go
Wires PKIConfiguration into manifests generation, updates ignition/machine tests to pass SignerKeyParams parents to RootCA.Generate(), and adapts image-based ingress operator signer PEM handling to the new PEM utility error-returning API.
Schema Documentation
pkg/explain/printer_test.go
Updates expected schema output to include the new pki <object> field documented as feature-gated by ConfigurablePKI.

🎯 5 (Critical) | ⏱️ ~120 minutes

🚥 Pre-merge checks | ✅ 14 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 56.86% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (14 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly references the JIRA ticket and clearly describes the main change: wiring signer certificates to read PKI configuration via a new SignerKeyParams asset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed All test names use stable, deterministic naming. Tests use standard Go func Test conventions with static case names; no Ginkgo dynamic patterns found.
Test Structure And Quality ✅ Passed PR contains no Ginkgo test code; all tests use standard Go testing framework with testify assertions, so the Ginkgo test quality check is not applicable.
Microshift Test Compatibility ✅ Passed No Ginkgo e2e tests added. All new tests are standard Go unit tests using testing.T pattern. Check not applicable.
Single Node Openshift (Sno) Test Compatibility ✅ Passed No Ginkgo e2e tests are present in this PR. All new test code uses standard Go testing.T unit tests; the custom check applies only when Ginkgo e2e tests are added.
Topology-Aware Scheduling Compatibility ✅ Passed PR adds PKI config CR (cluster-level config), certificate logic, and types—no deployment manifests, pod specs, affinity rules, or topology constraints that assume HA.
Ote Binary Stdout Contract ✅ Passed No stdout violations found. PR modifies TLS assets and PKI types with no logging to stdout in process-level code (main, init, TestMain, BeforeSuite, etc.).
Ipv6 And Disconnected Network Test Compatibility ✅ Passed No Ginkgo e2e tests are added in this PR. All test additions are standard Go unit tests using the testing package pattern, which do not have IPv4 assumptions or external connectivity requirements.
No-Weak-Crypto ✅ Passed PR uses strong crypto: RSA (2048-8192-bit), ECDSA (P256/P384/P521), crypto/rand generation. SHA-1 only for SubjectKeyId (RFC-compliant). No weak algorithms, custom crypto, or timing attacks found.
Container-Privileges ✅ Passed PR introduces no K8s container manifests with privilege-escalating settings. Changes are PKI/TLS asset generation code and type definitions only.
No-Sensitive-Data-In-Logs ✅ Passed All logging in modified files uses generic error messages; no sensitive data like keys, certificates, tokens, or PII is logged. SignerKeyParams has no logging per PR summary.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.12.2)

Error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions
The command is terminated due to an error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions


Comment @coderabbitai help to get the list of available commands and usage tips.

@hasbro17
Copy link
Copy Markdown
Contributor Author

hasbro17 commented Jun 3, 2026

/hold

Blocked by #10593 and #10594

Also need to retest and check the ABI codepaths for the SignerKeyParams dependency (Integration tests should show that) and see if the new signers generate correctly.

@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 3, 2026
@hasbro17
Copy link
Copy Markdown
Contributor Author

hasbro17 commented Jun 3, 2026

/test e2e-aws-ovn-pki-default-techpreview
/test e2e-aws-ovn-pki-rsa-techpreview

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pkg/types/pki/defaults.go`:
- Around line 36-53: EffectiveSignerPKIConfig currently returns ic.PKI before
checking the ConfigurablePKI feature gate, allowing user PKI to be honored even
when the gate is off; change the logic in EffectiveSignerPKIConfig so it first
checks ic.Enabled(features.FeatureGateConfigurablePKI) and if the gate is
disabled return nil, and only when the gate is enabled honor ic.PKI (return it)
or fall back to the default SignerCertificates config; update references in
EffectiveSignerPKIConfig to enforce the gate-first behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: b8a25289-d43e-4637-8509-4498d6ba55cf

📥 Commits

Reviewing files that changed from the base of the PR and between d3fba60 and 0e262ca.

⛔ Files ignored due to path filters (1)
  • pkg/types/zz_generated.deepcopy.go is excluded by !**/zz_generated*
📒 Files selected for processing (39)
  • data/data/install.openshift.io_installconfigs.yaml
  • pkg/asset/ignition/machine/arbiter_ignition_customizations_test.go
  • pkg/asset/ignition/machine/arbiter_test.go
  • pkg/asset/ignition/machine/master_ignition_customizations_test.go
  • pkg/asset/ignition/machine/master_test.go
  • pkg/asset/ignition/machine/worker_ignition_customizations_test.go
  • pkg/asset/ignition/machine/worker_test.go
  • pkg/asset/imagebased/configimage/ingressoperatorsigner.go
  • pkg/asset/manifests/operators.go
  • pkg/asset/manifests/pki.go
  • pkg/asset/manifests/pki_test.go
  • pkg/asset/tls/adminkubeconfig.go
  • pkg/asset/tls/aggregator.go
  • pkg/asset/tls/apiserver.go
  • pkg/asset/tls/boundsasigningkey.go
  • pkg/asset/tls/certkey.go
  • pkg/asset/tls/certkey_test.go
  • pkg/asset/tls/ironictls.go
  • pkg/asset/tls/keypair.go
  • pkg/asset/tls/kubecontrolplane.go
  • pkg/asset/tls/kubelet.go
  • pkg/asset/tls/root.go
  • pkg/asset/tls/signerkey_params.go
  • pkg/asset/tls/tls.go
  • pkg/asset/tls/tls_test.go
  • pkg/asset/tls/utils.go
  • pkg/asset/tls/utils_test.go
  • pkg/explain/printer_test.go
  • pkg/types/defaults/installconfig.go
  • pkg/types/installconfig.go
  • pkg/types/pki/conversion.go
  • pkg/types/pki/defaults.go
  • pkg/types/pki/defaults_test.go
  • pkg/types/pki/validation.go
  • pkg/types/pki/validation_test.go
  • pkg/types/validation/featuregate_test.go
  • pkg/types/validation/featuregates.go
  • pkg/types/validation/installconfig.go
  • pkg/types/validation/installconfig_test.go

Comment thread pkg/types/pki/defaults.go
Comment on lines +36 to +53
func EffectiveSignerPKIConfig(ic *types.InstallConfig) *types.PKIConfig {
if ic.PKI != nil {
return ic.PKI
}

if ic.Enabled(features.FeatureGateConfigurablePKI) {
// Default signer config matches DefaultPKIProfile().SignerCertificates
return &types.PKIConfig{
SignerCertificates: types.CertificateConfig{
Key: types.KeyConfig{
Algorithm: types.KeyAlgorithmRSA,
RSA: types.RSAKeyConfig{KeySize: 4096},
},
},
}
}

return nil
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Honor ConfigurablePKI before applying user PKI config.

Line 37 returns ic.PKI even when the feature gate is off. pkg/asset/tls/signerkey_params.go:64-81 calls this helper on a raw install-config.yaml without running install-config validation, so zero-dependency signer assets can still generate custom signer keys from a gated field. Return nil when ConfigurablePKI is disabled and only honor ic.PKI once the gate is enabled.

Suggested fix
 func EffectiveSignerPKIConfig(ic *types.InstallConfig) *types.PKIConfig {
-	if ic.PKI != nil {
-		return ic.PKI
-	}
-
-	if ic.Enabled(features.FeatureGateConfigurablePKI) {
-		// Default signer config matches DefaultPKIProfile().SignerCertificates
-		return &types.PKIConfig{
-			SignerCertificates: types.CertificateConfig{
-				Key: types.KeyConfig{
-					Algorithm: types.KeyAlgorithmRSA,
-					RSA:       types.RSAKeyConfig{KeySize: 4096},
-				},
-			},
-		}
-	}
-
-	return nil
+	if ic == nil || !ic.Enabled(features.FeatureGateConfigurablePKI) {
+		return nil
+	}
+
+	if ic.PKI != nil {
+		return ic.PKI
+	}
+
+	// Default signer config matches DefaultPKIProfile().SignerCertificates
+	return &types.PKIConfig{
+		SignerCertificates: types.CertificateConfig{
+			Key: types.KeyConfig{
+				Algorithm: types.KeyAlgorithmRSA,
+				RSA:       types.RSAKeyConfig{KeySize: 4096},
+			},
+		},
+	}
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
func EffectiveSignerPKIConfig(ic *types.InstallConfig) *types.PKIConfig {
if ic.PKI != nil {
return ic.PKI
}
if ic.Enabled(features.FeatureGateConfigurablePKI) {
// Default signer config matches DefaultPKIProfile().SignerCertificates
return &types.PKIConfig{
SignerCertificates: types.CertificateConfig{
Key: types.KeyConfig{
Algorithm: types.KeyAlgorithmRSA,
RSA: types.RSAKeyConfig{KeySize: 4096},
},
},
}
}
return nil
func EffectiveSignerPKIConfig(ic *types.InstallConfig) *types.PKIConfig {
if ic == nil || !ic.Enabled(features.FeatureGateConfigurablePKI) {
return nil
}
if ic.PKI != nil {
return ic.PKI
}
// Default signer config matches DefaultPKIProfile().SignerCertificates
return &types.PKIConfig{
SignerCertificates: types.CertificateConfig{
Key: types.KeyConfig{
Algorithm: types.KeyAlgorithmRSA,
RSA: types.RSAKeyConfig{KeySize: 4096},
},
},
}
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/types/pki/defaults.go` around lines 36 - 53, EffectiveSignerPKIConfig
currently returns ic.PKI before checking the ConfigurablePKI feature gate,
allowing user PKI to be honored even when the gate is off; change the logic in
EffectiveSignerPKIConfig so it first checks
ic.Enabled(features.FeatureGateConfigurablePKI) and if the gate is disabled
return nil, and only when the gate is enabled honor ic.PKI (return it) or fall
back to the default SignerCertificates config; update references in
EffectiveSignerPKIConfig to enforce the gate-first behavior.

@hasbro17 hasbro17 force-pushed the pki-3-signer-wiring branch from 0e262ca to 2ab8c63 Compare June 3, 2026 22:45
@hasbro17
Copy link
Copy Markdown
Contributor Author

hasbro17 commented Jun 3, 2026

/test e2e-aws-ovn-pki-default-techpreview
/test e2e-aws-ovn-pki-rsa-techpreview

@hasbro17
Copy link
Copy Markdown
Contributor Author

hasbro17 commented Jun 4, 2026

Okay the e2e tests pass now:
https://prow.ci.openshift.org/view/gs/test-platform-results/pr-logs/pull/openshift_installer/10595/pull-ci-openshift-installer-main-e2e-aws-ovn-pki-rsa-techpreview/2062305090953285632

So the SignerKeyParams helps walk the line between IPI and ABI for those signers.

hasbro17 added 3 commits June 4, 2026 12:46
Add the configurable PKI API surface to InstallConfig behind the
ConfigurablePKI feature gate. When the gate is active, the installer
generates a config.openshift.io/v1alpha1 PKI custom resource manifest
that day-2 operators use for certificate rotation parameters.

The default PKI profile uses RSA-4096 until all day-2 operators (CKAO,
CKMO, etc.) support ECDSA rotation. When pki is not specified in
install-config the PKI CR uses mode: Default. When pki is specified the
PKI CR uses mode: Custom with DefaultPKIProfile as the base and user
signerCertificates overrides layered on top.

No certificate generation changes are included — all certs remain
RSA-2048. Non-TechPreview clusters are completely unaffected.

Assisted-by: Claude Code (Opus 4.6)
Refactor pkg/asset/tls/ to support generating signer certificates with
configurable key algorithms (RSA or ECDSA). PrivateKeyToPem now returns
([]byte, error) instead of calling logrus.Fatalf, and
GenerateSelfSignedCertificate accepts PrivateKeyParams to control key
generation. KeyUsage flags are set based on the algorithm since ECDSA
keys cannot perform key encipherment.

All signer certs pass nil for pkiConfig in this commit, preserving
the existing RSA-2048 behavior. Wiring signers to read PKI config
is deferred to a follow-up to avoid breaking codepaths that generate
signer certs without an install-config on disk (e.g. agent create
certificates, node-joiner add-nodes).

Assisted-by: Claude Code (Opus 4.6)
Introduce SignerKeyParams, a WritableAsset with zero dependencies that
reads install-config.yaml directly from disk and extracts the effective
PKI configuration via EffectiveSignerPKIConfig(). When no install-config
is present, Load() returns (false, nil) so the asset store falls back to
the state file between multi-step invocations (e.g. create manifests
followed by create cluster, where install-config.yaml is consumed after
the first step). In the agent flow where neither file nor state exists,
Generate() leaves PKIConfig nil (RSA-2048).

Signers that previously had zero dependencies now depend on
SignerKeyParams instead of InstallConfig, avoiding validation that
would reject configs valid in the agent flow. Signers that already
depended on InstallConfig use EffectiveSignerPKIConfig() to resolve
the effective PKI config including feature gate defaults.

With TechPreview enabled and no explicit pki config, all signer certs
are generated with RSA-4096 (the current DefaultPKIProfile default).

Assisted-by: Claude Code (Opus 4.6)
@hasbro17 hasbro17 force-pushed the pki-3-signer-wiring branch from 2ab8c63 to 0a3fbe6 Compare June 4, 2026 19:59
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Jun 5, 2026

@hasbro17: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-aws-ovn-pki-default-techpreview 2ab8c63 link false /test e2e-aws-ovn-pki-default-techpreview
ci/prow/e2e-metal-ovn-two-node-fencing 0a3fbe6 link false /test e2e-metal-ovn-two-node-fencing
ci/prow/e2e-metal-single-node-live-iso 0a3fbe6 link false /test e2e-metal-single-node-live-iso

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants