Skip to content

Conversation

@ehearne-redhat
Copy link

@ehearne-redhat ehearne-redhat commented Nov 24, 2025

What

  • Ensure the canary daemon set uses its own service account, rather than the default service account.

Why

  • Using the default service account is a security issue. Using a bespoke service account ensures minimal permissions are given to the daemonset.

How

  • A service account has been created for the canary daemonset.
  • A cluster role binding has been created which references an already existing openshift-ingress-operator cluster role.
  • This cluster role binding is also attached to the service account for the canary daemon set.
  • The reconciler now detects resource creation of the cluster role binding and service account.
  • Tests have been made for the new changes.

@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 Nov 24, 2025
@openshift-ci openshift-ci bot requested review from bentito and miheer November 24, 2025 12:31
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 24, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign knobunc for approval. For more information see the Code Review Process.

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

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

@ehearne-redhat
Copy link
Author

These tests are failing because of an improper serviceAccount mount for the ingress-canary daemonset. Working on serviceAccount and related items creation and attachment to ingress-canary daemonset.

Copy link
Author

@ehearne-redhat ehearne-redhat left a comment

Choose a reason for hiding this comment

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

I will remove the unnecessary code once tests come back.

@ehearne-redhat ehearne-redhat changed the title WIP: add ingress-operator service account to canary daemon set [WIP] OCPBUGS-65629: add ingress-operator service account to canary daemon set Nov 27, 2025
@openshift-ci-robot openshift-ci-robot added jira/severity-critical Referenced Jira bug's severity is critical for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. labels Nov 27, 2025
@openshift-ci-robot
Copy link
Contributor

@ehearne-redhat: This pull request references Jira Issue OCPBUGS-65629, which is invalid:

  • expected the bug to target the "4.21.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

WIP - do not merge .

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.

@openshift-ci-robot openshift-ci-robot added the jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. label Nov 27, 2025
@ehearne-redhat
Copy link
Author

/jira refresh

@openshift-ci-robot openshift-ci-robot added the jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. label Nov 27, 2025
@openshift-ci-robot
Copy link
Contributor

@ehearne-redhat: This pull request references Jira Issue OCPBUGS-65629, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.21.0) matches configured target version for branch (4.21.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @lihongan

In response to this:

/jira refresh

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.

@openshift-ci-robot openshift-ci-robot removed the jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. label Nov 27, 2025
@openshift-ci openshift-ci bot requested a review from lihongan November 27, 2025 18:18
@ehearne-redhat ehearne-redhat changed the title [WIP] OCPBUGS-65629: add ingress-operator service account to canary daemon set [WIP] OCPBUGS-65629: ensure canary daemon set uses its own service account. Nov 27, 2025
@ehearne-redhat
Copy link
Author

/test okd-scos-images

@openshift-ci-robot
Copy link
Contributor

@ehearne-redhat: This pull request references Jira Issue OCPBUGS-65629, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.21.0) matches configured target version for branch (4.21.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @lihongan

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

WIP - do not merge .

What

  • Ensure the canary daemon set uses its own service account, rather than the default service account.

Why

  • Using the default service account is a security issue. Using a bespoke service account ensures minimal permissions are given to the daemonset.

How

  • A service account has been created for the canary daemonset.
  • A cluster role binding has been created which references an already existing openshift-ingress-operator cluster role.
  • This cluster role binding is also attached to the service account for the canary daemon set.
  • The reconciler now detects resource creation of the cluster role binding and service account.
  • Tests have been made for the new changes.

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.

@ehearne-redhat
Copy link
Author

/test hypershift-e2e-aks

@ehearne-redhat
Copy link
Author

test e2e-aws-pre-release-ossm shows the service account is mounted and the pod is running.

ehearne-mac:must-gather (6) ehearne$ omc -n openshift-ingress-canary get pod ingress-canary-82txj -o yaml
apiVersion: v1
kind: Pod
...
  generateName: ingress-canary-
...
  name: ingress-canary-82txj
  namespace: openshift-ingress-canary
  ownerReferences:
  - apiVersion: apps/v1
    blockOwnerDeletion: true
    controller: true
    kind: DaemonSet
    name: ingress-canary
...
spec:
...
  serviceAccount: ingress-canary
  serviceAccountName: ingress-canary
...
  phase: Running
  podIP: 10.129.2.9
  podIPs:
  - ip: 10.129.2.9
  qosClass: Burstable
  startTime: "2025-11-27T18:44:24Z"

@ehearne-redhat ehearne-redhat changed the title [WIP] OCPBUGS-65629: ensure canary daemon set uses its own service account. OCPBUGS-65629: ensure canary daemon set uses its own service account. Nov 27, 2025
@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 Nov 27, 2025
@lihongan
Copy link
Contributor

/retest-required

1 similar comment
@lihongan
Copy link
Contributor

/retest-required

@ehearne-redhat
Copy link
Author

/retest

@lihongan
Copy link
Contributor

pre-merge tested and no issues found

// without the fix PR
$ oc -n openshift-ingress-canary get serviceaccounts 
NAME       SECRETS   AGE
builder    1         8h
default    1         8h
deployer   1         8h

$ oc -n openshift-ingress-canary get pod ingress-canary-gw8rz -oyaml | grep -i serviceaccount
    - mountPath: /var/run/secrets/kubernetes.io/serviceaccount
  serviceAccount: default
  serviceAccountName: default

$ oc -n openshift-ingress-canary get clusterrolebindings openshift-ingress-canary
Error from server (NotFound): clusterrolebindings.rbac.authorization.k8s.io "openshift-ingress-canary" not found

// with the fix PR
$ oc get clusterversion
NAME      VERSION                                                AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.21.0-0-2025-11-28-081649-test-ci-ln-2dzjdit-latest   True        False         76m     Cluster version is 4.21.0-0-2025-11-28-081649-test-ci-ln-2dzjdit-latest

$ oc -n openshift-ingress-canary get serviceaccount
NAME             SECRETS   AGE
builder          1         88m
default          1         91m
deployer         1         88m
ingress-canary   1         91m                 <<<<-----------

$ oc -n openshift-ingress-canary get clusterrolebindings openshift-ingress-canary
NAME                       ROLE                                     AGE
openshift-ingress-canary   ClusterRole/openshift-ingress-operator   66m

$ oc -n openshift-ingress-canary get ds ingress-canary -oyaml | grep -i serviceaccount
      serviceAccount: ingress-canary
      serviceAccountName: ingress-canary

$ oc -n openshift-ingress-canary get pod ingress-canary-f8l2h -oyaml | grep -i serviceaccount
    - mountPath: /var/run/secrets/kubernetes.io/serviceaccount
  serviceAccount: ingress-canary
  serviceAccountName: ingress-canary

@ehearne-redhat
Copy link
Author

/retest

@ehearne-redhat
Copy link
Author

/test hypershift-e2e-aks

@ehearne-redhat
Copy link
Author

/test e2e-aws-pre-release-ossm

@ehearne-redhat
Copy link
Author

/test e2e-aws-ovn

@ehearne-redhat
Copy link
Author

/test hypershift-e2e-aks

@ehearne-redhat
Copy link
Author

/test e2e-aws-pre-release-ossm

@ehearne-redhat
Copy link
Author

/test e2e-aws-pre-release-ossm
/test hypershift-e2e-aks

@ehearne-redhat
Copy link
Author

/retest

1 similar comment
@ehearne-redhat
Copy link
Author

/retest

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 30, 2025

@ehearne-redhat: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-aws-pre-release-ossm e999f8a link false /test e2e-aws-pre-release-ossm

Full PR test history. Your PR dashboard.

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 kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jira/severity-critical Referenced Jira bug's severity is critical for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants