Skip to content

Remove kolla entrypoint pattern, harden SecurityContext - #695

Merged
openshift-merge-bot[bot] merged 1 commit into
openstack-k8s-operators:mainfrom
stuggi:remove-kolla
Aug 19, 2026
Merged

Remove kolla entrypoint pattern, harden SecurityContext#695
openshift-merge-bot[bot] merged 1 commit into
openstack-k8s-operators:mainfrom
stuggi:remove-kolla

Conversation

@stuggi

@stuggi stuggi commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Eliminate kolla_start/kolla_set_configs and the config.json staging pattern across all 4 cinder workloads (api, scheduler, volume, backup). Configs are now mounted directly to final paths via SubPath volume mounts, removing the need for root privilege escalation at container startup. Cinder's Pattern A conf.d-overlay config mechanism (parent Cinder CR renders global config, each child merges its own snippets into cinder.conf.d) is native to cinder/oslo.config and untouched by this change.

Key changes:

  • Replace kolla_start with direct commands per workload (httpd -DFOREGROUND, cinder-scheduler/-volume/-backup --config-dir)
  • Remove all KOLLA_CONFIG_STRATEGY env vars and the 5 kolla config.json templates
  • Mount configs via SubPath to /etc/cinder/, /etc/httpd/, /etc/my.cnf
  • Mount ssl.conf from lib-common CommonTemplates at /etc/httpd/conf.d/ssl.conf to override the RPM-shipped default (which references the non-existent localhost.crt)
  • Replace kolla's run-on-host shim copy (multipath/iscsi/lvm tooling for cinder-volume/backup) with SubPath mounts of the existing scripts secret at each host-binary destination path
  • Use pod.RestrictiveSecurityContext and RestrictivePodSecurityContext from lib-common for cinder-api/scheduler and both probe sidecars; cinder-volume/backup keep Privileged: true (genuine LVM/iSCSI/ multipath device access need) but now pin RunAsUser/RunAsGroup/ RunAsNonRoot instead of defaulting to root
  • Set AutomountServiceAccountToken=false on all workloads
  • Import CinderUID from lib-common modules/serviceuser, drop the now-unused local CinderUserID/CinderGroupID constants
  • Override TLS CertMount/KeyMount to /etc/pki/tls/ for cinder-api
  • Migrate SCC rbacRules from [anyuid, privileged] to [privileged, nonroot-v2] — anyuid is no longer needed anywhere in this repo
  • Harden the db-sync/online-data-migrations Job (previously RunAsUser: 0) and db-purge CronJob to the same restrictive context
  • Standardize all config-data secret DefaultMode to 0440 (owner-read + group-read) across every volume definition
  • Adopt lib-common volume.WritableDirVolume/WritableDirVolumeMount helpers for all emptyDir volumes (tmp, run-httpd, logs), replacing inline EmptyDir constructions with standardized constants
  • Update httpd.conf: User/Group cinder, PidFile /run/httpd/httpd.pid, ErrorLog to stderr
  • Update functional and kuttl tests

Jira: OSPRH-33504
Jira: OSPRH-33503

Depends-On: openstack-k8s-operators/lib-common#728

@centosinfra-prod-github-app

Copy link
Copy Markdown

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://gateway-cloud-softwarefactory.apps.ocp.cloud.ci.centos.org/zuul/t/rdoproject.org/buildset/f499dc51b4404c338a321d654570fa73

✔️ openstack-k8s-operators-content-provider SUCCESS in 2h 45m 09s
cinder-operator-kuttl FAILURE in 42m 46s
cinder-operator-tempest FAILURE in 1h 54m 50s

@stuggi
stuggi force-pushed the remove-kolla branch 4 times, most recently from ffcc8f8 to 0dbe030 Compare August 11, 2026 14:33
@centosinfra-prod-github-app

Copy link
Copy Markdown

This change depends on a change that failed to merge.

Changes openstack-k8s-operators/lib-common#732, openstack-k8s-operators/s2i-openstack-containers#46 are needed.

@stuggi

stuggi commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

recheck

@centosinfra-prod-github-app

Copy link
Copy Markdown

This change depends on a change that failed to merge.

Change openstack-k8s-operators/lib-common#728 is needed.

@stuggi

stuggi commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

recheck

@centosinfra-prod-github-app

Copy link
Copy Markdown

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://gateway-cloud-softwarefactory.apps.ocp.cloud.ci.centos.org/zuul/t/rdoproject.org/buildset/119ce017afbd478fb665a0a1ab86f5cc

✔️ openstack-k8s-operators-content-provider SUCCESS in 1h 45m 07s
✔️ cinder-operator-kuttl SUCCESS in 50m 03s
cinder-operator-tempest FAILURE in 1h 24m 45s

@stuggi

stuggi commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

recheck

