Skip to content

Harden bedrock migration Job for Kyverno#2782

Merged
Daniel-Fan merged 9 commits intoIBM:masterfrom
YCShen1010:kyverno
Mar 26, 2026
Merged

Harden bedrock migration Job for Kyverno#2782
Daniel-Fan merged 9 commits intoIBM:masterfrom
YCShen1010:kyverno

Conversation

@YCShen1010
Copy link
Copy Markdown
Contributor

What this PR does / why we need it:
Make the bedrock migration Job Kyverno-compliant by adding resource requests/limits, supporting pinned image references, and hardening container/pod security while providing a writable tmp volume.

Which issue(s) this PR fixes:
Fixes # https://github.ibm.com/IBMPrivateCloud/roadmap/issues/68808/#issuecomment-181904012

Changes: :

  • Added resources.requests and resources.limits
  • Replaced fixed image with templated support for cpfs.utilsImage or tag + optional cpfs.imageDigest.
  • Added container securityContext (runAsNonRoot, allowPrivilegeEscalation: false, readOnlyRootFilesystem: true).
  • Mounted an emptyDir at tmp
  • Added pod volumes so ephemeral writes still work.

Signed-off-by: Sophie Shen <syc_libra@live.cn>
Signed-off-by: Sophie Shen <syc_libra@live.cn>
Signed-off-by: Sophie Shen <syc_libra@live.cn>
Signed-off-by: Sophie Shen <syc_libra@live.cn>
Signed-off-by: Sophie Shen <syc_libra@live.cn>
{{- if .Values.cpfs.utilsImageDigest }}
{{ .Values.cpfs.imagePullPrefix | default .Values.global.imagePullPrefix }}/{{ .Values.cpfs.imageRegistryNamespaceOperand }}/cpfs-utils@{{ .Values.cpfs.utilsImageDigest }}
{{- else }}
{{ .Values.cpfs.imagePullPrefix | default .Values.global.imagePullPrefix }}/{{ .Values.cpfs.imageRegistryNamespaceOperand }}/cpfs-utils:latest
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hold the PR for now. Will need to discuss with CICD about how image digest is delivered during the build process.

Signed-off-by: Sophie Shen <syc_libra@live.cn>
Signed-off-by: Sophie Shen <syc_libra@live.cn>
@YCShen1010
Copy link
Copy Markdown
Contributor Author

Run:

helm template test . > job.yaml
oc apply -f job.yaml

Local test result:

✗ oc apply -f job.yaml
job.batch/bedrock-migration-job unchanged
serviceaccount/bedrock-migration-job-sa unchanged
role.rbac.authorization.k8s.io/bedrock-migration-job-role-migrationjob unchanged
role.rbac.authorization.k8s.io/bedrock-migration-job-role unchanged
role.rbac.authorization.k8s.io/bedrock-migration-job-role unchanged
rolebinding.rbac.authorization.k8s.io/bedrock-migration-job-rb-migrationjob unchanged
rolebinding.rbac.authorization.k8s.io/bedrock-migration-job-rb unchanged
rolebinding.rbac.authorization.k8s.io/bedrock-migration-job-rb unchanged

pod completed
Screenshot 2026-03-26 at 10 50 02 AM

@YCShen1010 YCShen1010 requested a review from Daniel-Fan March 26, 2026 14:55
YCShen1010 and others added 2 commits March 26, 2026 08:14
Copy link
Copy Markdown
Contributor

@Daniel-Fan Daniel-Fan left a comment

Choose a reason for hiding this comment

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

Thank you @YCShen1010
The changes look good to me!

@Daniel-Fan Daniel-Fan merged commit e9c9c08 into IBM:master Mar 26, 2026
1 check passed
@YCShen1010 YCShen1010 deleted the kyverno branch March 26, 2026 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants