Skip to content

Remove kolla entrypoint pattern, harden SecurityContext - #768

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

Remove kolla entrypoint pattern, harden SecurityContext#768
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

Replaces the kolla_start/kolla_set_configs/config.json staging pattern with direct volume mounts to final config paths and direct service commands, across ironic-api, ironic-conductor, ironic-inspector, ironic-neutron-agent, and both db-sync jobs.

RBAC: IronicAPI/Conductor/Inspector/NeutronAgent share one ServiceAccount/Role when owned by the parent Ironic CR, so they cannot get independently different SCC grants. The shared Role grants anyuid;privileged;nonroot-v2 -- conductor/inspector genuinely need anyuid+privileged for PXE chroot (SYS_CHROOT/SETFCAP) and DHCP/TFTP sub-1024-port binding (NET_ADMIN/NET_RAW), while nonroot-v2 is included to match every other operator in the effort.

Mixed-privilege pods (conductor, inspector) carry a pod-level RestrictivePodSecurityContext for their non-root siblings, with dnsmasq and pxe-init explicitly overriding RunAsUser/RunAsNonRoot back to root on their own container SecurityContext. Both dnsmasq and pxe-init Drop ALL capabilities first, then add back only the specific caps they need (NET_ADMIN/NET_RAW for dnsmasq, SYS_CHROOT/SETFCAP for pxe-init).

AutomountServiceAccountToken set to false on all workloads including conductor -- get_net_ip reads network status from the DownwardAPI volume (/etc/podinfo/network-status), not from the k8s API.

Writable paths:

  • run-httpd emptyDir added to conductor (was missing entirely) and mount added to both conductor's and inspector's httpboot containers -- httpd cannot write its PID file without writable /run/httpd
  • Adopts lib-common volume.WritableDirVolume/WritableDirVolumeMount helpers with constants for run-httpd, string literals for ironic-specific volumes (var-lib-ironic, logs, etc.)

Config secret DefaultMode tightened from 0640 to 0440.

Also fixes: the standard TLS cert/key staging-path bug on ironic-api's and ironic-inspector's httpd; httpd.conf User/Group changed from apache to ironic on ironic-api specifically, matching its pre-existing WSGIDaemonProcess user=ironic evidence, while ironic-inspector's proxy httpd and both httpboot instances keep apache (no such evidence).

Config delivery uses three variants of the EmptyDir-seed pattern: plain final-path Secret SubPath mounts, a single merged file written by the init container's crudini-merge step
(03-init-container-conductor.conf), and a dynamically pxe-init-generated dnsmasq.conf -- all safe because the writer runs in an earlier container through a whole-directory mount.

dbsync.sh had only its one kolla-specific line
(sudo -E kolla_set_configs) removed.

Jira: OSPRH-33504
Jira: OSPRH-33503

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

Describe your changes

Jira Ticket Link

Jira:

Checklist before requesting a review

  • I have performed a self-review of my code and confirmed it passes tests
  • Performed pre-commit run --all
  • Tested operator image in a test/dev environment. It can be CRC via install_yamls or a hotstack instance (optional)
  • Verified that no failures present in logs(optional):
    • ironic-operator-build-deploy-kuttl
    • podified-multinode-ironic-deployment

@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/4fb67c361b2448fd9f74d982983e0616

✔️ openstack-k8s-operators-content-provider SUCCESS in 1h 30m 38s
podified-multinode-ironic-deployment FAILURE in 1h 08m 57s

@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/6a0fafb01235444994490e7585f8f6d4

✔️ openstack-k8s-operators-content-provider SUCCESS in 1h 39m 42s
podified-multinode-ironic-deployment FAILURE in 1h 17m 50s

@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/7651f3504a334d30956dd2ac1b40898f

✔️ openstack-k8s-operators-content-provider SUCCESS in 1h 53m 11s
podified-multinode-ironic-deployment FAILURE in 1h 11m 43s

@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/ad156c2fc68945e1812cc0c088f602c5

✔️ openstack-k8s-operators-content-provider SUCCESS in 2h 00m 50s
podified-multinode-ironic-deployment FAILURE in 1h 15m 45s

@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/63bbf92513574dd389aa7a4ece6fdbfe

✔️ openstack-k8s-operators-content-provider SUCCESS in 2h 03m 37s
podified-multinode-ironic-deployment FAILURE in 1h 16m 14s

@stuggi

stuggi commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

/retest

@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/b8b01baab1fa451186642b11cc9428e2

✔️ openstack-k8s-operators-content-provider SUCCESS in 1h 04m 52s
podified-multinode-ironic-deployment NODE_FAILURE Node(set) request 099-0000165990 failed in 0s

@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/e1d73ec9bff548fb8025f014a3b72a79

✔️ openstack-k8s-operators-content-provider SUCCESS in 2h 00m 42s
podified-multinode-ironic-deployment FAILURE in 1h 15m 03s

@stuggi

stuggi commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

/retest

@stuggi

stuggi commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

/test precommit-check

@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/c9b13ea5432a49c39f1d2bbca20deaa3

✔️ openstack-k8s-operators-content-provider SUCCESS in 1h 47m 50s
podified-multinode-ironic-deployment FAILURE in 55m 38s

@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/5be2383893f641bc8cdef0a377f410dc

openstack-k8s-operators-content-provider FAILURE in 5m 45s
⚠️ podified-multinode-ironic-deployment SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider

@stuggi

stuggi commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

recheck

@stuggi
stuggi requested a review from hjensas August 14, 2026 10:23
@stuggi

stuggi commented Aug 17, 2026

Copy link
Copy Markdown
Contributor Author

/test ironic-operator-build-deploy-kuttl

1 similar comment
@stuggi

stuggi commented Aug 18, 2026

Copy link
Copy Markdown
Contributor Author

/test ironic-operator-build-deploy-kuttl

@stuggi

stuggi commented Aug 18, 2026

Copy link
Copy Markdown
Contributor Author

recheck

@stuggi

stuggi commented Aug 19, 2026

Copy link
Copy Markdown
Contributor Author

@hjensas @steveb please have a look at this when you have time

// container's own explicit fields override the pod-level
// default, exempting dnsmasq specifically.
SecurityContext: &corev1.SecurityContext{
RunAsUser: ptr.To(int64(0)),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We need to merge #779 first and backport it to stable-18, so you'll likely need to rebase this when it is merged

@steveb

steveb commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

This looks good to me. After #779 is merged I'm happy for this to land.

Replaces the kolla_start/kolla_set_configs/config.json staging pattern
with direct volume mounts to final config paths and direct service
commands, across ironic-api, ironic-conductor, ironic-inspector,
ironic-neutron-agent, and both db-sync jobs.

RBAC: IronicAPI/Conductor/Inspector/NeutronAgent share one
ServiceAccount/Role when owned by the parent Ironic CR, so they
cannot get independently different SCC grants. The shared Role
grants anyuid;privileged;nonroot-v2 -- conductor/inspector genuinely
need anyuid+privileged for PXE chroot (SYS_CHROOT/SETFCAP) and
DHCP/TFTP sub-1024-port binding (NET_ADMIN/NET_RAW), while
nonroot-v2 is included to match every other operator in the effort.

Mixed-privilege pods (conductor, inspector) carry a pod-level
RestrictivePodSecurityContext for their non-root siblings, with
dnsmasq and pxe-init explicitly overriding RunAsUser/RunAsNonRoot
back to root on their own container SecurityContext. Both dnsmasq
and pxe-init Drop ALL capabilities first, then add back only the
specific caps they need (NET_ADMIN/NET_RAW for dnsmasq,
SYS_CHROOT/SETFCAP for pxe-init).

AutomountServiceAccountToken set to false on all workloads including
conductor -- get_net_ip reads network status from the DownwardAPI
volume (/etc/podinfo/network-status), not from the k8s API.

Writable paths:
- run-httpd emptyDir added to conductor (was missing entirely) and
  mount added to both conductor's and inspector's httpboot containers
  -- httpd cannot write its PID file without writable /run/httpd
- Adopts lib-common volume.WritableDirVolume/WritableDirVolumeMount
  helpers with constants for run-httpd, string literals for
  ironic-specific volumes (var-lib-ironic, logs, etc.)

Config secret DefaultMode tightened from 0640 to 0440.

Also fixes: the standard TLS cert/key staging-path bug on
ironic-api's and ironic-inspector's httpd; httpd.conf User/Group
changed from apache to ironic on ironic-api specifically, matching
its pre-existing WSGIDaemonProcess user=ironic evidence, while
ironic-inspector's proxy httpd and both httpboot instances keep
apache (no such evidence).

Config delivery uses three variants of the EmptyDir-seed pattern:
plain final-path Secret SubPath mounts, a single merged file written
by the init container's crudini-merge step
(03-init-container-conductor.conf), and a dynamically
pxe-init-generated dnsmasq.conf -- all safe because the writer runs
in an earlier container through a whole-directory mount.

dbsync.sh had only its one kolla-specific line
(sudo -E kolla_set_configs) removed.

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>
@stuggi

stuggi commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

This looks good to me. After #779 is merged I'm happy for this to land.

thanks, I rebased it


args := []string{"-c", DBSyncCommand}

envVars := map[string]env.Setter{}

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.

Could probably drop this since it's not used anymore, but I'm fine with leaving it and having someone clean it up later if they want.

@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

@openshift-ci

openshift-ci Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: abays, 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:

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 5247e6e into openstack-k8s-operators:main Aug 20, 2026
8 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