@centosinfra-prod-github-app

Copy link
Copy Markdown

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://gateway-cloud-softwarefactory.apps.ocp.cloud.ci.centos.org/zuul/t/rdoproject.org/buildset/cbdce31c3bda4620b37b6b2ee2b5117d

openstack-k8s-operators-content-provider FAILURE in 15m 15s
⚠️ cinder-operator-kuttl SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
⚠️ cinder-operator-tempest SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider

@stuggi

stuggi commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

recheck

@centosinfra-prod-github-app

Copy link
Copy Markdown

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://gateway-cloud-softwarefactory.apps.ocp.cloud.ci.centos.org/zuul/t/rdoproject.org/buildset/57115b8960b9492eb5d1382789f1acd8

openstack-k8s-operators-content-provider FAILURE in 14m 00s
⚠️ cinder-operator-kuttl SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
⚠️ cinder-operator-tempest SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider

Comment thread internal/cinderbackup/volumes.go Outdated
Comment on lines +28 to +38
// runOnHostVolumeMount returns a VolumeMount that shims a host storage binary
// via the "scripts" secret's run-on-host nsenter wrapper, so cinder-backup can
// invoke host-installed multipath/iscsi tooling from inside the container
// (the pod already runs with HostPID: true).
func runOnHostVolumeMount(destPath string) corev1.VolumeMount {
return corev1.VolumeMount{
Name: "scripts",
MountPath: destPath,
SubPath: "run-on-host",
}
}

@abays abays Aug 14, 2026

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.

This seems like a duplicate of cindervolumes/volumes.go's function of the same name. Maybe could be moved to cinder/volumes.go?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

sure, yes makes sense!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

@abays abays left a comment

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.

/lgtm

Eliminate kolla_start/kolla_set_configs and the config.json staging
pattern across all 4 cinder workloads (api, scheduler, volume,
backup). Configs are now mounted directly to final paths via SubPath
volume mounts, removing the need for root privilege escalation at
container startup. Cinder's Pattern A conf.d-overlay config mechanism
(parent Cinder CR renders global config, each child merges its own
snippets into cinder.conf.d) is native to cinder/oslo.config and
untouched by this change.

Key changes:
- Replace kolla_start with direct commands per workload
  (httpd -DFOREGROUND, cinder-scheduler/-volume/-backup --config-dir)
- Remove all KOLLA_CONFIG_STRATEGY env vars and the 5 kolla
  config.json templates
- Mount configs via SubPath to /etc/cinder/, /etc/httpd/, /etc/my.cnf
- Mount ssl.conf from lib-common CommonTemplates at
  /etc/httpd/conf.d/ssl.conf to override the RPM-shipped default
  (which references the non-existent localhost.crt)
- Replace kolla's run-on-host shim copy (multipath/iscsi/lvm tooling
  for cinder-volume/backup) with SubPath mounts of the existing
  scripts secret at each host-binary destination path
- Use pod.RestrictiveSecurityContext and RestrictivePodSecurityContext
  from lib-common for cinder-api/scheduler and both probe sidecars;
  cinder-volume/backup keep Privileged: true (genuine LVM/iSCSI/
  multipath device access need) but now pin RunAsUser/RunAsGroup/
  RunAsNonRoot instead of defaulting to root
- Set AutomountServiceAccountToken=false on all workloads
- Import CinderUID from lib-common modules/serviceuser, drop the
  now-unused local CinderUserID/CinderGroupID constants
- Override TLS CertMount/KeyMount to /etc/pki/tls/ for cinder-api
- Migrate SCC rbacRules from [anyuid, privileged] to
  [privileged, nonroot-v2] — anyuid is no longer needed anywhere in
  this repo
- Harden the db-sync/online-data-migrations Job (previously
  RunAsUser: 0) and db-purge CronJob to the same restrictive context
- Standardize all config-data secret DefaultMode to 0440
  (owner-read + group-read) across every volume definition
- Adopt lib-common volume.WritableDirVolume/WritableDirVolumeMount
  helpers for all emptyDir volumes (tmp, run-httpd, logs), replacing
  inline EmptyDir constructions with standardized constants
- Update httpd.conf: User/Group cinder, PidFile /run/httpd/httpd.pid,
  ErrorLog to stderr
- Update functional and kuttl tests

Jira: OSPRH-33504    
Jira: OSPRH-33503    

Depends-On: openstack-k8s-operators/lib-common#728

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Martin Schuppert <mschuppert@redhat.com>

@fmount fmount left a comment

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.

/lgtm

@openshift-ci

openshift-ci Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: abays, fmount, stuggi

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:
  • OWNERS [abays,fmount,stuggi]

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

@openshift-merge-bot
openshift-merge-bot Bot merged commit 114b7c2 into openstack-k8s-operators:main Aug 19, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants