-
Notifications
You must be signed in to change notification settings - Fork 44
Application Credential support #812
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
Open
Deydra71
wants to merge
1
commit into
openstack-k8s-operators:main
Choose a base branch
from
Deydra71:appcred-support
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+199
−8
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,9 +41,18 @@ default_backend=default_backend | |
| [keystone_authtoken] | ||
| www_authenticate_uri={{ .KeystonePublicURL }} | ||
| auth_url={{ .KeystoneInternalURL }} | ||
| auth_type=password | ||
| username={{ .ServiceUser }} | ||
| {{ if .UseApplicationCredentials -}} | ||
| auth_type = v3applicationcredential | ||
| application_credential_id = {{ .ACID }} | ||
| application_credential_secret = {{ .ACSecret }} | ||
| {{ else -}} | ||
| auth_type = password | ||
| username = {{ .ServiceUser }} | ||
| password = {{ .ServicePassword }} | ||
| project_domain_name = Default | ||
| user_domain_name = Default | ||
| project_name = service | ||
| {{- end }} | ||
| {{ if (index . "MemcachedServers") }} | ||
| memcached_servers = {{ .MemcachedServers }} | ||
| memcache_pool_dead_retry = 10 | ||
|
|
@@ -55,12 +64,16 @@ memcache_tls_keyfile = {{ .MemcachedAuthKey }} | |
| memcache_tls_cafile = {{ .MemcachedAuthCa }} | ||
| memcache_tls_enabled = true | ||
| {{end}} | ||
| project_domain_name=Default | ||
| user_domain_name=Default | ||
| project_name=service | ||
|
|
||
| [service_user] | ||
| {{ if .UseApplicationCredentials -}} | ||
| auth_type = v3applicationcredential | ||
| application_credential_id = {{ .ACID }} | ||
| application_credential_secret = {{ .ACSecret }} | ||
| {{ else -}} | ||
| auth_type = password | ||
| password = {{ .ServicePassword }} | ||
| {{- end }} | ||
|
|
||
| [oslo_messaging_notifications] | ||
| {{ if (index . "TransportURL") -}} | ||
|
|
@@ -94,11 +107,16 @@ filesystem_store_datadir = /var/lib/glance/os_glance_tasks_store/ | |
|
|
||
| [oslo_limit] | ||
| auth_url={{ .KeystoneInternalURL }} | ||
| auth_type = password | ||
| auth_type = {{ if .UseApplicationCredentials }}v3applicationcredential{{ else }}password{{ end }} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here |
||
| {{ if .UseApplicationCredentials -}} | ||
| application_credential_id = {{ .ACID }} | ||
| application_credential_secret = {{ .ACSecret }} | ||
| {{ else -}} | ||
| username={{ .ServiceUser }} | ||
| password = {{ .ServicePassword }} | ||
| system_scope = all | ||
| user_domain_id = default | ||
| {{- end }} | ||
| {{ if (index . "EndpointID") -}} | ||
| endpoint_id = {{ .EndpointID }} | ||
| {{ end -}} | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I'm not entirely sure we should hardcode
glancehere, especially because if this depends on the CR name, we might fail due to the fact we can append a suffix from the openstack-operator. If the openstack-operator ends up creating AppCred for glance using the CR name, you might end up havingac-glance-12345678-secret, and this might create side effects to this code (it wouldn't generate a reconcile loop).Instead of matching a secret using the
name, I think it might be solid to select if viaLabelSelector, so you can remove the dependency on the name and any potential suffix on the CR.I did something similar in [1], where you only reconcile if a
LabelSelectormatches.However, I'm good with the current approach if we manage to resolve the problem with the hardcoded name, I just think we can make it more solid and less error prone.
Let's think a bit more about it and get some feedback from @stuggi too in case a better pattern already exists!
[1] #795
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.
Thanks @fmount for reviews! I still need to go through them.
But regarding this part - CR Names are not suffixed by openstack-operator [1]. The only place where a random suffix is added is in the Keystone Application Credential name (not the CR) [2].
Regarding matching by the label - currently we don't have any service-specific labels. All AppCred CRs share the same label structure, so using LabelSelector would not distinguish between services. But I'm open to create service specific labes, to bypass hardcoding, which can be always tricky... Let's see about Martin's additional comment.
[1] https://github.com/openstack-k8s-operators/openstack-operator/pull/1430/files#diff-c7b5c3051971f29e36eeddfd6ae38150becaabdf19a75569fb7c9e964c42e78eR113
[2] https://github.com/openstack-k8s-operators/keystone-operator/pull/567/files#diff-83ece155782727a148956f6e4b2b7203661c2ff5b9f128979326158f988bb777R233
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.
ah ok interesting, I didn't see the
openstack-operatorpatch and now I see that the service list is pretty much static:LabelSelectorwould involve modifying [1] to pass at least something likeservice: <service, but if we do not have any aliasing problem then we can go with this version, where you can simply replace "glance" withglance.ServiceName.Still let's wait for @stuggi's feedback as well, but this clarifies part of my concerns about using the name instead of something different.
[1] https://github.com/openstack-k8s-operators/keystone-operator/pull/567/files#diff-83ece155782727a148956f6e4b2b7203661c2ff5b9f128979326158f988bb777R235