CNTRLPLANE-2247:Add kms-plugin ci job#73750
CNTRLPLANE-2247:Add kms-plugin ci job#73750openshift-merge-bot[bot] merged 2 commits intoopenshift:masterfrom
Conversation
|
Skipping CI for Draft Pull Request. |
|
/retest |
|
@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. DetailsIn response to this:
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. |
|
/pj-rehearse |
|
@gangwgr: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel. |
ardaguclu
left a comment
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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` |
There was a problem hiding this comment.
| 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" |
There was a problem hiding this comment.
| "type": "aescbc" | |
| "type": "KMS" |
| name: cluster | ||
| spec: | ||
| encryption: | ||
| type: aescbc |
There was a problem hiding this comment.
| type: aescbc | |
| type: KMS |
| encryption: | ||
| type: aescbc | ||
| --- | ||
| apiVersion: v1 |
| echo " ✓ Socket verified" | ||
| else | ||
| echo " ERROR: Socket not found at ${KMS_SOCKET}" | ||
| oc exec -n "${KMS_NAMESPACE}" "${POD}" -- ls -la /var/run/kmsplugin/ || true |
|
|
||
| # Validate and set KMS_VERSION | ||
| KMS_VERSION="${KMS_VERSION:-v2}" | ||
| if [[ "${KMS_VERSION}" != "v1" && "${KMS_VERSION}" != "v2" ]]; then |
| echo "Deploying mock KMS ${KMS_VERSION} plugin DaemonSet" | ||
| echo "=========================================" | ||
|
|
||
| SOCKET_PATH="/var/run/kmsplugin/socket.sock" |
There was a problem hiding this comment.
| 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" |
There was a problem hiding this comment.
Namespace should be privileged to access host file
| steps: | ||
| cluster_profile: aws | ||
| env: | ||
| TEST_SUITE: openshift/cluster-kube-apiserver-operator/encryption/kms |
There was a problem hiding this comment.
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.
49a585d to
8aae987
Compare
|
/pj-rehearse |
|
@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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
|
|
||
| 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") |
| cpu: 100m | ||
| timeout: 4h0m0s | ||
| workflow: ipi-gcp | ||
| - always_run: false |
There was a problem hiding this comment.
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.
|
/pj-rehearse |
|
@gangwgr: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel. |
073f54a to
c11c6f2
Compare
| timeout: 4h0m0s | ||
| workflow: ipi-gcp | ||
| - always_run: false | ||
| as: e2e-aws-operator-encryption-kms |
|
/lgtm cancel for #73750 (comment) |
|
[REHEARSALNOTIFIER]
Interacting with pj-rehearseComment: Once you are satisfied with the results of the rehearsals, comment: |
|
/retitle CNTRLPLANE-2247:Add kms-plugin ci job |
|
/pj-rehearse |
|
@p0lyn0mial: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel. |
|
/pj-rehearse pull-ci-openshift-cluster-kube-apiserver-operator-main-e2e-gcp-operator-encryption-kms |
|
@ardaguclu: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel. |
|
/pj-rehearse |
|
@p0lyn0mial: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel. |
|
/lgtm |
|
[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 DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/pj-rehearse ack |
|
@p0lyn0mial: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel. |
CNTRLPLANE-2247:Add kms-plugin ci job