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

Add support for Origin Access Control CRD #41

Merged

Conversation

TiberiuGC
Copy link
Member

Issue #, if available: aws-controllers-k8s/community#2093

Description of changes: add support for Origin Access Control CRD

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ack-prow ack-prow bot requested a review from a-hilaly July 16, 2024 06:50
@TiberiuGC TiberiuGC force-pushed the resource/origin-access-control branch from ec837c8 to d2a3de8 Compare July 16, 2024 07:20
Comment on lines +107 to +109
updates = {
"spec": {"originAccessControlConfig": {"description": "new description"}},
}
Copy link
Member

Choose a reason for hiding this comment

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

We're so lucky we don't have arrays in this CRDs, we don't have write another massacre like https://github.com/aws-controllers-k8s/cloudfront-controller/blob/main/pkg/resource/distribution/hooks.go#L29-L34

Copy link
Member

@a-hilaly a-hilaly left a comment

Choose a reason for hiding this comment

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

Super neat! thanks!
/lgtm

@ack-prow ack-prow bot added the lgtm Indicates that a PR is ready to be merged. label Jul 16, 2024
Copy link

ack-prow bot commented Jul 16, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: a-hilaly, TiberiuGC

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

@ack-prow ack-prow bot added the approved label Jul 16, 2024
@ack-prow ack-prow bot merged commit 896a045 into aws-controllers-k8s:main Jul 16, 2024
6 checks passed
@bala151187
Copy link

bala151187 commented Jul 19, 2024

@TiberiuGC @a-hilaly
I just installed new verison of cloudfront 0.0.12 & CRD as well .. Facing below permission error for the controller

{"level":"info","ts":"2024-07-19T20:56:48.227Z","msg":"pkg/mod/k8s.io/client-go@v0.29.0/tools/cache/reflector.go:229: failed to list *v1alpha1.OriginAccessControl: originaccesscontrols.cloudfront.services.k8s.aws is forbidden: User \"system:serviceaccount:ack-system:ack-cloudfront-controller\" cannot list resource \"originaccesscontrols\" in API group \"cloudfront.services.k8s.aws\" at the cluster scope"} {"level":"error","ts":"2024-07-19T20:56:48.227Z","msg":"pkg/mod/k8s.io/client-go@v0.29.0/tools/cache/reflector.go:229: Failed to watch *v1alpha1.OriginAccessControl: failed to list *v1alpha1.OriginAccessControl: originaccesscontrols.cloudfront.services.k8s.aws is forbidden: User \"system:serviceaccount:ack-system:ack-cloudfront-controller\" cannot list resource \"originaccesscontrols\" in API group \"cloudfront.services.k8s.aws\" at the cluster scope","stacktrace":"k8s.io/client-go/tools/cache.DefaultWatchErrorHandler\n\t/go/pkg/mod/k8s.io/client-go@v0.29.0/tools/cache/reflector.go:147\nk8s.io/client-go/tools/cache.(*Reflector).Run.func1\n\t/go/pkg/mod/k8s.io/client-go@v0.29.0/tools/cache/reflector.go:292\nk8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1\n\t/go/pkg/mod/k8s.io/apimachinery@v0.29.0/pkg/util/wait/backoff.go:226\nk8s.io/apimachinery/pkg/util/wait.BackoffUntil\n\t/go/pkg/mod/k8s.io/apimachinery@v0.29.0/pkg/util/wait/backoff.go:227\nk8s.io/client-go/tools/cache.(*Reflector).Run\n\t/go/pkg/mod/k8s.io/client-go@v0.29.0/tools/cache/reflector.go:290\nk8s.io/client-go/tools/cache.(*controller).Run.(*Group).StartWithChannel.func2\n\t/go/pkg/mod/k8s.io/apimachinery@v0.29.0/pkg/util/wait/wait.go:55\nk8s.io/apimachinery/pkg/util/wait.(*Group).Start.func1\n\t/go/pkg/mod/k8s.io/apimachinery@v0.29.0/pkg/util/wait/wait.go:72"}

my IAM role has these policies attached

Screenshot 2024-07-19 at 5 02 19 PM

That role mapped to the service account .

Screenshot 2024-07-19 at 5 03 53 PM

Am i missing anything

@a-hilaly
Copy link
Member

@bala151187 this sounds like an RBAC issue, did you update the helm chart as well?

@bala151187
Copy link

bala151187 commented Jul 19, 2024

@a-hilaly Yeah . i just manually updated the image version :) .

image: public.ecr.aws/aws-controllers-k8s/cloudfront-controller:0.0.12

@a-hilaly
Copy link
Member

Updating the deployment image alone isn't enough, you need to use the latest helm chart (it contains the right RBAC for this version of the controller)

@bala151187
Copy link

@a-hilaly hmm .. then that's the missing piece .. gotcha .. ll let you know on monday .. thanks for replying

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm Indicates that a PR is ready to be merged.
Projects
None yet
3 participants