Skip to content

Configurations

Adding new configuration file

  1. 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: {}
  1. 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

  1. Find (or create) and open the app-settings related to your goal area and environment in the bank-configuration. (for example for the wallet service would be app-settings.minority-wallet-service.json)
  2. Add a new section to the app-setting file with the name of your goal config file. For example if you want to add something to wallet-bank-card add a new section to the app-settings.minority-wallet-service.json file and the name of the section would be the config name (For this example would be wallet-bank-card) and inside the section, add your additions. For example the app-settings.minority-wallet-service.jsonwould be like this:
    {
    
      "AzureKeyVault": {
        "KeyVaultNames": "stage-verifycardjwt-kv"
      },
    
      "wallet-bank-card": {
        "Key1":"value1",
        "Key2":"value2",
        .
        .
        .
        .
      }
    
    }
    

Adding New Secrets

  1. Consider filename of the secret you provided in ConsfigurationSource attribute on configuration class was authentication_constants. Note that for secrets filename cannot contain hyphens (-), use single underscore (_) b/w words.
  2. Add new file in app-config folder with name secrets-auth_constants. This file will contain default values of secrets for local development and ITPs.
    {
        "TokenExpirationSeconds": "600",
        "RefreshTokenExpirationSeconds": "720",
        "IssuerKey": "minority.com2533"
    }
    
  3. Go to charts folder in corresponding project and find values.yaml. There you should register new secrets to secrets section. 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>

More information on how to create a secrets in Kubernetes