-
Notifications
You must be signed in to change notification settings - Fork 50
Add Application Credential support #829
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
base: main
Are you sure you want to change the base?
Conversation
|
Note: kuttl tests are yet to be added |
|
Build failed (check pipeline). Post https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/9f80e1823add462ea5c60df2672f72d6 ✔️ openstack-k8s-operators-content-provider SUCCESS in 2h 21m 14s |
ce6f6b9 to
e70d887
Compare
|
Build failed (check pipeline). Post https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/c51230a124434844b7ac185afdb52021 ✔️ openstack-k8s-operators-content-provider SUCCESS in 1h 53m 25s |
|
|
||
| replace k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20250627150254-e9823e99808e //allow-merging | ||
|
|
||
| replace github.com/openstack-k8s-operators/keystone-operator/api => github.com/Deydra71/keystone-operator/api v0.0.0-20251211085602-3e1a3e022c81 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this kind of replacement from an official to a non-official package name is intentional here?
|
|
||
| replace k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20250627150254-e9823e99808e //allow-merging | ||
|
|
||
| replace github.com/openstack-k8s-operators/keystone-operator/api => github.com/Deydra71/keystone-operator/api v0.0.0-20251211085602-3e1a3e022c81 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, this weird package name looks fishy.
| @@ -1,3 +1,5 @@ | |||
| github.com/Deydra71/keystone-operator/api v0.0.0-20251211085602-3e1a3e022c81 h1:plax+NFgJJL1SrERyXAnf3jOHRhLTtBlJ2oc7d84EoU= | |||
| github.com/Deydra71/keystone-operator/api v0.0.0-20251211085602-3e1a3e022c81/go.mod h1:b98Jl8eyUw8V07l9YiuQnoMlnWC748oV8IhXH15NCC4= | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not pull from non openstack-k8s-operators
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @mrunge ! It's only temporary before the dependency in keystone-oeprator is merged
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After that, it will be removed before final reviews and merge
e70d887 to
50542c0
Compare
| {{- end }} | ||
| {{ if (index . "ACID") }} | ||
| auth_type = v3applicationcredential | ||
| auth_url = {{ .KeystoneInternalURL }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about moving the auth_url to the outside of the conditional block (e.g. under the "{{- end }}" line) and also removing the auth_url on L55, so that it isn't duplicated? Similar for the other service templates.
50542c0 to
fad545a
Compare
|
I tested with the PR and there is an issue with watching the appcred secret in CloudKitty. The CloudKitty uses 3 controllers (cloudkitty, cloudkittyproc, cloudkittyapi), each controller manages its own CR. The cloudkitty.conf is initially created in the cloudkitty controller and saved into What that means, when a cloudkitty appcred secret changes, the "cloudkitty" controller needs to reconcile. It'll refresh the cloudkitty.conf in the shared What happened in my environment right now: I had appcreds created with just the "service" role, which doesn't seem enough for CK. So I added the "admin" role. cloudkittyapi and cloudkittyproc controllers reconciled, but the cloudkitty controller didn't reconcile. This resulted in no change in the config used inside the pods and the old (insufficient) credentials stayed being used. |
|
sorry for the wall of text. TLDR: watch the secrets in cloudkitty controller, not in cloudkittyapi and cloudkittyproc :D |
fad545a to
42f2f52
Compare
|
@vyzigold thanks a lot for checking the reconciliation! I updated the controllers so that only the |
|
This change depends on a change that failed to merge. Change openstack-k8s-operators/keystone-operator#567 is needed. |
|
Build failed (check pipeline). Post https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/adb5f869f7e44dd7a494b6aaab89cbd8 ✔️ openstack-k8s-operators-content-provider SUCCESS in 2h 12m 09s |
|
I retested with the new changes. ✔️ Before (without the changes - bad behavior): After (with the current code): In the logs with the new code I can see: So I think the watching of the app credentials in cloudkitty now works as it should. Thanks @Deydra71 . |
vyzigold
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is one more issue with the watching in the CloudKitty controller, which I didn't mention because I thought it's unrelated and would need a separate fix, but after investigating, I think it should be addressed here.
The findObjectForSrc function matches everything (so it matches every secret). So let's also copy a findObjectsForSrc from elsewhere (like https://github.com/openstack-k8s-operators/telemetry-operator/blob/main/internal/controller/cloudkittyapi_controller.go#L444) and use that for the MapFunc. This is following what we found to be a pattern in other operators (having findObjectForSrc to match everything and findObjectsForSrc to match based on fields in the CR) e.g.:
https://github.com/openstack-k8s-operators/nova-operator/blob/main/internal/controller/nova_controller.go#L2108
https://github.com/openstack-k8s-operators/neutron-operator/blob/main/internal/controller/neutronapi_controller.go#L353
https://github.com/openstack-k8s-operators/cinder-operator/blob/main/internal/controller/cinder_controller.go#L377
I'd personally name the findObjectForSrc a bit differently, but let's try to stay consistent with the other operators.
9a74d73 to
7beeac6
Compare
|
Merge Failed. This change or one of its cross-repo dependencies was unable to be automatically merged with the current state of its repository. Please rebase the change and upload a new patchset. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Deydra71 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Signed-off-by: Veronika Fisarova <vfisarov@redhat.com> Co-authored-by: Jaromír Wysoglad <smulumas@gmail.com>
7beeac6 to
65bb887
Compare
|
@Deydra71: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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. |
|
Build failed (check pipeline). Post https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/8739c6d40eeb41df85a50de10cce3917 ❌ openstack-k8s-operators-content-provider FAILURE in 16m 37s |
|
I retested with the latest code and the watching in cloudkitty seems to work correctly now. The controller reconciles for changes to the ac secrets, but I don't see the additional unnecessary reconciliations anymore 👍 |
Jira: OSPRH-16628
Adds end-to-end support for consuming Keystone Application Credentials (AppCred) in the telemetry-operator, enabling Ceilometer, Aodh, and CloudKitty pods to use AppCred-based authentication when available.
API changes:
Adds an optional auth field to telemetry service CRs:
spec.auth.applicationCredentialSecret— name of the Secret that contains the Keystone Application Credential ID and Secret (AC_IDandAC_SECRET).This is added for:
Reconcile behavior:
spec.auth.applicationCredentialSecretAC_ID/AC_SECRETfrom the referenced Secret (via the Keystone helper)Once the AppCred Secret is ready with valid
AC_ID/AC_SECRET:Templates AppCred credentials into the generated service configuration (e.g.
ceilometer.conf,aodh.conf,cloudkitty.conf)The rendered config hash naturally includes AppCred values, triggering rolling updates when credentials rotate
All controllers use the same service user’s AppCred Secret for their respective service (ceilometer/aodh/cloudkitty)
Updates Keystone auth sections to support AppCred with a block-based if/else structure:
auth_type = v3applicationcredential+application_credential_id+application_credential_secretDepends-on: openstack-k8s-operators/keystone-operator#567