-
Notifications
You must be signed in to change notification settings - Fork 43
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
parameterize azure PG config and use psql-client container to connect #790
base: main
Are you sure you want to change the base?
Conversation
--env PGUSER \ | ||
--env PGPASSWORD \ | ||
postgres psql \ | ||
-d clusters-service -p 5432 |
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.
Depending on how the CS DB is deployed in theory the DB name might be a different one so we might want this configurable with a default. Not a blocker of course, just raising this.
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'll wait until #763 is merged, then we can draw the actual DB name value from the config
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.
all CS and maestro settings around DB, namespace, service account and MI have now been parameterized
It looks good to me |
@@ -7,7 +7,7 @@ NAMESPACE=$4 | |||
SA_NAME=$5 | |||
|
|||
# prep creds and configs | |||
PGHOST=$(az postgres flexible-server list --resource-group ${RESOURCEGROUP} --query "[?starts_with(name, '${DB_SERVER_NAME_PREFIX}')].fullyQualifiedDomainName" -o tsv) | |||
export PGHOST=$(az postgres flexible-server list --resource-group ${RESOURCEGROUP} --query "[?starts_with(name, '${DB_SERVER_NAME_PREFIX}')].fullyQualifiedDomainName" -o tsv) | |||
AZURE_TENANT_ID=$(az account show -o json | jq .homeTenantId -r) | |||
AZURE_CLIENT_ID=$(az identity show -g ${RESOURCEGROUP} -n ${MANAGED_IDENTITY_NAME} --query clientId -o tsv) | |||
SA_TOKEN=$(kubectl create token ${SA_NAME} --namespace=${NAMESPACE} --audience api://AzureADTokenExchange) |
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.
Should we make the expiration of this token short-lived? I.e. 24 hrs?
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.
- the default SA token on AKS expires in 1h, i made it explicit though
- for
az account get-access-token
there is no way to set the expiration - it defaults to 24h
Please rebase pull request. |
Please rebase pull request. |
* installing the psql client tool locally brings a log of dependencies on most systems. by using a container we avoid having to install too many things on developer machines * parameterize all fields required for CS and Maestro DB setup so we can have consistency between infra RBAC deployment, service deployment and DB deployment Signed-off-by: Gerd Oberlechner <[email protected]>
What this PR does
Jira:
Link to demo recording:
Special notes for your reviewer