Configurations¶
Adding new configuration file¶
- Go to charts folder in the corresponding project and find values.yaml file. There, you should register the new config file to the "configs" section.
configs:
- app-settings
- bank-card
- servicebus-config
# A list of config names:
# - my-config-name1
# - my-config-name2
resources: {}
- You should create a configmap in kubernetes for the new config file. You can create a configmap from a file like this (you should have kubectl on your path):
kubectl create configmap 'servicebus-config' --from-file=data=.\servicebus-config.json
More information on how to create a configmap in Kubernetes
Add to specific configuration file from the app-settings¶
- Find (or create) and open the
app-settingsrelated to your goal area and environment in thebank-configuration. (for example for the wallet service would beapp-settings.minority-wallet-service.json) - Add a new section to the
app-settingfile with the name of your goal config file. For example if you want to add something towallet-bank-cardadd a new section to theapp-settings.minority-wallet-service.jsonfile and the name of the section would be the config name (For this example would bewallet-bank-card) and inside the section, add your additions. For example theapp-settings.minority-wallet-service.jsonwould be like this:
{ "AzureKeyVault": { "KeyVaultNames": "stage-verifycardjwt-kv" }, "wallet-bank-card": { "Key1":"value1", "Key2":"value2", . . . . } }
Adding New Secrets¶
- Consider filename of the secret you provided in
ConsfigurationSourceattribute on configuration class wasauthentication_constants. Note that for secrets filename cannot contain hyphens (-), use single underscore (_) b/w words. - Add new file in
app-configfolder with namesecrets-auth_constants. This file will contain default values of secrets for local development and ITPs.
{ "TokenExpirationSeconds": "600", "RefreshTokenExpirationSeconds": "720", "IssuerKey": "minority.com2533" } - Go to charts folder in corresponding project and find
values.yaml. There you should register new secrets tosecretssection. Pay attention to the format of values in keys section.
secrets:
- secretName: minority-authentication
keys:
IssuerKey: auth_secrets__IssuerKey
RefreshTokenExpirationSeconds: auth_secrets__RefreshTokenExpirationSeconds
TokenExpirationSeconds: auth_secrets__TokenExpirationSeconds
4. This change will be deployed to kuberenetes pods. Next we need to register secrets in kubernetes cluster so that cluster can provide value of secret to applications which request it. Note that this step should actually be dene before deployment. Create a file
authentication.yaml on local machine, outside your repository, with following contents:apiVersion: v1
kind: Secret
metadata:
name: minority-authentication
type: Opaque
data:
IssuerKey: <base64 encoded value>
RefreshTokenExpirationSeconds: <base64 encoded value>
TokenExpirationSeconds: <base64 encoded value>
5. Replace
<base64 encoded value> with proper base64 encoded value for a secret. If you have bash, you can use following command to encode a string to base64.echo '<value>' | base64
6. Next we will apply this secret with kubernetes cluster. Go to your kubectl.exe location and execute:
kubectl apply -f <full path to authentication.yaml>