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

Support az-entra auth #221

Merged
merged 1 commit into from
Nov 29, 2024
Merged

Support az-entra auth #221

merged 1 commit into from
Nov 29, 2024

Conversation

clyang82
Copy link
Contributor

Fixed: https://issues.redhat.com/browse/ACM-15835

Refer to Azure document for how to configure workload indentity: https://learn.microsoft.com/en-us/azure/aks/workload-identity-deploy-cluster
basic steps are:

  1. the serviceaccount has a new annotation injected azure.workload.identity/client-id: "${USER_ASSIGNED_CLIENT_ID}" Microsoft Entra Workload ID uses Service Account Token Volume Projection (that is, a service account), to enable pods to use a Kubernetes identity.
  2. ensure the deployment has the label azure.workload.identity/use: "true" so the pod can use workload identity.

@clyang82
Copy link
Contributor Author

Need have a separate PR to enable Flexible Server in our automation environment.

// The access token can be expired. but the existing connections are not invalidated.
// TODO: how to reconnect due to the network is broken etc. Right now, gorm does not have this feature.
// refer to https://github.com/go-gorm/gorm/issues/5602 & https://github.com/go-gorm/gorm/pull/1721.
token, err := cred.GetToken(context.Background(), policy.TokenRequestOptions{Scopes: []string{c.TokenRequestScope}})
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need to make the scope configurable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

refer to the line

fs.StringVar(&c.TokenRequestScope, "db-token-request-scope", c.TokenRequestScope, "Configure the token request scope for Open-Source Relational Database Management Systems in Azure")

Signed-off-by: clyang82 <[email protected]>
@clyang82
Copy link
Contributor Author

/assign @qiujian16

@clyang82 clyang82 merged commit 3a56948 into openshift-online:main Nov 29, 2024
7 checks passed
@clyang82 clyang82 deleted the az-entra branch November 29, 2024 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants