Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweak roles to fix permission errors #398

Merged
merged 1 commit into from
Sep 3, 2024

Conversation

SgtCoDFish
Copy link
Member

@SgtCoDFish SgtCoDFish commented Sep 3, 2024

There are two issues here; first, there was a missing permission to create events in the lease namespace if the lease namespace differs from .Values.app.certmanager.namespace. That was observed with the below error:

E0827 11:25:35.882363       1 event.go:359] "Server rejected event (will not retry!)" err="events is forbidden: User \"system:serviceaccount:venafi:cert-manager-istio-csr\" cannot create resource \"events\" in API
group \"\" in the namespace \"asd\"" event="&Event{ObjectMeta:{istio-csr.17ef92345b7ae172  asd 0 0001-01-01 00:00:00 +0000 UTC <nil> <nil> map[] map[] [] [] []},InvolvedObject:ObjectReference{Kind:Lease,Na
mespace:asd,Name:istio-csr,UID:ec187de6-fca5-4bb6-accb-ce601cefafb5,APIVersion:coordination.k8s.io/v1,ResourceVersion:245173,FieldPath:,},Reason:LeaderElection,Message:cert-manager-istio-csr-65f98db858-966lz_68e
4de58-2685-42fc-90a4-ae5ee49e2472 became leader,Source:EventSource{Component:cert-manager-istio-csr-65f98db858-966lz_68e4de58-2685-42fc-90a4-ae5ee49e2472,Host:,},FirstTimestamp:2024-08-27 11:25:35.876923762 +0000 U
TC m=+15.995353297,LastTimestamp:2024-08-27 11:25:35.876923762 +0000 UTC m=+15.995353297,Count:1,Type:Normal,EventTime:0001-01-01 00:00:00 +0000 UTC,Series:nil,Action:,Related:nil,ReportingController:cert-manager-i
stio-csr-65f98db858-966lz_68e4de58-2685-42fc-90a4-ae5ee49e2472,ReportingInstance:,}"

Second, the permissions for creating the dynamic istiod cert were tied to the wrong namespace. .Values.app.certmanager.namespace isn't always the same as .Values.app.istio.namespace.

There are two issues here; first, there was a missing permission to
create events in the lease namespace, which would lead to failures like
the below:

```text
E0827 11:25:35.882363       1 event.go:359] "Server rejected event (will not retry!)" err="events is forbidden: User \"system:serviceaccount:venafi:cert-manager-istio-csr\" cannot create resource \"events\" in API
group \"\" in the namespace \"asd\"" event="&Event{ObjectMeta:{istio-csr.17ef92345b7ae172  asd 0 0001-01-01 00:00:00 +0000 UTC <nil> <nil> map[] map[] [] [] []},InvolvedObject:ObjectReference{Kind:Lease,Na
mespace:asd,Name:istio-csr,UID:ec187de6-fca5-4bb6-accb-ce601cefafb5,APIVersion:coordination.k8s.io/v1,ResourceVersion:245173,FieldPath:,},Reason:LeaderElection,Message:cert-manager-istio-csr-65f98db858-966lz_68e
4de58-2685-42fc-90a4-ae5ee49e2472 became leader,Source:EventSource{Component:cert-manager-istio-csr-65f98db858-966lz_68e4de58-2685-42fc-90a4-ae5ee49e2472,Host:,},FirstTimestamp:2024-08-27 11:25:35.876923762 +0000 U
TC m=+15.995353297,LastTimestamp:2024-08-27 11:25:35.876923762 +0000 UTC m=+15.995353297,Count:1,Type:Normal,EventTime:0001-01-01 00:00:00 +0000 UTC,Series:nil,Action:,Related:nil,ReportingController:cert-manager-i
stio-csr-65f98db858-966lz_68e4de58-2685-42fc-90a4-ae5ee49e2472,ReportingInstance:,}"
```

Second, the permissions for creating the dynamic istiod cert were tied
to the wrong namespace.

Signed-off-by: Ashley Davis <ashley.davis@venafi.com>
@cert-manager-prow cert-manager-prow bot added dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 3, 2024
@ThatsMrTalbot
Copy link
Contributor

👍
/lgtm
/approve

@cert-manager-prow cert-manager-prow bot added the lgtm Indicates that a PR is ready to be merged. label Sep 3, 2024
@cert-manager-prow
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ThatsMrTalbot

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

The pull request process is described 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

@cert-manager-prow cert-manager-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 3, 2024
@cert-manager-prow cert-manager-prow bot merged commit b0af546 into cert-manager:main Sep 3, 2024
14 checks passed
@SgtCoDFish SgtCoDFish deleted the leasens branch September 3, 2024 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants