Skip to content

CNTRLPLANE-2247:Add kms-plugin ci job#73750

Merged
openshift-merge-bot[bot] merged 2 commits intoopenshift:masterfrom
gangwgr:kms-ci
Jan 26, 2026
Merged

CNTRLPLANE-2247:Add kms-plugin ci job#73750
openshift-merge-bot[bot] merged 2 commits intoopenshift:masterfrom
gangwgr:kms-ci

Conversation

@gangwgr
Copy link
Contributor

@gangwgr gangwgr commented Jan 20, 2026

CNTRLPLANE-2247:Add kms-plugin ci job

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 20, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 20, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@gangwgr
Copy link
Contributor Author

gangwgr commented Jan 20, 2026

/retest

@gangwgr gangwgr marked this pull request as ready for review January 20, 2026 17:10
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 20, 2026
@gangwgr gangwgr changed the title Add kms-plugin installation step to be reused by apiserver [WIP]Add kms-plugin installation step to be reused by apiserver Jan 20, 2026
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 20, 2026
@openshift-ci openshift-ci bot requested review from benluddy and sanchezl January 20, 2026 17:12
@gangwgr gangwgr changed the title [WIP]Add kms-plugin installation step to be reused by apiserver [WIP]CNTRLPLANE-2247:Add kms-plugin installation step to be reused by apiserver Jan 20, 2026
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jan 20, 2026
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Jan 20, 2026

@gangwgr: This pull request references CNTRLPLANE-2247 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 the "4.22.0" version, but no target version was set.

Details

In response to this:

This PR introduces reusable step-registry components for deploying and testing KMS v1/v2 encryption in OpenShift CI jobs. The implementation uses a DaemonSet-based approach which is platform-agnostic, fast, and doesn't require node reboots.

Currently, testing KMS encryption in apiserver operators (cluster-kube-apiserver-operator, cluster-openshift-apiserver-operator, cluster-authentication-operator) requires manual plugin deployment or complex MachineConfig setups. This PR provides a simple, reusable solution that works across all platforms (AWS, GCP, Azure, bare metal).

Related Issues

Co-authored By - Claude

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.

@gangwgr
Copy link
Contributor Author

gangwgr commented Jan 21, 2026

/pj-rehearse

@openshift-ci-robot
Copy link
Contributor

@gangwgr: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel.

Copy link
Member

@ardaguclu ardaguclu left a comment

Choose a reason for hiding this comment

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

This is much nicer than mine. I dropped some comments.

### Steps

- **kms-mock-plugin-deploy**: Deploys the mock KMS plugin as a DaemonSet on control plane nodes
- Supports KMSv1 and KMSv2 via `KMS_VERSION` environment variable (default: v2)
Copy link
Member

Choose a reason for hiding this comment

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

We definitely don't need anything about KMS v1. We don't need KMS_VERSION env var.


1. **Init Container**: Builds the mock KMS plugin from kubernetes/kubernetes repo
2. **Main Container**: Runs the plugin listening on `/var/run/kmsplugin/socket.sock`
3. **HostPath Mount**: Exposes the socket to the host so kube-apiserver can access it
Copy link
Member

Choose a reason for hiding this comment

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

This will be handled by openshift/enhancements#1900 EP.

### How It Works

1. **Init Container**: Builds the mock KMS plugin from kubernetes/kubernetes repo
2. **Main Container**: Runs the plugin listening on `/var/run/kmsplugin/socket.sock`
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
2. **Main Container**: Runs the plugin listening on `/var/run/kmsplugin/socket.sock`
2. **Main Container**: Runs the plugin listening on `/var/run/kmsplugin/kms.sock`

oc patch apiserver cluster --type=merge -p '{
"spec": {
"encryption": {
"type": "aescbc"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"type": "aescbc"
"type": "KMS"

name: cluster
spec:
encryption:
type: aescbc
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
type: aescbc
type: KMS

encryption:
type: aescbc
---
apiVersion: v1
Copy link
Member

Choose a reason for hiding this comment

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

This resource is not needed

echo " ✓ Socket verified"
else
echo " ERROR: Socket not found at ${KMS_SOCKET}"
oc exec -n "${KMS_NAMESPACE}" "${POD}" -- ls -la /var/run/kmsplugin/ || true
Copy link
Member

Choose a reason for hiding this comment

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

This is redundant?


# Validate and set KMS_VERSION
KMS_VERSION="${KMS_VERSION:-v2}"
if [[ "${KMS_VERSION}" != "v1" && "${KMS_VERSION}" != "v2" ]]; then
Copy link
Member

Choose a reason for hiding this comment

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

Not needed

echo "Deploying mock KMS ${KMS_VERSION} plugin DaemonSet"
echo "========================================="

SOCKET_PATH="/var/run/kmsplugin/socket.sock"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
SOCKET_PATH="/var/run/kmsplugin/socket.sock"
SOCKET_PATH="/var/run/kmsplugin/kms.sock"


# Create namespace for KMS plugin
echo "Creating namespace ${KMS_NAMESPACE}..."
oc create namespace "${KMS_NAMESPACE}" || echo "Namespace already exists"
Copy link
Member

Choose a reason for hiding this comment

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

Namespace should be privileged to access host file

steps:
cluster_profile: aws
env:
TEST_SUITE: openshift/cluster-kube-apiserver-operator/encryption/kms
Copy link
Member

Choose a reason for hiding this comment

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

Can we update here to not test anything in order to ensure that chains successfully deploy kms-plugin. Deploying kms-plugin require many steps and it would be awesome, if we ensure that this flow simply works.

@gangwgr gangwgr force-pushed the kms-ci branch 3 times, most recently from 49a585d to 8aae987 Compare January 21, 2026 08:16
@gangwgr
Copy link
Contributor Author

gangwgr commented Jan 21, 2026

/pj-rehearse

@openshift-ci-robot
Copy link
Contributor

@gangwgr: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel.

- |
set -euxo pipefail
echo "Starting mock KMS v2 plugin..."
mkdir -p /var/run/kmsplugin
Copy link
Member

Choose a reason for hiding this comment

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

In L:130 we create this directory already, we don't need this.


# Wait for pods to be created first
echo "Waiting for pods to be created..."
for i in {1..60}; do
Copy link
Member

Choose a reason for hiding this comment

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

Wait command in L:156 already waits, we may not need this for loop?

# Create KMS configuration secret
echo "Creating KMS v2 configuration..."
cat <<EOF | oc apply -f -
apiVersion: v1
Copy link
Member

Choose a reason for hiding this comment

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

We don't need this secret. According to this EP openshift/enhancements#1900, once apiserver config is configured for KMS, controller will automatically generate encryptionconfiguration.


The step will:
1. Read the KMS socket path from SHARED_DIR
2. Generate EncryptionConfiguration for KMS v2
Copy link
Member

Choose a reason for hiding this comment

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

redundant


KMS_SOCKET=$(cat "${SHARED_DIR}/kms-plugin-socket-path")
KMS_NAMESPACE=$(cat "${SHARED_DIR}/kms-plugin-namespace")
KMS_VERSION=$(cat "${SHARED_DIR}/kms-plugin-version")
Copy link
Member

Choose a reason for hiding this comment

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

redundant

cpu: 100m
timeout: 4h0m0s
workflow: ipi-gcp
- always_run: false
Copy link
Member

Choose a reason for hiding this comment

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

If this works, that is great

Copy link
Contributor

Choose a reason for hiding this comment

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

it does, we use it for the other tests too.

the downside is that the tests are executed only when the files specified below are changed. we will change this with OTE so that we can catch potential regression.

@gangwgr
Copy link
Contributor Author

gangwgr commented Jan 21, 2026

/pj-rehearse

@openshift-ci-robot
Copy link
Contributor

@gangwgr: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel.

@gangwgr gangwgr force-pushed the kms-ci branch 2 times, most recently from 073f54a to c11c6f2 Compare January 21, 2026 13:53
@openshift-ci openshift-ci bot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jan 23, 2026
timeout: 4h0m0s
workflow: ipi-gcp
- always_run: false
as: e2e-aws-operator-encryption-kms
Copy link
Contributor

Choose a reason for hiding this comment

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

ah, this is now gcp

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@p0lyn0mial
Copy link
Contributor

/lgtm cancel

for #73750 (comment)

@openshift-ci openshift-ci bot removed lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jan 23, 2026
@openshift-ci-robot
Copy link
Contributor

[REHEARSALNOTIFIER]
@gangwgr: the pj-rehearse plugin accommodates running rehearsal tests for the changes in this PR. Expand 'Interacting with pj-rehearse' for usage details. The following rehearsable tests have been affected by this change:

Test name Repo Type Reason
pull-ci-openshift-cluster-kube-apiserver-operator-main-e2e-gcp-operator-encryption-kms openshift/cluster-kube-apiserver-operator presubmit Presubmit changed
Interacting with pj-rehearse

Comment: /pj-rehearse to run up to 5 rehearsals
Comment: /pj-rehearse skip to opt-out of rehearsals
Comment: /pj-rehearse {test-name}, with each test separated by a space, to run one or more specific rehearsals
Comment: /pj-rehearse more to run up to 10 rehearsals
Comment: /pj-rehearse max to run up to 25 rehearsals
Comment: /pj-rehearse auto-ack to run up to 5 rehearsals, and add the rehearsals-ack label on success
Comment: /pj-rehearse list to get an up-to-date list of affected jobs
Comment: /pj-rehearse abort to abort all active rehearsals
Comment: /pj-rehearse network-access-allowed to allow rehearsals of tests that have the restrict_network_access field set to false. This must be executed by an openshift org member who is not the PR author

Once you are satisfied with the results of the rehearsals, comment: /pj-rehearse ack to unblock merge. When the rehearsals-ack label is present on your PR, merge will no longer be blocked by rehearsals.
If you would like the rehearsals-ack label removed, comment: /pj-rehearse reject to re-block merging.

@p0lyn0mial
Copy link
Contributor

p0lyn0mial commented Jan 26, 2026

/retitle CNTRLPLANE-2247:Add kms-plugin ci job

@openshift-ci openshift-ci bot changed the title [WIP]CNTRLPLANE-2247:Add kms-plugin ci job CNTRLPLANE-2247:Add kms-plugin ci job Jan 26, 2026
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 26, 2026
@p0lyn0mial
Copy link
Contributor

/pj-rehearse

@openshift-ci-robot
Copy link
Contributor

@p0lyn0mial: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel.

@ardaguclu
Copy link
Member

/pj-rehearse pull-ci-openshift-cluster-kube-apiserver-operator-main-e2e-gcp-operator-encryption-kms

@openshift-ci-robot
Copy link
Contributor

@ardaguclu: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel.

@p0lyn0mial
Copy link
Contributor

/pj-rehearse

@openshift-ci-robot
Copy link
Contributor

@p0lyn0mial: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel.

@p0lyn0mial
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jan 26, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 26, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gangwgr, p0lyn0mial

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

The pull request process is described 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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 26, 2026
@p0lyn0mial
Copy link
Contributor

/pj-rehearse ack

@openshift-ci-robot
Copy link
Contributor

@p0lyn0mial: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel.

@openshift-ci-robot openshift-ci-robot added the rehearsals-ack Signifies that rehearsal jobs have been acknowledged label Jan 26, 2026
@openshift-merge-bot openshift-merge-bot bot merged commit cbebae6 into openshift:master Jan 26, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. rehearsals-ack Signifies that rehearsal jobs have been acknowledged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants