From bc16249346f014206f9a3d20c0914ca1177b9984 Mon Sep 17 00:00:00 2001 From: Miguel de Barros Date: Thu, 19 Apr 2018 15:17:23 +0200 Subject: [PATCH] Develop (#44) * Fixed AWS config (#25): https://github.com/mojaloop/helm/issues/24 * Fixed update script ordering. (#27) * Sync'd central-config.yml with central/values.yml (#29) * Fixed update script ordering. * Sync'd config-central.yaml to match central/values.yaml * Feature/#60 automate the cd pipeline for central ledger (#34) * Fixed AWS config (#25): https://github.com/mojaloop/helm/issues/24 (#26) * Fixed update script ordering. (#27) * Develop (#30) * added initial configs for central dev and prod deployments * Added a new chart called "mojaloop" which deploys all components for the mojaloop switch. * Feature/#60 automate the cd pipeline for central ledger (#36) * added initial configs for central dev and prod deployments * Added a new chart called "mojaloop" which deploys all components for the mojaloop switch. * Updated ingress for prod deployment * Updated Ingress Host Names * updated dev config for all tags to point to 'snapshot' instead of 'latst' * updated dev config for all tags to point to 'snapshot' instead of 'latst' * updated centralledger chart to v0.2.0 (#43) * updated centralledger chart to v0.2.0 Changes made: - added mysql dep on centralledger, and associated configurations for either postgres or mysql - changed centralledger config to use value for the knex config - removed AWS values (not needed) - removed values in the root folder. Rather use the value.yaml in each chart folder, which is easier to maintain. * Bumbped chart versions impacted by centralledger update to 0.2.0 to match the same version * Bumbped chart versions impacted by centralledger update to 0.2.0 to match the same version For previous commit: Added db_type and db_driver under the config values for CentralLedger. This will allow us to switch between postgresql and mysql. Note the mysql deployment has not been tested since we do not have working backend code to fully support this yet. --- README.md | 17 +- central/Chart.yaml | 2 +- central/requirements.yaml | 2 +- central/values.aws.yaml | 756 ------------------- central/values.yaml | 208 +++++- centraldirectory/values.aws.yaml | 400 ---------- centralenduserregistry/values.aws.yaml | 170 ----- centralhub/Chart.yaml | 2 +- centralhub/requirements.yaml | 2 +- centralhub/values.aws.yaml | 422 ----------- centralhub/values.yaml | 215 +++++- centralkms/values.aws.yaml | 167 ----- centralledger/Chart.yaml | 2 +- centralledger/requirements.yaml | 6 +- centralledger/templates/config.yaml | 20 +- centralledger/templates/deployment.yaml | 2 + centralledger/templates/ingress.yaml | 3 + centralledger/templates/secret.yaml | 8 +- centralledger/values.aws.yaml | 413 ----------- centralledger/values.yaml | 122 ++- config-central.yaml | 749 ------------------- config-ingress.yaml | 48 -- forensicloggingsidecar/values.aws.yaml | 264 ------- mockpathfinder/values.aws.yaml | 175 ----- mojaloop/.helmignore | 21 + mojaloop/Chart.yaml | 12 + mojaloop/_helpers.tpl | 16 + mojaloop/requirements.yaml | 6 + mojaloop/values.yaml | 942 ++++++++++++++++++++++++ package.sh | 5 + update-charts-dep.sh | 4 + 31 files changed, 1564 insertions(+), 3617 deletions(-) delete mode 100644 central/values.aws.yaml delete mode 100644 centraldirectory/values.aws.yaml delete mode 100644 centralenduserregistry/values.aws.yaml delete mode 100644 centralhub/values.aws.yaml delete mode 100644 centralkms/values.aws.yaml delete mode 100644 centralledger/values.aws.yaml delete mode 100644 config-central.yaml delete mode 100644 config-ingress.yaml delete mode 100644 forensicloggingsidecar/values.aws.yaml delete mode 100644 mockpathfinder/values.aws.yaml create mode 100644 mojaloop/.helmignore create mode 100644 mojaloop/Chart.yaml create mode 100644 mojaloop/_helpers.tpl create mode 100644 mojaloop/requirements.yaml create mode 100644 mojaloop/values.yaml diff --git a/README.md b/README.md index ce2a38c69..65ba8ed7c 100644 --- a/README.md +++ b/README.md @@ -20,11 +20,13 @@ e.g. `helm install --debug --namespace=mojaloop --name=dev --repo=http://mojaloo Refer to the following default chart config file for values: http://mojaloop.io/helm//values.yaml -3. Deploy ALL Central componenets +3. Deploy Mojaloop componenets -- `helm install --debug --namespace= --name= --repo=http://mojaloop.io/helm/repo central` +*Warning: This will deploy all charts.* -e.g. `helm install --debug --namespace=mojaloop --name=dev --repo=http://mojaloop.io/helm/repo central` +- `helm install --debug --namespace= --name= --repo=http://mojaloop.io/helm/repo mojaloop` + +e.g. `helm install --debug --namespace=mojaloop --name=dev --repo=http://mojaloop.io/helm/repo mojaloop` 4. Deploy Ingress @@ -50,6 +52,7 @@ Note: Please ensure that you update the Chart dependencies in the order show bel - `helm dep up centralenduserregistry` - `helm dep up centraldirectory` - `helm dep up central` +- `helm dep up mojaloop` We are quitely waiting on recursive updates: https://github.com/kubernetes/helm/issues/2247 @@ -65,11 +68,13 @@ This script will ensure the correct order is maintained. e.g. `helm install --debug --namespace=mojaloop --name=dev ./centralledger` -2. Deploy ALL Central componenets +2. Deploy mojaloop componenets + +*Warning: This will deploy all charts.* -- `helm install --debug --namespace= --name= ./central` +- `helm install --debug --namespace= --name= ./mojaloop` -e.g. `helm install --debug --namespace=mojaloop --name=dev ./central` +e.g. `helm install --debug --namespace=mojaloop --name=dev ./mojaloop` 3. Deploy Ingress diff --git a/central/Chart.yaml b/central/Chart.yaml index a172e42fd..65bf9cc86 100644 --- a/central/Chart.yaml +++ b/central/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 description: Central Helm chart for Kubernetes name: central -version: 0.1.0 +version: 0.2.0 home: http://mojaloop.io icon: http://mojaloop.io/images/logo.png sources: diff --git a/central/requirements.yaml b/central/requirements.yaml index 3d69e8402..cfd4cf411 100644 --- a/central/requirements.yaml +++ b/central/requirements.yaml @@ -1,7 +1,7 @@ # requirements.yaml dependencies: - name: centralhub - version: 0.1.0 + version: 0.2.0 repository: "file://../centralhub" condition: centralhub.enabled - name: centraldirectory diff --git a/central/values.aws.yaml b/central/values.aws.yaml deleted file mode 100644 index 86a38b346..000000000 --- a/central/values.aws.yaml +++ /dev/null @@ -1,756 +0,0 @@ -# Default values for central. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -centralhub: - enabled: true - replicaCount: 1 - image: - repository: mojaloop/central-hub - tag: latest - pullPolicy: IfNotPresent - - readinessProbe: - enabled: true - httpGet: - path: /health - initialDelaySeconds: 45 - periodSeconds: 15 - - livenessProbe: - enabled: true - httpGet: - path: /health - initialDelaySeconds: 45 - periodSeconds: 15 - - config: - default_json: ' - { - "PORT": "$service_port", - "HOSTNAME": "http://$ingress_host", - "API_URL": "http://$centralledger_host:$centralledger_api_port", - "ADMIN_API_URL": "http://$centralledger_host:$centralledger_admin_port" - } - ' - - service: - name: http-api-and-web - type: LoadBalancer - externalPort: 4001 - internalPort: 4001 - - annotations: - service.beta.kubernetes.io/aws-load-balancer-type: "nlb" - - # This allows one to point the service to an external backend. - # This is useful for local development where one wishes to hijack - # the communication from the service to the node layer and point - # to a specific endpoint (IP, Port, etc). - external: - enabled: false - # 10.0.2.2 is the magic IP for the host on virtualbox's network - ip: 10.0.2.2 - ports: - api: - name: http-api-and-web - externalPort: 4001 - - - ingress: - enabled: true - # Used to create an Ingress record. - hosts: - - central-hub.local - - externalPath: / - - annotations: - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - - tls: - # Secrets must be manually created in the namespace. - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - - resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - - centralledger: - enabled: true - nameOverride: centralledger - replicaCount: 1 - containers: - api: - image: - repository: mojaloop/central-ledger - tag: latest - pullPolicy: IfNotPresent - command: '["node", "src/api/index.js"]' - service: - ports: - api: - name: http-api - externalPort: 3000 - internalPort: 3000 - readinessProbe: - enabled: true - httpGet: - path: /health - initialDelaySeconds: 120 - periodSeconds: 15 - livenessProbe: - enabled: true - httpGet: - path: /health - initialDelaySeconds: 90 - periodSeconds: 15 - - admin: - image: - repository: mojaloop/central-ledger - tag: latest - pullPolicy: IfNotPresent - command: '["node", "src/admin/index.js"]' - service: - ports: - api: - name: http-api-admin - externalPort: 3001 - internalPort: 3001 - readinessProbe: - enabled: true - httpGet: - path: /health - initialDelaySeconds: 120 - periodSeconds: 15 - livenessProbe: - enabled: true - httpGet: - path: /health - initialDelaySeconds: 90 - periodSeconds: 15 - - - config: - default_json: ' - { - "PORT": $service_api_port, - "ADMIN_PORT": $service_admin_port, - "HOSTNAME": "$ingress_host", - "ENABLE_TOKEN_AUTH": false, - "ENABLE_BASIC_AUTH": false, - "LEDGER_ACCOUNT_NAME": "LedgerName", - "LEDGER_ACCOUNT_PASSWORD": "LedgerPassword", - "AMOUNT": { - "PRECISION": 10, - "SCALE": 2 - }, - "SIDECAR": { - "DISABLED": false, - "HOST": "$forensicloggingsidecar_host", - "PORT": $forensicloggingsidecar_port, - "CONNECT_TIMEOUT": 45000, - "RECONNECT_INTERVAL": 5000 - } - } - ' - - init: - enabled: true - image: - name: wait-for-postgres - repository: bowerswilkins/awaitpostgres - tag: latest - pullPolicy: IfNotPresent - - service: - type: LoadBalancer - - annotations: - service.beta.kubernetes.io/aws-load-balancer-type: "nlb" - - # This allows one to point the service to an external backend. - # This is useful for local development where one wishes to hijack - # the communication from the service to the node layer and point - # to a specific endpoint (IP, Port, etc). - external: - enabled: false - # 10.0.2.2 is the magic IP for the host on virtualbox's network - ip: 10.0.2.2 - ports: - api: - name: http-api - externalPort: 3000 - admin: - name: http-api-admin - externalPort: 3001 - - ingress: - enabled: true - externalPath: - api: / - admin: /admin/ - # Used to create an Ingress record. - hosts: - api: central-ledger.local - annotations: - nginx.ingress.kubernetes.io/rewrite-target: '/' - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - tls: - # Secrets must be manually created in the namespace. - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - - forensicloggingsidecar: - enabled: true - nameOverride: "forensicloggingsidecar-ledger" - replicaCount: 1 - image: - repository: mojaloop/forensic-logging-sidecar - tag: latest - pullPolicy: IfNotPresent - - service: - name: http-api-and-ws - type: LoadBalancer - externalPort: 5678 - internalPort: 5678 - - annotations: - service.beta.kubernetes.io/aws-load-balancer-type: "nlb" - - # This allows one to point the service to an external backend. - # This is useful for local development where one wishes to hijack - # the communication from the service to the node layer and point - # to a specific endpoint (IP, Port, etc). - external: - enabled: false - # 10.0.2.2 is the magic IP for the host on virtualbox's network - ip: 10.0.2.2 - ports: - api: - name: http-api-and-ws - externalPort: 5678 - - readinessProbe: - enabled: true - initialDelaySeconds: 90 - periodSeconds: 15 - - livenessProbe: - enabled: true - initialDelaySeconds: 90 - periodSeconds: 15 - - ingress: - enabled: false - # Used to create an Ingress record. - hosts: - api: forensic-logging-sidecar.local - - externalPath: / - - annotations: - # kubernetes.io/ingress.class: nginx - - tls: - # Secrets must be manually created in the namespace. - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - - config: - default_json: ' - { - "PORT": $servicePort, - "SERVICE": "$serviceName", - "BATCH_SIZE": 64, - "BATCH_TIME_INTERVAL": 300000, - "KMS": { - "URL": "ws://$kmsHost:$kmsPort/sidecar", - "PING_INTERVAL": 30000, - "REQUEST_TIMEOUT": 90000, - "CONNECT_TIMEOUT": 60000, - "RECONNECT_INTERVAL": 10000 - } - } - ' - - centralkms: - enabled: true - nameOverride: "centralkms" - replicaCount: 1 - image: - repository: mojaloop/central-kms - tag: latest - pullPolicy: IfNotPresent - - service: - name: http-api-and-tcp-websocket - type: LoadBalancer - externalPort: 8080 - internalPort: 8080 - - annotations: - service.beta.kubernetes.io/aws-load-balancer-type: "nlb" - - # This allows one to point the service to an external backend. - # This is useful for local development where one wishes to hijack - # the communication from the service to the node layer and point - # to a specific endpoint (IP, Port, etc). - external: - enabled: false - # 10.0.2.2 is the magic IP for the host on virtualbox's network - ip: 10.0.2.2 - ports: - api: - name: http-api-and-tcp-websocket - externalPort: 8080 - - readinessProbe: - enabled: true - httpGet: - path: /sidecars - initialDelaySeconds: 45 - periodSeconds: 15 - - livenessProbe: - enabled: true - httpGet: - path: /sidecars - initialDelaySeconds: 45 - periodSeconds: 15 - - ingress: - enabled: true - # Used to create an Ingress record. - hosts: - - central-kms.local - externalPath: / - - annotations: - # kubernetes.io/ingress.class: nginx - - tls: - # Secrets must be manually created in the namespace. - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - - resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - - postgresql: - enabled: true - nameOverride: "centralkms-postgresql" - ## Create a database user - postgresUser: kms - ## Default: random 10 character string - postgresPassword: xD873IyaQB - - service: - type: LoadBalancer - port: 5432 - externalIPs: [] - - postgresql: - enabled: true - nameOverride: "forensicloggingsidecar-ledger-postgresql" - ## Create a database user - postgresUser: sidecar - ## Default: random 10 character string - postgresPassword: Wqt0KlkKvL - - service: - type: LoadBalancer - port: 5432 - externalIPs: [] - - postgresql: - enabled: true - nameOverride: "centralledger-postgresql" - ## Create a database user - postgresUser: central_ledger - ## Default: random 10 character string - postgresPassword: oyMxgZChuu - - service: - type: LoadBalancer - port: 5432 - externalIPs: [] - -centraldirectory: - enabled: true - replicaCount: 1 - image: - repository: mojaloop/central-directory - tag: latest - pullPolicy: IfNotPresent - - readinessProbe: - enabled: true - httpGet: - path: /health - initialDelaySeconds: 60 - periodSeconds: 15 - - livenessProbe: - enabled: true - httpGet: - path: /health - initialDelaySeconds: 60 - periodSeconds: 15 - - config: - default_json: ' - { - "PORT": $service_port, - "HOSTNAME": "http://$ingress_host", - "END_USER_REGISTRY_URL": "http://$centralenduserregistry_host:$centralenduserregistry_port", - "SCHEME_ID": "001", - "DEFAULT_DFSP": "", - "ENABLE_TOKEN_AUTH": false, - "PATHFINDER": { - "PARTNER_ID": 10305, - "SERVICE": "E2U+mm", - "CACHE_TIME": 300000, - "REGEX": { - "PATTERN": "^.*$", - "REPLACE": "mm:#{identifier}@leveloneproject.org" - }, - "QUERY": { - "ADDRESS": "$pathfinder_host", - "PORT": 15353, - "TIMEOUT": 15000 - }, - "PROVISIONING": { - "ADDRESS": "http://$pathfinder_host:$pathfinder_provisioning_port/nrs-pi/services/SIPIX/SendRequest" - } - } - } - ' - - init: - enabled: true - - service: - type: LoadBalancer - ports: - api: - name: http-api - externalPort: 3000 - internalPort: 3000 - - annotations: - service.beta.kubernetes.io/aws-load-balancer-type: "nlb" - - # This allows one to point the service to an external backend. - # This is useful for local development where one wishes to hijack - # the communication from the service to the node layer and point - # to a specific endpoint (IP, Port, etc). - external: - enabled: false - # 10.0.2.2 is the magic IP for the host on virtualbox's network - ip: 10.0.2.2 - ports: - api: - name: http-api - externalPort: 3000 - - ingress: - enabled: false - externalPath: / - # Used to create an Ingress record. - hosts: - api: central-directory.local - annotations: - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - tls: - # Secrets must be manually created in the namespace. - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - - centralenduserregistry: - enabled: true - nameOverride: "centralenduserregistry" - replicaCount: 1 - image: - repository: mojaloop/central-end-user-registry - tag: latest - pullPolicy: IfNotPresent - - readinessProbe: - enabled: true - httpGet: - path: /health - initialDelaySeconds: 45 - periodSeconds: 15 - - livenessProbe: - enabled: true - httpGet: - path: /health - initialDelaySeconds: 45 - periodSeconds: 15 - - config: - default_json: ' - { - "PORT": $service_port, - "HOSTNAME": "http://$ingress_host" - } - ' - - init: - enabled: true - - service: - type: LoadBalancer - ports: - api: - name: http-api - externalPort: 3001 - internalPort: 3001 - - annotations: - service.beta.kubernetes.io/aws-load-balancer-type: "nlb" - - # This allows one to point the service to an external backend. - # This is useful for local development where one wishes to hijack - # the communication from the service to the node layer and point - # to a specific endpoint (IP, Port, etc). - external: - enabled: false - # 10.0.2.2 is the magic IP for the host on virtualbox's network - ip: 10.0.2.2 - ports: - provisioning: - name: http-api - externalPort: 3001 - - ingress: - enabled: false - externalPath: / - # Used to create an Ingress record. - hosts: - api: central-end-user-registry.local - annotations: - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - tls: - # Secrets must be manually created in the namespace. - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - - postgresql: - enabled: true - nameOverride: "centralenduserregistry-postgresql" - ## postgres image repository - image: "postgres" - ## postgres image version - ## ref: https://hub.docker.com/r/library/postgres/tags/ - ## - imageTag: "9.6.2" - - ## Specify a imagePullPolicy - ## 'Always' if imageTag is 'latest', else set to 'IfNotPresent' - ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images - ## - # imagePullPolicy: - - ## Create a database user - ## Default: postgres - postgresUser: end_user_registry - ## Default: random 10 character string - postgresPassword: yGnTC07WQ6 - - service: - type: LoadBalancer - port: 5432 - externalIPs: [] - - mockpathfinder: - enabled: true - nameOverride: "mockpathfinder" - replicaCount: 1 - image: - repository: mojaloop/mock-pathfinder - tag: latest - pullPolicy: IfNotPresent - - config: - default_json: ' - { - "QUERY": { - "PORT": $query_port, - "DEFAULT_RECORD": { - "order": 10, - "preference": 50, - "flags": "u", - "service": "E2U+pstn:tel", - "regexp": "!^(.*)$!tel:\\1;q_stat=102!", - "replacement": "", - "ttl": 900 - } - }, - "PROVISIONING": { - "PORT": $provisioning_port, - "PATH": "/nrs-pi/services/SIPIX/SendRequest", - "WSDL_FILE": "./sipix-2.0.0.wsdl", - "DEFAULT_CUSTOMER_ID": 1234 - } - } - ' - - service: - type: LoadBalancer - ports: - provisioning: - name: tcp-prov - externalPort: 8080 - internalPort: 8080 - query: - name: tcp-query - externalPort: 15353 - internalPort: 15353 - - annotations: - service.beta.kubernetes.io/aws-load-balancer-type: "nlb" - - # This allows one to point the service to an external backend. - # This is useful for local development where one wishes to hijack - # the communication from the service to the node layer and point - # to a specific endpoint (IP, Port, etc). - external: - enabled: false - # 10.0.2.2 is the magic IP for the host on virtualbox's network - ip: 10.0.2.2 - ports: - provisioning: - name: tcp-prov - externalPort: 8080 - query: - name: tcp-query - externalPort: 15353 - - - ingress: - enabled: false - # Used to create an Ingress record. - hosts: - api: mock-pathfinder.local - annotations: - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - tls: - # Secrets must be manually created in the namespace. - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - - postgresql: - enabled: true - nameOverride: "mockpathfinder-postgresql" - ## Create a database user - postgresUser: mock-pathfinder - ## Default: random 10 character string - postgresPassword: IypvXbJ1Zb - - service: - type: LoadBalancer - port: 5432 - externalIPs: [] - - postgresql: - enabled: true - nameOverride: "centraldirectory-postgresql" - ## Default: postgres - postgresUser: central-directory - ## Default: random 10 character string - postgresPassword: gR5hARbsfa - - service: - type: LoadBalancer - port: 5432 - externalIPs: [] diff --git a/central/values.yaml b/central/values.yaml index c9a5c3467..44c0e490f 100644 --- a/central/values.yaml +++ b/central/values.yaml @@ -89,6 +89,9 @@ centralhub: centralledger: enabled: true nameOverride: centralledger + # Default values for central-ledger. + # This is a YAML-formatted file. + # Declare variables to be passed into your templates. replicaCount: 1 containers: api: @@ -133,7 +136,7 @@ centralhub: httpGet: path: /health initialDelaySeconds: 120 - periodSeconds: 15 + periodSeconds: 15 livenessProbe: enabled: true httpGet: @@ -143,7 +146,12 @@ centralhub: config: - default_json: ' + # db_type can either be 'postgres' or 'mysql'. Ensure the correct DB is enabled and configured below: postgresql.enabled or mysql.enabled + db_type: 'postgres' + # db_driver can either be 'pg' or 'mysql'. Ensure the correct corresponding db_type above has been set. + db_driver: 'pg' + # default_json config for nodejs. The following variables will be injected by the helm chart (see config.yaml): $service_admin_port, $ingress_hostm $forensicloggingsidecar_host, $forensicloggingsidecar_port + default_json: | { "PORT": $service_api_port, "ADMIN_PORT": $service_admin_port, @@ -164,7 +172,21 @@ centralhub: "RECONNECT_INTERVAL": 5000 } } - ' + # default_json config for nodejs db knex lib. The following variables will be injected by the helm chart (see config.yaml): $db_driver + knexfile_js: | + 'use strict' + + const migrationsDirectory = '/opt/central-ledger/migrations' + const Config = require('/opt/central-ledger/src/lib/config') + module.exports = { + client: '$db_driver', + connection: Config.DATABASE_URI, + migrations: { + directory: migrationsDirectory, + tableName: 'migrations', + stub: `${migrationsDirectory}/migration.template` + } + } init: enabled: true @@ -197,12 +219,14 @@ centralhub: ingress: enabled: true + type: http externalPath: api: / admin: /admin/ # Used to create an Ingress record. hosts: api: central-ledger.local + admin: central-ledger.local annotations: nginx.ingress.kubernetes.io/rewrite-target: '/' # kubernetes.io/ingress.class: nginx @@ -308,7 +332,6 @@ centralhub: } } ' - centralkms: enabled: true nameOverride: "centralkms" @@ -343,15 +366,15 @@ centralhub: enabled: true httpGet: path: /sidecars - initialDelaySeconds: 45 - periodSeconds: 15 + initialDelaySeconds: 30 + periodSeconds: 5 livenessProbe: enabled: true httpGet: path: /sidecars - initialDelaySeconds: 45 - periodSeconds: 15 + initialDelaySeconds: 30 + periodSeconds: 5 ingress: enabled: true @@ -410,11 +433,180 @@ centralhub: postgresql: enabled: true nameOverride: "centralledger-postgresql" + ## postgres image repository + image: "postgres" + ## postgres image version + ## ref: https://hub.docker.com/r/library/postgres/tags/ + ## + imageTag: "9.6.2" + + ## Specify a imagePullPolicy + ## 'Always' if imageTag is 'latest', else set to 'IfNotPresent' + ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images + ## + # imagePullPolicy: + ## Create a database user + ## Default: postgres postgresUser: central_ledger ## Default: random 10 character string postgresPassword: oyMxgZChuu + ## Create a database + ## Default: the postgres user + postgresDatabase: central_ledger + + ## Specify initdb arguments, e.g. --data-checksums + ## ref: https://github.com/docker-library/docs/blob/master/postgres/content.md#postgres_initdb_args + ## ref: https://www.postgresql.org/docs/current/static/app-initdb.html + # postgresInitdbArgs: + + ## Persist data to a persitent volume + persistence: + enabled: false + + ## A manually managed Persistent Volume and Claim + ## Requires persistence.enabled: true + ## If defined, PVC must be created manually before volume will be bound + # existingClaim: + + ## database data Persistent Volume Storage Class + ## If defined, storageClassName: + ## If set to "-", storageClassName: "", which disables dynamic provisioning + ## If undefined (the default) or set to null, no storageClassName spec is + ## set, choosing the default provisioner. (gp2 on AWS, standard on + ## GKE, AWS & OpenStack) + ## + # storageClass: "-" + accessMode: ReadWriteOnce + size: 8Gi + subPath: "postgresql-db" + + metrics: + enabled: false + image: wrouesnel/postgres_exporter + imageTag: v0.1.1 + imagePullPolicy: IfNotPresent + resources: + requests: + memory: 256Mi + cpu: 100m + ## Define additional custom metrics + ## ref: https://github.com/wrouesnel/postgres_exporter#adding-new-metrics-via-a-config-file + # customMetrics: + # pg_database: + # query: "SELECT d.datname AS name, CASE WHEN pg_catalog.has_database_privilege(d.datname, 'CONNECT') THEN pg_catalog.pg_database_size(d.datname) ELSE 0 END AS size FROM pg_catalog.pg_database d where datname not in ('template0', 'template1', 'postgres')" + # metrics: + # - name: + # usage: "LABEL" + # description: "Name of the database" + # - size_bytes: + # usage: "GAUGE" + # description: "Size of the database in bytes" + + ## Configure resource requests and limits + ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ + ## + resources: + requests: + memory: 256Mi + cpu: 100m + + service: + type: ClusterIP + port: 5432 + externalIPs: [] + + mysql: + enabled: false + nameOverride: "centralledger-mysql" + # Default values for Percona XtraDB Cluster + + ## percona image and version + ## ref: https://hub.docker.com/r/percona/percona-xtradb-cluster/tags/ + image: + repository: "percona/percona-xtradb-cluster" + tag: "5.7.19" + pullPolicy: IfNotPresent + + # Desired number of members of xtradb cluster + replicas: 1 + + ## Specify password for root user + ## + # mysqlRootPassword: not-a-secure-password + + ## Specify password for xtradb backup user + ## + # xtraBackupPassword: replicate-my-data + + ## Uncomment to create a database user + ## + mysqlUser: test + mysqlPassword: test + + ## Allow unauthenticated access, uncomment to enable + ## + # mysqlAllowEmptyPassword: true + + ## Uncomment to Create a database + ## + mysqlDatabase: test + + ## hosts to allow root user access from + # set to "127.0.0.1" to deny remote root. + allowRootFrom: "%" + + ## Persist data to a persitent volume + persistence: + enabled: false + ## percona data Persistent Volume Storage Class + ## If defined, storageClassName: + ## If set to "-", storageClassName: "", which disables dynamic provisioning + ## If undefined (the default) or set to null, no storageClassName spec is + ## set, choosing the default provisioner. (gp2 on AWS, standard on + ## GKE, AWS & OpenStack) + ## + # storageClass: "-" + accessMode: ReadWriteOnce + size: 8Gi + + ## Node labels for pod assignment + ## Ref: https://kubernetes.io/docs/user-guide/node-selection/ + ## + nodeSelector: {} + + ## Configure resource requests and limits + ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ + ## + # resources: + # requests: + # memory: 256Mi + # cpu: 100m + + configFiles: + node.cnf: |+ + [mysqld] + datadir=/var/lib/mysql + default_storage_engine=InnoDB + binlog_format=ROW + innodb_flush_log_at_trx_commit = 0 + innodb_flush_method = O_DIRECT + innodb_file_per_table = 1 + innodb_autoinc_lock_mode=2 + bind_address = 0.0.0.0 + wsrep_slave_threads=2 + wsrep_cluster_address=gcomm:// + wsrep_provider=/usr/lib/galera3/libgalera_smm.so + wsrep_cluster_name=galera + wsrep_sst_method=xtrabackup-v2 + ## When set to true will create sidecar for `prom/mysqld-exporter` + ## metrics exporting + metricsExporter: false + + ## When set to true will create sidecar to tail mysql log + logTail: true + service: type: ClusterIP port: 5432 diff --git a/centraldirectory/values.aws.yaml b/centraldirectory/values.aws.yaml deleted file mode 100644 index 2f6ac8d11..000000000 --- a/centraldirectory/values.aws.yaml +++ /dev/null @@ -1,400 +0,0 @@ -# Default values for central-directory. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. -replicaCount: 1 -image: - repository: mojaloop/central-directory - tag: latest - pullPolicy: IfNotPresent - -readinessProbe: - enabled: true - httpGet: - path: /health - initialDelaySeconds: 60 - periodSeconds: 15 - -livenessProbe: - enabled: true - httpGet: - path: /health - initialDelaySeconds: 60 - periodSeconds: 15 - -config: - default_json: ' - { - "PORT": $service_port, - "HOSTNAME": "http://$ingress_host", - "END_USER_REGISTRY_URL": "http://$centralenduserregistry_host:$centralenduserregistry_port", - "SCHEME_ID": "001", - "DEFAULT_DFSP": "", - "ENABLE_TOKEN_AUTH": false, - "PATHFINDER": { - "PARTNER_ID": 10305, - "SERVICE": "E2U+mm", - "CACHE_TIME": 300000, - "REGEX": { - "PATTERN": "^.*$", - "REPLACE": "mm:#{identifier}@leveloneproject.org" - }, - "QUERY": { - "ADDRESS": "$pathfinder_host", - "PORT": 15353, - "TIMEOUT": 15000 - }, - "PROVISIONING": { - "ADDRESS": "http://$pathfinder_host:$pathfinder_provisioning_port/nrs-pi/services/SIPIX/SendRequest" - } - } - } -' - -init: - enabled: true - -service: - type: LoadBalancer - ports: - api: - name: http-api - externalPort: 3000 - internalPort: 3000 - - annotations: - service.beta.kubernetes.io/aws-load-balancer-type: "nlb" - - # This allows one to point the service to an external backend. - # This is useful for local development where one wishes to hijack - # the communication from the service to the node layer and point - # to a specific endpoint (IP, Port, etc). - external: - enabled: false - # 10.0.2.2 is the magic IP for the host on virtualbox's network - ip: 10.0.2.2 - ports: - api: - name: http-api - externalPort: 3000 - -ingress: - enabled: false - externalPath: / - # Used to create an Ingress record. - hosts: - api: central-directory.local - annotations: - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - tls: - # Secrets must be manually created in the namespace. - # - secretName: chart-example-tls - # hosts: - # - chart-example.local -resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - -centralenduserregistry: - enabled: true - nameOverride: "centralenduserregistry" - replicaCount: 1 - image: - repository: mojaloop/central-end-user-registry - tag: latest - pullPolicy: IfNotPresent - - readinessProbe: - enabled: true - httpGet: - path: /health - initialDelaySeconds: 45 - periodSeconds: 15 - - livenessProbe: - enabled: true - httpGet: - path: /health - initialDelaySeconds: 45 - periodSeconds: 15 - - config: - default_json: ' - { - "PORT": $service_port, - "HOSTNAME": "http://$ingress_host" - } - ' - - init: - enabled: true - - service: - type: LoadBalancer - ports: - api: - name: http-api - externalPort: 3001 - internalPort: 3001 - - annotations: - service.beta.kubernetes.io/aws-load-balancer-type: "nlb" - - # This allows one to point the service to an external backend. - # This is useful for local development where one wishes to hijack - # the communication from the service to the node layer and point - # to a specific endpoint (IP, Port, etc). - external: - enabled: false - # 10.0.2.2 is the magic IP for the host on virtualbox's network - ip: 10.0.2.2 - ports: - provisioning: - name: http-api - externalPort: 3001 - - ingress: - enabled: false - externalPath: / - # Used to create an Ingress record. - hosts: - api: central-end-user-registry.local - annotations: - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - tls: - # Secrets must be manually created in the namespace. - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - - postgresql: - enabled: true - nameOverride: "centralenduserregistry-postgresql" - ## postgres image repository - image: "postgres" - ## postgres image version - ## ref: https://hub.docker.com/r/library/postgres/tags/ - ## - imageTag: "9.6.2" - - ## Specify a imagePullPolicy - ## 'Always' if imageTag is 'latest', else set to 'IfNotPresent' - ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images - ## - # imagePullPolicy: - - ## Create a database user - ## Default: postgres - postgresUser: end_user_registry - ## Default: random 10 character string - postgresPassword: yGnTC07WQ6 - -mockpathfinder: - enabled: true - nameOverride: "mockpathfinder" - replicaCount: 1 - image: - repository: mojaloop/mock-pathfinder - tag: latest - pullPolicy: IfNotPresent - - config: - default_json: ' - { - "QUERY": { - "PORT": $query_port, - "DEFAULT_RECORD": { - "order": 10, - "preference": 50, - "flags": "u", - "service": "E2U+pstn:tel", - "regexp": "!^(.*)$!tel:\\1;q_stat=102!", - "replacement": "", - "ttl": 900 - } - }, - "PROVISIONING": { - "PORT": $provisioning_port, - "PATH": "/nrs-pi/services/SIPIX/SendRequest", - "WSDL_FILE": "./sipix-2.0.0.wsdl", - "DEFAULT_CUSTOMER_ID": 1234 - } - } - ' - - service: - type: LoadBalancer - ports: - provisioning: - name: tcp-prov - externalPort: 8080 - internalPort: 8080 - query: - name: tcp-query - externalPort: 15353 - internalPort: 15353 - - annotations: - service.beta.kubernetes.io/aws-load-balancer-type: "nlb" - - # This allows one to point the service to an external backend. - # This is useful for local development where one wishes to hijack - # the communication from the service to the node layer and point - # to a specific endpoint (IP, Port, etc). - external: - enabled: false - # 10.0.2.2 is the magic IP for the host on virtualbox's network - ip: 10.0.2.2 - ports: - provisioning: - name: tcp-prov - externalPort: 8080 - query: - name: tcp-query - externalPort: 15353 - - - ingress: - enabled: false - # Used to create an Ingress record. - hosts: - api: mock-pathfinder.local - annotations: - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - tls: - # Secrets must be manually created in the namespace. - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - - postgresql: - enabled: true - nameOverride: "mockpathfinder-postgresql" - ## Create a database user - postgresUser: mock-pathfinder - ## Default: random 10 character string - postgresPassword: IypvXbJ1Zb - - service: - type: LoadBalancer - port: 5432 - externalIPs: [] - -postgresql: - enabled: true - nameOverride: "centraldirectory-postgresql" - ## postgres image repository - image: "postgres" - ## postgres image version - ## ref: https://hub.docker.com/r/library/postgres/tags/ - ## - imageTag: "9.6.2" - - ## Specify a imagePullPolicy - ## 'Always' if imageTag is 'latest', else set to 'IfNotPresent' - ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images - ## - # imagePullPolicy: - - ## Create a database user - ## Default: postgres - postgresUser: central-directory - ## Default: random 10 character string - postgresPassword: gR5hARbsfa - - ## Create a database - ## Default: the postgres user - postgresDatabase: central_directory - - ## Specify initdb arguments, e.g. --data-checksums - ## ref: https://github.com/docker-library/docs/blob/master/postgres/content.md#postgres_initdb_args - ## ref: https://www.postgresql.org/docs/current/static/app-initdb.html - # postgresInitdbArgs: - - ## Persist data to a persitent volume - persistence: - enabled: false - - ## A manually managed Persistent Volume and Claim - ## Requires persistence.enabled: true - ## If defined, PVC must be created manually before volume will be bound - # existingClaim: - - ## database data Persistent Volume Storage Class - ## If defined, storageClassName: - ## If set to "-", storageClassName: "", which disables dynamic provisioning - ## If undefined (the default) or set to null, no storageClassName spec is - ## set, choosing the default provisioner. (gp2 on AWS, standard on - ## GKE, AWS & OpenStack) - ## - # storageClass: "-" - accessMode: ReadWriteOnce - size: 8Gi - subPath: "postgresql-db" - - metrics: - enabled: false - image: wrouesnel/postgres_exporter - imageTag: v0.1.1 - imagePullPolicy: IfNotPresent - resources: - requests: - memory: 256Mi - cpu: 100m - ## Define additional custom metrics - ## ref: https://github.com/wrouesnel/postgres_exporter#adding-new-metrics-via-a-config-file - # customMetrics: - # pg_database: - # query: "SELECT d.datname AS name, CASE WHEN pg_catalog.has_database_privilege(d.datname, 'CONNECT') THEN pg_catalog.pg_database_size(d.datname) ELSE 0 END AS size FROM pg_catalog.pg_database d where datname not in ('template0', 'template1', 'postgres')" - # metrics: - # - name: - # usage: "LABEL" - # description: "Name of the database" - # - size_bytes: - # usage: "GAUGE" - # description: "Size of the database in bytes" - - ## Configure resource requests and limits - ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ - ## - resources: - requests: - memory: 256Mi - cpu: 100m - - service: - type: LoadBalancer - port: 5432 - externalIPs: [] diff --git a/centralenduserregistry/values.aws.yaml b/centralenduserregistry/values.aws.yaml deleted file mode 100644 index f77c3aec2..000000000 --- a/centralenduserregistry/values.aws.yaml +++ /dev/null @@ -1,170 +0,0 @@ -# Default values for central-end-user-registry. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. -replicaCount: 1 -image: - repository: mojaloop/central-end-user-registry - tag: latest - pullPolicy: IfNotPresent - -readinessProbe: - enabled: true - httpGet: - path: /health - initialDelaySeconds: 45 - periodSeconds: 15 - -livenessProbe: - enabled: true - httpGet: - path: /health - initialDelaySeconds: 45 - periodSeconds: 15 - -config: - default_json: ' - { - "PORT": $service_port, - "HOSTNAME": "http://$ingress_host" - } -' - -init: - enabled: true - -service: - type: LoadBalancer - ports: - api: - name: http-api - externalPort: 3001 - internalPort: 3001 - - annotations: - service.beta.kubernetes.io/aws-load-balancer-type: "nlb" - - # This allows one to point the service to an external backend. - # This is useful for local development where one wishes to hijack - # the communication from the service to the node layer and point - # to a specific endpoint (IP, Port, etc). - external: - enabled: false - # 10.0.2.2 is the magic IP for the host on virtualbox's network - ip: 10.0.2.2 - ports: - provisioning: - name: http-api - externalPort: 3001 - -ingress: - enabled: false - externalPath: / - # Used to create an Ingress record. - hosts: - api: central-end-user-registry.local - annotations: - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - tls: - # Secrets must be manually created in the namespace. - # - secretName: chart-example-tls - # hosts: - # - chart-example.local -resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - -postgresql: - enabled: true - nameOverride: "centralenduserregistry-postgresql" - ## postgres image repository - image: "postgres" - ## postgres image version - ## ref: https://hub.docker.com/r/library/postgres/tags/ - ## - imageTag: "9.6.2" - - ## Specify a imagePullPolicy - ## 'Always' if imageTag is 'latest', else set to 'IfNotPresent' - ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images - ## - # imagePullPolicy: - - ## Create a database user - ## Default: postgres - postgresUser: end_user_registry - ## Default: random 10 character string - postgresPassword: yGnTC07WQ6 - - ## Create a database - ## Default: the postgres user - postgresDatabase: central_end_user_registry - - ## Specify initdb arguments, e.g. --data-checksums - ## ref: https://github.com/docker-library/docs/blob/master/postgres/content.md#postgres_initdb_args - ## ref: https://www.postgresql.org/docs/current/static/app-initdb.html - # postgresInitdbArgs: - - ## Persist data to a persitent volume - persistence: - enabled: false - - ## A manually managed Persistent Volume and Claim - ## Requires persistence.enabled: true - ## If defined, PVC must be created manually before volume will be bound - # existingClaim: - - ## database data Persistent Volume Storage Class - ## If defined, storageClassName: - ## If set to "-", storageClassName: "", which disables dynamic provisioning - ## If undefined (the default) or set to null, no storageClassName spec is - ## set, choosing the default provisioner. (gp2 on AWS, standard on - ## GKE, AWS & OpenStack) - ## - # storageClass: "-" - accessMode: ReadWriteOnce - size: 8Gi - subPath: "postgresql-db" - - metrics: - enabled: false - image: wrouesnel/postgres_exporter - imageTag: v0.1.1 - imagePullPolicy: IfNotPresent - resources: - requests: - memory: 256Mi - cpu: 100m - ## Define additional custom metrics - ## ref: https://github.com/wrouesnel/postgres_exporter#adding-new-metrics-via-a-config-file - # customMetrics: - # pg_database: - # query: "SELECT d.datname AS name, CASE WHEN pg_catalog.has_database_privilege(d.datname, 'CONNECT') THEN pg_catalog.pg_database_size(d.datname) ELSE 0 END AS size FROM pg_catalog.pg_database d where datname not in ('template0', 'template1', 'postgres')" - # metrics: - # - name: - # usage: "LABEL" - # description: "Name of the database" - # - size_bytes: - # usage: "GAUGE" - # description: "Size of the database in bytes" - - ## Configure resource requests and limits - ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ - ## - resources: - requests: - memory: 256Mi - cpu: 100m - - service: - type: LoadBalancer - port: 5432 - externalIPs: [] diff --git a/centralhub/Chart.yaml b/centralhub/Chart.yaml index 103669090..e3827f924 100644 --- a/centralhub/Chart.yaml +++ b/centralhub/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 description: Central-Hub Helm chart for Kubernetes name: centralhub -version: 0.1.0 +version: 0.2.0 home: http://mojaloop.io icon: http://mojaloop.io/images/logo.png sources: diff --git a/centralhub/requirements.yaml b/centralhub/requirements.yaml index e66eb73fb..f376211ef 100644 --- a/centralhub/requirements.yaml +++ b/centralhub/requirements.yaml @@ -1,6 +1,6 @@ # requirements.yaml dependencies: - name: centralledger - version: 0.1.0 + version: 0.2.0 repository: "file://../centralledger" condition: centralledger.enabled diff --git a/centralhub/values.aws.yaml b/centralhub/values.aws.yaml deleted file mode 100644 index e1460c61f..000000000 --- a/centralhub/values.aws.yaml +++ /dev/null @@ -1,422 +0,0 @@ -# Default values for central-kms. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -replicaCount: 1 -image: - repository: mojaloop/central-hub - tag: latest - pullPolicy: IfNotPresent - -readinessProbe: - enabled: true - httpGet: - path: /health - initialDelaySeconds: 45 - periodSeconds: 15 - -livenessProbe: - enabled: true - httpGet: - path: /health - initialDelaySeconds: 45 - periodSeconds: 15 - -config: - default_json: ' - { - "PORT": "$service_port", - "HOSTNAME": "http://$ingress_host", - "API_URL": "http://$centralledger_host:$centralledger_api_port", - "ADMIN_API_URL": "http://$centralledger_host:$centralledger_admin_port" - } -' - -service: - name: http-api-and-web - type: LoadBalancer - externalPort: 4001 - internalPort: 4001 - - annotations: - service.beta.kubernetes.io/aws-load-balancer-type: "nlb" - - # This allows one to point the service to an external backend. - # This is useful for local development where one wishes to hijack - # the communication from the service to the node layer and point - # to a specific endpoint (IP, Port, etc). - external: - enabled: false - # 10.0.2.2 is the magic IP for the host on virtualbox's network - ip: 10.0.2.2 - ports: - api: - name: http-api-and-web - externalPort: 4001 - -ingress: - enabled: true - # Used to create an Ingress record. - hosts: - - central-hub.local - - externalPath: / - - annotations: - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - - tls: - # Secrets must be manually created in the namespace. - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - -resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - -centralledger: - enabled: true - nameOverride: centralledger - replicaCount: 1 - containers: - api: - image: - repository: mojaloop/central-ledger - tag: latest - pullPolicy: IfNotPresent - command: '["node", "src/api/index.js"]' - service: - ports: - api: - name: http-api - externalPort: 3000 - internalPort: 3000 - readinessProbe: - enabled: true - httpGet: - path: /health - initialDelaySeconds: 120 - periodSeconds: 15 - livenessProbe: - enabled: true - httpGet: - path: /health - initialDelaySeconds: 90 - periodSeconds: 15 - - admin: - image: - repository: mojaloop/central-ledger - tag: latest - pullPolicy: IfNotPresent - command: '["node", "src/admin/index.js"]' - service: - ports: - api: - name: http-api-admin - externalPort: 3001 - internalPort: 3001 - readinessProbe: - enabled: true - httpGet: - path: /health - initialDelaySeconds: 120 - periodSeconds: 15 - livenessProbe: - enabled: true - httpGet: - path: /health - initialDelaySeconds: 90 - periodSeconds: 15 - - - config: - default_json: ' - { - "PORT": $service_api_port, - "ADMIN_PORT": $service_admin_port, - "HOSTNAME": "$ingress_host", - "ENABLE_TOKEN_AUTH": false, - "ENABLE_BASIC_AUTH": false, - "LEDGER_ACCOUNT_NAME": "LedgerName", - "LEDGER_ACCOUNT_PASSWORD": "LedgerPassword", - "AMOUNT": { - "PRECISION": 10, - "SCALE": 2 - }, - "SIDECAR": { - "DISABLED": false, - "HOST": "$forensicloggingsidecar_host", - "PORT": $forensicloggingsidecar_port, - "CONNECT_TIMEOUT": 45000, - "RECONNECT_INTERVAL": 5000 - } - } - ' - - init: - enabled: true - image: - name: wait-for-postgres - repository: bowerswilkins/awaitpostgres - tag: latest - pullPolicy: IfNotPresent - - service: - type: LoadBalancer - - annotations: - service.beta.kubernetes.io/aws-load-balancer-type: "nlb" - - # This allows one to point the service to an external backend. - # This is useful for local development where one wishes to hijack - # the communication from the service to the node layer and point - # to a specific endpoint (IP, Port, etc). - external: - enabled: false - # 10.0.2.2 is the magic IP for the host on virtualbox's network - ip: 10.0.2.2 - ports: - api: - name: http-api - externalPort: 3000 - admin: - name: http-api-admin - externalPort: 3001 - - ingress: - enabled: true - externalPath: - api: / - admin: /admin/ - # Used to create an Ingress record. - hosts: - api: central-ledger.local - annotations: - nginx.ingress.kubernetes.io/rewrite-target: '/' - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - tls: - # Secrets must be manually created in the namespace. - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - - forensicloggingsidecar: - enabled: true - nameOverride: "forensicloggingsidecar-ledger" - replicaCount: 1 - image: - repository: mojaloop/forensic-logging-sidecar - tag: latest - pullPolicy: IfNotPresent - # command: '["sleep", "100000000"]' - service: - name: http-api-and-ws - type: LoadBalancer - externalPort: 5678 - internalPort: 5678 - - annotations: - service.beta.kubernetes.io/aws-load-balancer-type: "nlb" - - # This allows one to point the service to an external backend. - # This is useful for local development where one wishes to hijack - # the communication from the service to the node layer and point - # to a specific endpoint (IP, Port, etc). - external: - enabled: false - # 10.0.2.2 is the magic IP for the host on virtualbox's network - ip: 10.0.2.2 - ports: - api: - name: http-api-and-ws - externalPort: 5678 - - readinessProbe: - enabled: true - initialDelaySeconds: 90 - periodSeconds: 15 - - livenessProbe: - enabled: true - initialDelaySeconds: 90 - periodSeconds: 15 - - ingress: - enabled: false - # Used to create an Ingress record. - hosts: - api: forensic-logging-sidecar.local - - externalPath: / - - annotations: - # kubernetes.io/ingress.class: nginx - - tls: - # Secrets must be manually created in the namespace. - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - - config: - default_json: ' - { - "PORT": $servicePort, - "SERVICE": "$serviceName", - "BATCH_SIZE": 64, - "BATCH_TIME_INTERVAL": 300000, - "KMS": { - "URL": "ws://$kmsHost:$kmsPort/sidecar", - "PING_INTERVAL": 30000, - "REQUEST_TIMEOUT": 90000, - "CONNECT_TIMEOUT": 60000, - "RECONNECT_INTERVAL": 10000 - } - } - ' - centralkms: - enabled: true - nameOverride: "centralkms" - replicaCount: 1 - image: - repository: mojaloop/central-kms - tag: latest - pullPolicy: IfNotPresent - - service: - name: http-api-and-tcp-websocket - # type: ClusterIP - type: LoadBalancer - externalPort: 8080 - internalPort: 8080 - - annotations: - service.beta.kubernetes.io/aws-load-balancer-type: "nlb" - - # This allows one to point the service to an external backend. - # This is useful for local development where one wishes to hijack - # the communication from the service to the node layer and point - # to a specific endpoint (IP, Port, etc). - external: - enabled: false - # 10.0.2.2 is the magic IP for the host on virtualbox's network - ip: 10.0.2.2 - ports: - api: - name: http-api-and-tcp-websocket - externalPort: 8080 - - readinessProbe: - enabled: true - httpGet: - path: /sidecars - initialDelaySeconds: 45 - periodSeconds: 15 - - livenessProbe: - enabled: true - httpGet: - path: /sidecars - initialDelaySeconds: 45 - periodSeconds: 15 - - ingress: - enabled: true - # Used to create an Ingress record. - hosts: - - central-kms.local - externalPath: / - - annotations: - # kubernetes.io/ingress.class: nginx - - tls: - # Secrets must be manually created in the namespace. - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - - resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - - postgresql: - enabled: true - nameOverride: "centralkms-postgresql" - ## Create a database user - postgresUser: kms - ## Default: random 10 character string - postgresPassword: xD873IyaQB - - service: - type: LoadBalancer - port: 5432 - externalIPs: [] - - postgresql: - enabled: true - nameOverride: "forensicloggingsidecar-ledger-postgresql" - ## Create a database user - postgresUser: sidecar - ## Default: random 10 character string - postgresPassword: Wqt0KlkKvL - - service: - type: LoadBalancer - port: 5432 - externalIPs: [] - - postgresql: - enabled: true - nameOverride: "centralledger-postgresql" - ## Create a database user - postgresUser: central_ledger - ## Default: random 10 character string - postgresPassword: oyMxgZChuu - - service: - type: LoadBalancer - port: 5432 - externalIPs: [] diff --git a/centralhub/values.yaml b/centralhub/values.yaml index 4fa93245e..71c6e9896 100644 --- a/centralhub/values.yaml +++ b/centralhub/values.yaml @@ -86,6 +86,9 @@ resources: {} centralledger: enabled: true nameOverride: centralledger + # Default values for central-ledger. + # This is a YAML-formatted file. + # Declare variables to be passed into your templates. replicaCount: 1 containers: api: @@ -140,7 +143,12 @@ centralledger: config: - default_json: ' + # db_type can either be 'postgres' or 'mysql'. Ensure the correct DB is enabled and configured below: postgresql.enabled or mysql.enabled + db_type: 'postgres' + # db_driver can either be 'pg' or 'mysql'. Ensure the correct corresponding db_type above has been set. + db_driver: 'pg' + # default_json config for nodejs. The following variables will be injected by the helm chart (see config.yaml): $service_admin_port, $ingress_hostm $forensicloggingsidecar_host, $forensicloggingsidecar_port + default_json: | { "PORT": $service_api_port, "ADMIN_PORT": $service_admin_port, @@ -161,7 +169,21 @@ centralledger: "RECONNECT_INTERVAL": 5000 } } - ' + # default_json config for nodejs db knex lib. The following variables will be injected by the helm chart (see config.yaml): $db_driver + knexfile_js: | + 'use strict' + + const migrationsDirectory = '/opt/central-ledger/migrations' + const Config = require('/opt/central-ledger/src/lib/config') + module.exports = { + client: '$db_driver', + connection: Config.DATABASE_URI, + migrations: { + directory: migrationsDirectory, + tableName: 'migrations', + stub: `${migrationsDirectory}/migration.template` + } + } init: enabled: true @@ -194,12 +216,14 @@ centralledger: ingress: enabled: true + type: http externalPath: api: / admin: /admin/ # Used to create an Ingress record. hosts: api: central-ledger.local + admin: central-ledger.local annotations: nginx.ingress.kubernetes.io/rewrite-target: '/' # kubernetes.io/ingress.class: nginx @@ -235,7 +259,7 @@ centralledger: type: ClusterIP externalPort: 5678 internalPort: 5678 - + annotations: {} # This allows one to point the service to an external backend. @@ -288,7 +312,7 @@ centralledger: # requests: # cpu: 100m # memory: 128Mi - + config: default_json: ' { @@ -319,9 +343,9 @@ centralledger: type: ClusterIP externalPort: 8080 internalPort: 8080 - - annotations: {} + annotations: {} + # This allows one to point the service to an external backend. # This is useful for local development where one wishes to hijack # the communication from the service to the node layer and point @@ -339,15 +363,15 @@ centralledger: enabled: true httpGet: path: /sidecars - initialDelaySeconds: 45 - periodSeconds: 15 + initialDelaySeconds: 30 + periodSeconds: 5 livenessProbe: enabled: true httpGet: path: /sidecars - initialDelaySeconds: 45 - periodSeconds: 15 + initialDelaySeconds: 30 + periodSeconds: 5 ingress: enabled: true @@ -397,7 +421,7 @@ centralledger: postgresUser: sidecar ## Default: random 10 character string postgresPassword: Wqt0KlkKvL - + service: type: ClusterIP port: 5432 @@ -406,11 +430,180 @@ centralledger: postgresql: enabled: true nameOverride: "centralledger-postgresql" + ## postgres image repository + image: "postgres" + ## postgres image version + ## ref: https://hub.docker.com/r/library/postgres/tags/ + ## + imageTag: "9.6.2" + + ## Specify a imagePullPolicy + ## 'Always' if imageTag is 'latest', else set to 'IfNotPresent' + ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images + ## + # imagePullPolicy: + ## Create a database user + ## Default: postgres postgresUser: central_ledger ## Default: random 10 character string postgresPassword: oyMxgZChuu + ## Create a database + ## Default: the postgres user + postgresDatabase: central_ledger + + ## Specify initdb arguments, e.g. --data-checksums + ## ref: https://github.com/docker-library/docs/blob/master/postgres/content.md#postgres_initdb_args + ## ref: https://www.postgresql.org/docs/current/static/app-initdb.html + # postgresInitdbArgs: + + ## Persist data to a persitent volume + persistence: + enabled: false + + ## A manually managed Persistent Volume and Claim + ## Requires persistence.enabled: true + ## If defined, PVC must be created manually before volume will be bound + # existingClaim: + + ## database data Persistent Volume Storage Class + ## If defined, storageClassName: + ## If set to "-", storageClassName: "", which disables dynamic provisioning + ## If undefined (the default) or set to null, no storageClassName spec is + ## set, choosing the default provisioner. (gp2 on AWS, standard on + ## GKE, AWS & OpenStack) + ## + # storageClass: "-" + accessMode: ReadWriteOnce + size: 8Gi + subPath: "postgresql-db" + + metrics: + enabled: false + image: wrouesnel/postgres_exporter + imageTag: v0.1.1 + imagePullPolicy: IfNotPresent + resources: + requests: + memory: 256Mi + cpu: 100m + ## Define additional custom metrics + ## ref: https://github.com/wrouesnel/postgres_exporter#adding-new-metrics-via-a-config-file + # customMetrics: + # pg_database: + # query: "SELECT d.datname AS name, CASE WHEN pg_catalog.has_database_privilege(d.datname, 'CONNECT') THEN pg_catalog.pg_database_size(d.datname) ELSE 0 END AS size FROM pg_catalog.pg_database d where datname not in ('template0', 'template1', 'postgres')" + # metrics: + # - name: + # usage: "LABEL" + # description: "Name of the database" + # - size_bytes: + # usage: "GAUGE" + # description: "Size of the database in bytes" + + ## Configure resource requests and limits + ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ + ## + resources: + requests: + memory: 256Mi + cpu: 100m + + service: + type: ClusterIP + port: 5432 + externalIPs: [] + + mysql: + enabled: false + nameOverride: "centralledger-mysql" + # Default values for Percona XtraDB Cluster + + ## percona image and version + ## ref: https://hub.docker.com/r/percona/percona-xtradb-cluster/tags/ + image: + repository: "percona/percona-xtradb-cluster" + tag: "5.7.19" + pullPolicy: IfNotPresent + + # Desired number of members of xtradb cluster + replicas: 1 + + ## Specify password for root user + ## + # mysqlRootPassword: not-a-secure-password + + ## Specify password for xtradb backup user + ## + # xtraBackupPassword: replicate-my-data + + ## Uncomment to create a database user + ## + mysqlUser: test + mysqlPassword: test + + ## Allow unauthenticated access, uncomment to enable + ## + # mysqlAllowEmptyPassword: true + + ## Uncomment to Create a database + ## + mysqlDatabase: test + + ## hosts to allow root user access from + # set to "127.0.0.1" to deny remote root. + allowRootFrom: "%" + + ## Persist data to a persitent volume + persistence: + enabled: false + ## percona data Persistent Volume Storage Class + ## If defined, storageClassName: + ## If set to "-", storageClassName: "", which disables dynamic provisioning + ## If undefined (the default) or set to null, no storageClassName spec is + ## set, choosing the default provisioner. (gp2 on AWS, standard on + ## GKE, AWS & OpenStack) + ## + # storageClass: "-" + accessMode: ReadWriteOnce + size: 8Gi + + ## Node labels for pod assignment + ## Ref: https://kubernetes.io/docs/user-guide/node-selection/ + ## + nodeSelector: {} + + ## Configure resource requests and limits + ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ + ## + # resources: + # requests: + # memory: 256Mi + # cpu: 100m + + configFiles: + node.cnf: |+ + [mysqld] + datadir=/var/lib/mysql + default_storage_engine=InnoDB + binlog_format=ROW + innodb_flush_log_at_trx_commit = 0 + innodb_flush_method = O_DIRECT + innodb_file_per_table = 1 + innodb_autoinc_lock_mode=2 + bind_address = 0.0.0.0 + wsrep_slave_threads=2 + wsrep_cluster_address=gcomm:// + wsrep_provider=/usr/lib/galera3/libgalera_smm.so + wsrep_cluster_name=galera + wsrep_sst_method=xtrabackup-v2 + ## When set to true will create sidecar for `prom/mysqld-exporter` + ## metrics exporting + metricsExporter: false + + ## When set to true will create sidecar to tail mysql log + logTail: true + service: type: ClusterIP port: 5432 diff --git a/centralkms/values.aws.yaml b/centralkms/values.aws.yaml deleted file mode 100644 index 3fd2ffb3f..000000000 --- a/centralkms/values.aws.yaml +++ /dev/null @@ -1,167 +0,0 @@ -# Default values for central-kms. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -replicaCount: 1 -image: - repository: mojaloop/central-kms - tag: latest - pullPolicy: IfNotPresent - -service: - name: http-api-and-tcp-websocket - type: LoadBalancer - externalPort: 8080 - internalPort: 8080 - - annotations: - service.beta.kubernetes.io/aws-load-balancer-type: "nlb" - # this is status quo - # service.beta.kubernetes.io/aws-load-balancer-internal: 0.0.0.0/0 - # service.beta.kubernetes.io/aws-load-balancer-backend-protocol: tcp - # this is beta - # service.beta.kubernetes.io/aws-load-balancer-type: "nlb" - - # This allows one to point the service to an external backend. - # This is useful for local development where one wishes to hijack - # the communication from the service to the node layer and point - # to a specific endpoint (IP, Port, etc). - external: - enabled: false - # 10.0.2.2 is the magic IP for the host on virtualbox's network - ip: 10.0.2.2 - ports: - api: - name: http-api-and-tcp-websocket - externalPort: 8080 - -readinessProbe: - enabled: true - httpGet: - path: /sidecars - initialDelaySeconds: 30 - periodSeconds: 15 - -livenessProbe: - enabled: true - httpGet: - path: /sidecars - initialDelaySeconds: 30 - periodSeconds: 15 - -ingress: - enabled: true - # Used to create an Ingress record. - hosts: - - central-kms.local - - externalPath: / - - annotations: - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - - tls: - # Secrets must be manually created in the namespace. - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - -resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - -postgresql: - enabled: true - nameOverride: "centralkms-postgresql" - ## postgres image repository - image: "postgres" - ## postgres image version - ## ref: https://hub.docker.com/r/library/postgres/tags/ - ## - imageTag: "9.6.2" - - ## Specify a imagePullPolicy - ## 'Always' if imageTag is 'latest', else set to 'IfNotPresent' - ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images - ## - # imagePullPolicy: - - ## Create a database user - ## Default: postgres - postgresUser: kms - ## Default: random 10 character string - postgresPassword: xD873IyaQB - - ## Create a database - ## Default: the postgres user - postgresDatabase: central_kms - - ## Specify initdb arguments, e.g. --data-checksums - ## ref: https://github.com/docker-library/docs/blob/master/postgres/content.md#postgres_initdb_args - ## ref: https://www.postgresql.org/docs/current/static/app-initdb.html - # postgresInitdbArgs: - - ## Persist data to a persitent volume - persistence: - enabled: false - - ## A manually managed Persistent Volume and Claim - ## Requires persistence.enabled: true - ## If defined, PVC must be created manually before volume will be bound - # existingClaim: - - ## database data Persistent Volume Storage Class - ## If defined, storageClassName: - ## If set to "-", storageClassName: "", which disables dynamic provisioning - ## If undefined (the default) or set to null, no storageClassName spec is - ## set, choosing the default provisioner. (gp2 on AWS, standard on - ## GKE, AWS & OpenStack) - ## - # storageClass: "-" - accessMode: ReadWriteOnce - size: 8Gi - subPath: "postgresql-db" - - metrics: - enabled: false - image: wrouesnel/postgres_exporter - imageTag: v0.1.1 - imagePullPolicy: IfNotPresent - resources: - requests: - memory: 256Mi - cpu: 100m - ## Define additional custom metrics - ## ref: https://github.com/wrouesnel/postgres_exporter#adding-new-metrics-via-a-config-file - # customMetrics: - # pg_database: - # query: "SELECT d.datname AS name, CASE WHEN pg_catalog.has_database_privilege(d.datname, 'CONNECT') THEN pg_catalog.pg_database_size(d.datname) ELSE 0 END AS size FROM pg_catalog.pg_database d where datname not in ('template0', 'template1', 'postgres')" - # metrics: - # - name: - # usage: "LABEL" - # description: "Name of the database" - # - size_bytes: - # usage: "GAUGE" - # description: "Size of the database in bytes" - - ## Configure resource requests and limits - ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ - ## - resources: - requests: - memory: 256Mi - cpu: 100m - - service: - type: LoadBalancer - port: 5432 - externalIPs: [] \ No newline at end of file diff --git a/centralledger/Chart.yaml b/centralledger/Chart.yaml index af171b00c..fae301cea 100644 --- a/centralledger/Chart.yaml +++ b/centralledger/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 description: Central-Ledger Helm chart for Kubernetes name: centralledger -version: 0.1.0 +version: 0.2.0 home: http://mojaloop.io icon: http://mojaloop.io/images/logo.png sources: diff --git a/centralledger/requirements.yaml b/centralledger/requirements.yaml index 9da8ddbba..64e0ef5d8 100644 --- a/centralledger/requirements.yaml +++ b/centralledger/requirements.yaml @@ -6,5 +6,9 @@ dependencies: condition: forensicloggingsidecar.enabled - name: postgresql version: 0.8.4 - repository: https://kubernetes-charts.storage.googleapis.com/ + repository: https://kubernetes-charts.storage.googleapis.com condition: postgresql.enabled +- name: percona-xtradb-cluster + version: 0.1.4 + repository: https://kubernetes-charts.storage.googleapis.com + condition: mysql.enabled diff --git a/centralledger/templates/config.yaml b/centralledger/templates/config.yaml index d490f8b48..e411ec66c 100644 --- a/centralledger/templates/config.yaml +++ b/centralledger/templates/config.yaml @@ -11,21 +11,7 @@ metadata: data: server.host: {{ .Values.ingress.hosts.api | quote }} server.port: {{ .Values.containers.api.service.ports.api.internalPort | quote }} + admin.host: {{ .Values.ingress.hosts.admin | quote }} admin.port: {{ .Values.containers.admin.service.ports.api.internalPort | quote }} - default.json: | - {{ .Values.config.default_json | replace "$service_api_port" (printf "%.0f" .Values.containers.api.service.ports.api.internalPort) | replace "$service_admin_port" (printf "%.0f" .Values.containers.admin.service.ports.api.internalPort) | replace "$ingress_host" .Values.ingress.hosts.api | replace "$forensicloggingsidecar_host" $forensicLoggingSidecarHost | replace "$forensicloggingsidecar_port" (printf "%.0f" .Values.forensicloggingsidecar.service.externalPort) }} - - knexfile.js: | - 'use strict' - - const migrationsDirectory = '/opt/central-ledger/migrations' - const Config = require('/opt/central-ledger/src/lib/config') - module.exports = { - client: 'pg', - connection: Config.DATABASE_URI, - migrations: { - directory: migrationsDirectory, - tableName: 'migrations', - stub: `${migrationsDirectory}/migration.template` - } - } + default.json: {{ (.Values.config.default_json | replace "$service_api_port" (printf "%.0f" .Values.containers.api.service.ports.api.internalPort) | replace "$service_admin_port" (printf "%.0f" .Values.containers.admin.service.ports.api.internalPort) | replace "$ingress_host" .Values.ingress.hosts.api | replace "$forensicloggingsidecar_host" $forensicLoggingSidecarHost | replace "$forensicloggingsidecar_port" (printf "%.0f" .Values.forensicloggingsidecar.service.externalPort)) | quote }} + knexfile.js: {{ (.Values.config.knexfile_js | replace "$db_driver" .Values.config.db_driver) | quote}} diff --git a/centralledger/templates/deployment.yaml b/centralledger/templates/deployment.yaml index 8f7667786..d6c4fd24f 100644 --- a/centralledger/templates/deployment.yaml +++ b/centralledger/templates/deployment.yaml @@ -16,6 +16,7 @@ spec: heritage: {{ .Release.Service }} spec: {{- if .Values.init.enabled }} + {{- if eq .Values.config.db_type "postgres"}} initContainers: - name: {{ .Values.init.image.name }} image: {{ .Values.init.image.repository }}:{{ .Values.init.image.tag }} @@ -23,6 +24,7 @@ spec: env: - name: "POSTGRES_URL" value: "postgresql://{{ .Values.postgresql.postgresUser }}:{{ .Values.postgresql.postgresPassword }}@{{ $dbHost }}:{{ .Values.postgresql.service.port }}/{{ .Values.postgresql.postgresDatabase }}?sslmode=disable" + {{- end }} {{- end }} containers: - name: {{ template "centralledger.name" . }} diff --git a/centralledger/templates/ingress.yaml b/centralledger/templates/ingress.yaml index 4253668e2..b10952efb 100644 --- a/centralledger/templates/ingress.yaml +++ b/centralledger/templates/ingress.yaml @@ -22,6 +22,9 @@ spec: backend: serviceName: {{ $serviceName }} servicePort: {{ .Values.containers.api.service.ports.api.externalPort }} + - host: {{ .Values.ingress.hosts.admin }} + http: + paths: - path: {{ .Values.ingress.externalPath.admin }} backend: serviceName: {{ $serviceName }} diff --git a/centralledger/templates/secret.yaml b/centralledger/templates/secret.yaml index fd1da8f7e..ea2033ff4 100644 --- a/centralledger/templates/secret.yaml +++ b/centralledger/templates/secret.yaml @@ -1,4 +1,3 @@ -{{- $dbHost := printf "%s-%s" .Release.Name .Values.postgresql.nameOverride -}} apiVersion: v1 kind: Secret metadata: @@ -11,4 +10,9 @@ metadata: type: Opaque data: # base64 encoded string - db.uri: {{ printf "postgres://%s:%s@%s:%.0f/%s" .Values.postgresql.postgresUser .Values.postgresql.postgresPassword $dbHost .Values.postgresql.service.port .Values.postgresql.postgresDatabase | b64enc }} + {{- if eq .Values.config.db_type "postgres"}} + db.uri: {{ printf "%s://%s:%s@%s:%.0f/%s" .Values.config.db_type .Values.postgresql.postgresUser .Values.postgresql.postgresPassword (printf "%s-%s" .Release.Name .Values.postgresql.nameOverride) .Values.postgresql.service.port .Values.postgresql.postgresDatabase | b64enc }} + {{- end }} + {{- if eq .Values.config.db_type "mysql"}} + db.uri: {{ printf "%s://%s:%s@%s:%.0f/%s" .Values.config.db_type .Values.mysql.mysqlUser .Values.mysql.mysqlPassword (printf "%s-%s" .Release.Name .Values.mysql.nameOverride) .Values.mysql.service.port .Values.mysql.mysqlDatabase | b64enc }} + {{- end }} diff --git a/centralledger/values.aws.yaml b/centralledger/values.aws.yaml deleted file mode 100644 index c6b4fe101..000000000 --- a/centralledger/values.aws.yaml +++ /dev/null @@ -1,413 +0,0 @@ -# Default values for central-ledger. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. -replicaCount: 1 -containers: - api: - image: - repository: mojaloop/central-ledger - tag: latest - pullPolicy: IfNotPresent - command: '["node", "src/api/index.js"]' - service: - ports: - api: - name: http-api - externalPort: 3000 - internalPort: 3000 - readinessProbe: - enabled: true - httpGet: - path: /health - initialDelaySeconds: 120 - periodSeconds: 15 - livenessProbe: - enabled: true - httpGet: - path: /health - initialDelaySeconds: 90 - periodSeconds: 15 - - admin: - image: - repository: mojaloop/central-ledger - tag: latest - pullPolicy: IfNotPresent - command: '["node", "src/admin/index.js"]' - service: - ports: - api: - name: http-api-admin - externalPort: 3001 - internalPort: 3001 - readinessProbe: - enabled: true - httpGet: - path: /health - initialDelaySeconds: 120 - periodSeconds: 15 - livenessProbe: - enabled: true - httpGet: - path: /health - initialDelaySeconds: 90 - periodSeconds: 15 - - -config: - default_json: ' - { - "PORT": $service_api_port, - "ADMIN_PORT": $service_admin_port, - "HOSTNAME": "$ingress_host", - "ENABLE_TOKEN_AUTH": false, - "ENABLE_BASIC_AUTH": false, - "LEDGER_ACCOUNT_NAME": "LedgerName", - "LEDGER_ACCOUNT_PASSWORD": "LedgerPassword", - "AMOUNT": { - "PRECISION": 10, - "SCALE": 2 - }, - "SIDECAR": { - "DISABLED": false, - "HOST": "$forensicloggingsidecar_host", - "PORT": $forensicloggingsidecar_port, - "CONNECT_TIMEOUT": 45000, - "RECONNECT_INTERVAL": 5000 - } - } -' - -init: - enabled: true - image: - name: wait-for-postgres - repository: bowerswilkins/awaitpostgres - tag: latest - pullPolicy: IfNotPresent - -service: - type: LoadBalancer - annotations: - service.beta.kubernetes.io/aws-load-balancer-type: "nlb" - # This allows one to point the service to an external backend. - # This is useful for local development where one wishes to hijack - # the communication from the service to the node layer and point - # to a specific endpoint (IP, Port, etc). - external: - enabled: false - # 10.0.2.2 is the magic IP for the host on virtualbox's network - ip: 10.0.2.2 - ports: - api: - name: http-api - externalPort: 3000 - admin: - name: http-api-admin - externalPort: 3001 - -ingress: - enabled: true - externalPath: - api: / - admin: /admin/ - # Used to create an Ingress record. - hosts: - api: central-ledger.local - annotations: - nginx.ingress.kubernetes.io/rewrite-target: '/' - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - tls: - # Secrets must be manually created in the namespace. - # - secretName: chart-example-tls - # hosts: - # - chart-example.local -resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - -forensicloggingsidecar: - enabled: true - nameOverride: "forensicloggingsidecar-ledger" - replicaCount: 1 - image: - repository: mojaloop/forensic-logging-sidecar - tag: latest - pullPolicy: IfNotPresent - - service: - name: http-api-and-ws - type: LoadBalancer - externalPort: 5678 - internalPort: 5678 - - annotations: - service.beta.kubernetes.io/aws-load-balancer-type: "nlb" - - # This allows one to point the service to an external backend. - # This is useful for local development where one wishes to hijack - # the communication from the service to the node layer and point - # to a specific endpoint (IP, Port, etc). - external: - enabled: false - # 10.0.2.2 is the magic IP for the host on virtualbox's network - ip: 10.0.2.2 - ports: - api: - name: http-api-and-ws - externalPort: 5678 - - readinessProbe: - enabled: true - initialDelaySeconds: 90 - periodSeconds: 15 - - livenessProbe: - enabled: true - initialDelaySeconds: 90 - periodSeconds: 15 - - ingress: - enabled: false - # Used to create an Ingress record. - hosts: - api: forensic-logging-sidecar.local - - externalPath: / - - annotations: - # kubernetes.io/ingress.class: nginx - - tls: - # Secrets must be manually created in the namespace. - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - - config: - default_json: ' - { - "PORT": $servicePort, - "SERVICE": "$serviceName", - "BATCH_SIZE": 64, - "BATCH_TIME_INTERVAL": 300000, - "KMS": { - "URL": "ws://$kmsHost:$kmsPort/sidecar", - "PING_INTERVAL": 30000, - "REQUEST_TIMEOUT": 90000, - "CONNECT_TIMEOUT": 60000, - "RECONNECT_INTERVAL": 10000 - } - } - ' - - centralkms: - enabled: true - nameOverride: "centralkms" - replicaCount: 1 - image: - repository: mojaloop/central-kms - tag: latest - pullPolicy: IfNotPresent - - service: - name: http-api-and-tcp-websocket - type: LoadBalancer - externalPort: 8080 - internalPort: 8080 - - annotations: - service.beta.kubernetes.io/aws-load-balancer-type: "nlb" - - # This allows one to point the service to an external backend. - # This is useful for local development where one wishes to hijack - # the communication from the service to the node layer and point - # to a specific endpoint (IP, Port, etc). - external: - enabled: false - # 10.0.2.2 is the magic IP for the host on virtualbox's network - ip: 10.0.2.2 - ports: - api: - name: http-api-and-tcp-websocket - externalPort: 8080 - - readinessProbe: - enabled: true - httpGet: - path: /sidecars - initialDelaySeconds: 30 - periodSeconds: 15 - - livenessProbe: - enabled: true - httpGet: - path: /sidecars - initialDelaySeconds: 30 - periodSeconds: 15 - - ingress: - enabled: true - # Used to create an Ingress record. - hosts: - - central-kms.local - externalPath: / - - annotations: - # kubernetes.io/ingress.class: nginx - - tls: - # Secrets must be manually created in the namespace. - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - - resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - - postgresql: - enabled: true - nameOverride: "centralkms-postgresql" - ## Create a database user - postgresUser: kms - ## Default: random 10 character string - postgresPassword: xD873IyaQB - - service: - type: LoadBalancer - port: 5432 - externalIPs: [] - - postgresql: - enabled: true - nameOverride: "forensicloggingsidecar-ledger-postgresql" - ## Create a database user - postgresUser: sidecar - ## Default: random 10 character string - postgresPassword: Wqt0KlkKvL - - service: - type: LoadBalancer - port: 5432 - externalIPs: [] - -postgresql: - enabled: true - nameOverride: "centralledger-postgresql" - ## postgres image repository - image: "postgres" - ## postgres image version - ## ref: https://hub.docker.com/r/library/postgres/tags/ - ## - imageTag: "9.6.2" - - ## Specify a imagePullPolicy - ## 'Always' if imageTag is 'latest', else set to 'IfNotPresent' - ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images - ## - # imagePullPolicy: - - ## Create a database user - ## Default: postgres - postgresUser: central_ledger - ## Default: random 10 character string - postgresPassword: oyMxgZChuu - - ## Create a database - ## Default: the postgres user - postgresDatabase: central_ledger - - ## Specify initdb arguments, e.g. --data-checksums - ## ref: https://github.com/docker-library/docs/blob/master/postgres/content.md#postgres_initdb_args - ## ref: https://www.postgresql.org/docs/current/static/app-initdb.html - # postgresInitdbArgs: - - ## Persist data to a persitent volume - persistence: - enabled: false - - ## A manually managed Persistent Volume and Claim - ## Requires persistence.enabled: true - ## If defined, PVC must be created manually before volume will be bound - # existingClaim: - - ## database data Persistent Volume Storage Class - ## If defined, storageClassName: - ## If set to "-", storageClassName: "", which disables dynamic provisioning - ## If undefined (the default) or set to null, no storageClassName spec is - ## set, choosing the default provisioner. (gp2 on AWS, standard on - ## GKE, AWS & OpenStack) - ## - # storageClass: "-" - accessMode: ReadWriteOnce - size: 8Gi - subPath: "postgresql-db" - - service: - type: LoadBalancer - port: 5432 - externalIPs: [] - - metrics: - enabled: false - image: wrouesnel/postgres_exporter - imageTag: v0.1.1 - imagePullPolicy: IfNotPresent - resources: - requests: - memory: 256Mi - cpu: 100m - ## Define additional custom metrics - ## ref: https://github.com/wrouesnel/postgres_exporter#adding-new-metrics-via-a-config-file - # customMetrics: - # pg_database: - # query: "SELECT d.datname AS name, CASE WHEN pg_catalog.has_database_privilege(d.datname, 'CONNECT') THEN pg_catalog.pg_database_size(d.datname) ELSE 0 END AS size FROM pg_catalog.pg_database d where datname not in ('template0', 'template1', 'postgres')" - # metrics: - # - name: - # usage: "LABEL" - # description: "Name of the database" - # - size_bytes: - # usage: "GAUGE" - # description: "Size of the database in bytes" - - ## Configure resource requests and limits - ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ - ## - resources: - requests: - memory: 256Mi - cpu: 100m - - service: - type: LoadBalancer - port: 5432 - externalIPs: [] diff --git a/centralledger/values.yaml b/centralledger/values.yaml index ff79249f1..fb49aee0b 100644 --- a/centralledger/values.yaml +++ b/centralledger/values.yaml @@ -55,7 +55,12 @@ containers: config: - default_json: ' + # db_type can either be 'postgres' or 'mysql'. Ensure the correct DB is enabled and configured below: postgresql.enabled or mysql.enabled + db_type: 'postgres' + # db_driver can either be 'pg' or 'mysql'. Ensure the correct corresponding db_type above has been set. + db_driver: 'pg' + # default_json config for nodejs. The following variables will be injected by the helm chart (see config.yaml): $service_admin_port, $ingress_hostm $forensicloggingsidecar_host, $forensicloggingsidecar_port + default_json: | { "PORT": $service_api_port, "ADMIN_PORT": $service_admin_port, @@ -76,7 +81,21 @@ config: "RECONNECT_INTERVAL": 5000 } } -' + # default_json config for nodejs db knex lib. The following variables will be injected by the helm chart (see config.yaml): $db_driver + knexfile_js: | + 'use strict' + + const migrationsDirectory = '/opt/central-ledger/migrations' + const Config = require('/opt/central-ledger/src/lib/config') + module.exports = { + client: '$db_driver', + connection: Config.DATABASE_URI, + migrations: { + directory: migrationsDirectory, + tableName: 'migrations', + stub: `${migrationsDirectory}/migration.template` + } + } init: enabled: true @@ -109,12 +128,14 @@ service: ingress: enabled: true + type: http externalPath: api: / admin: /admin/ # Used to create an Ingress record. hosts: api: central-ledger.local + admin: central-ledger.local annotations: nginx.ingress.kubernetes.io/rewrite-target: '/' # kubernetes.io/ingress.class: nginx @@ -403,4 +424,99 @@ postgresql: service: type: ClusterIP port: 5432 - externalIPs: [] \ No newline at end of file + externalIPs: [] + +mysql: + enabled: false + nameOverride: "centralledger-mysql" + # Default values for Percona XtraDB Cluster + + ## percona image and version + ## ref: https://hub.docker.com/r/percona/percona-xtradb-cluster/tags/ + image: + repository: "percona/percona-xtradb-cluster" + tag: "5.7.19" + pullPolicy: IfNotPresent + + # Desired number of members of xtradb cluster + replicas: 1 + + ## Specify password for root user + ## + # mysqlRootPassword: not-a-secure-password + + ## Specify password for xtradb backup user + ## + # xtraBackupPassword: replicate-my-data + + ## Uncomment to create a database user + ## + mysqlUser: test + mysqlPassword: test + + ## Allow unauthenticated access, uncomment to enable + ## + # mysqlAllowEmptyPassword: true + + ## Uncomment to Create a database + ## + mysqlDatabase: test + + ## hosts to allow root user access from + # set to "127.0.0.1" to deny remote root. + allowRootFrom: "%" + + ## Persist data to a persitent volume + persistence: + enabled: false + ## percona data Persistent Volume Storage Class + ## If defined, storageClassName: + ## If set to "-", storageClassName: "", which disables dynamic provisioning + ## If undefined (the default) or set to null, no storageClassName spec is + ## set, choosing the default provisioner. (gp2 on AWS, standard on + ## GKE, AWS & OpenStack) + ## + # storageClass: "-" + accessMode: ReadWriteOnce + size: 8Gi + + ## Node labels for pod assignment + ## Ref: https://kubernetes.io/docs/user-guide/node-selection/ + ## + nodeSelector: {} + + ## Configure resource requests and limits + ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ + ## + # resources: + # requests: + # memory: 256Mi + # cpu: 100m + + configFiles: + node.cnf: |+ + [mysqld] + datadir=/var/lib/mysql + default_storage_engine=InnoDB + binlog_format=ROW + innodb_flush_log_at_trx_commit = 0 + innodb_flush_method = O_DIRECT + innodb_file_per_table = 1 + innodb_autoinc_lock_mode=2 + bind_address = 0.0.0.0 + wsrep_slave_threads=2 + wsrep_cluster_address=gcomm:// + wsrep_provider=/usr/lib/galera3/libgalera_smm.so + wsrep_cluster_name=galera + wsrep_sst_method=xtrabackup-v2 + ## When set to true will create sidecar for `prom/mysqld-exporter` + ## metrics exporting + metricsExporter: false + + ## When set to true will create sidecar to tail mysql log + logTail: true + + service: + type: ClusterIP + port: 5432 + externalIPs: [] diff --git a/config-central.yaml b/config-central.yaml deleted file mode 100644 index c9a5c3467..000000000 --- a/config-central.yaml +++ /dev/null @@ -1,749 +0,0 @@ -# Default values for central. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -centralhub: - enabled: true - replicaCount: 1 - image: - repository: mojaloop/central-hub - tag: latest - pullPolicy: IfNotPresent - - readinessProbe: - enabled: true - httpGet: - path: /health - initialDelaySeconds: 45 - periodSeconds: 15 - - livenessProbe: - enabled: true - httpGet: - path: /health - initialDelaySeconds: 45 - periodSeconds: 15 - - config: - default_json: ' - { - "PORT": "$service_port", - "HOSTNAME": "http://$ingress_host", - "API_URL": "http://$centralledger_host:$centralledger_api_port", - "ADMIN_API_URL": "http://$centralledger_host:$centralledger_admin_port" - } - ' - - service: - name: http-api-and-web - type: ClusterIP - externalPort: 4001 - internalPort: 4001 - - annotations: {} - - # This allows one to point the service to an external backend. - # This is useful for local development where one wishes to hijack - # the communication from the service to the node layer and point - # to a specific endpoint (IP, Port, etc). - external: - enabled: false - # 10.0.2.2 is the magic IP for the host on virtualbox's network - ip: 10.0.2.2 - ports: - api: - name: http-api-and-web - externalPort: 4001 - - - ingress: - enabled: true - # Used to create an Ingress record. - hosts: - - central-hub.local - - externalPath: / - - annotations: - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - - tls: - # Secrets must be manually created in the namespace. - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - - resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - - centralledger: - enabled: true - nameOverride: centralledger - replicaCount: 1 - containers: - api: - image: - repository: mojaloop/central-ledger - tag: latest - pullPolicy: IfNotPresent - command: '["node", "src/api/index.js"]' - service: - ports: - api: - name: http-api - externalPort: 3000 - internalPort: 3000 - readinessProbe: - enabled: true - httpGet: - path: /health - initialDelaySeconds: 120 - periodSeconds: 15 - livenessProbe: - enabled: true - httpGet: - path: /health - initialDelaySeconds: 90 - periodSeconds: 15 - - admin: - image: - repository: mojaloop/central-ledger - tag: latest - pullPolicy: IfNotPresent - command: '["node", "src/admin/index.js"]' - service: - ports: - api: - name: http-api-admin - externalPort: 3001 - internalPort: 3001 - readinessProbe: - enabled: true - httpGet: - path: /health - initialDelaySeconds: 120 - periodSeconds: 15 - livenessProbe: - enabled: true - httpGet: - path: /health - initialDelaySeconds: 90 - periodSeconds: 15 - - - config: - default_json: ' - { - "PORT": $service_api_port, - "ADMIN_PORT": $service_admin_port, - "HOSTNAME": "$ingress_host", - "ENABLE_TOKEN_AUTH": false, - "ENABLE_BASIC_AUTH": false, - "LEDGER_ACCOUNT_NAME": "LedgerName", - "LEDGER_ACCOUNT_PASSWORD": "LedgerPassword", - "AMOUNT": { - "PRECISION": 10, - "SCALE": 2 - }, - "SIDECAR": { - "DISABLED": false, - "HOST": "$forensicloggingsidecar_host", - "PORT": $forensicloggingsidecar_port, - "CONNECT_TIMEOUT": 45000, - "RECONNECT_INTERVAL": 5000 - } - } - ' - - init: - enabled: true - image: - name: wait-for-postgres - repository: bowerswilkins/awaitpostgres - tag: latest - pullPolicy: IfNotPresent - - service: - type: ClusterIP - - annotations: {} - - # This allows one to point the service to an external backend. - # This is useful for local development where one wishes to hijack - # the communication from the service to the node layer and point - # to a specific endpoint (IP, Port, etc). - external: - enabled: false - # 10.0.2.2 is the magic IP for the host on virtualbox's network - ip: 10.0.2.2 - ports: - api: - name: http-api - externalPort: 3000 - admin: - name: http-api-admin - externalPort: 3001 - - ingress: - enabled: true - externalPath: - api: / - admin: /admin/ - # Used to create an Ingress record. - hosts: - api: central-ledger.local - annotations: - nginx.ingress.kubernetes.io/rewrite-target: '/' - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - tls: - # Secrets must be manually created in the namespace. - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - - forensicloggingsidecar: - enabled: true - nameOverride: "forensicloggingsidecar-ledger" - replicaCount: 1 - image: - repository: mojaloop/forensic-logging-sidecar - tag: latest - pullPolicy: IfNotPresent - - service: - name: http-api-and-ws - type: ClusterIP - externalPort: 5678 - internalPort: 5678 - - annotations: {} - - # This allows one to point the service to an external backend. - # This is useful for local development where one wishes to hijack - # the communication from the service to the node layer and point - # to a specific endpoint (IP, Port, etc). - external: - enabled: false - # 10.0.2.2 is the magic IP for the host on virtualbox's network - ip: 10.0.2.2 - ports: - api: - name: http-api-and-ws - externalPort: 5678 - - readinessProbe: - enabled: true - initialDelaySeconds: 90 - periodSeconds: 15 - - livenessProbe: - enabled: true - initialDelaySeconds: 90 - periodSeconds: 15 - - ingress: - enabled: false - # Used to create an Ingress record. - hosts: - api: forensic-logging-sidecar.local - - externalPath: / - - annotations: - # kubernetes.io/ingress.class: nginx - - tls: - # Secrets must be manually created in the namespace. - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - - config: - default_json: ' - { - "PORT": $servicePort, - "SERVICE": "$serviceName", - "BATCH_SIZE": 64, - "BATCH_TIME_INTERVAL": 300000, - "KMS": { - "URL": "ws://$kmsHost:$kmsPort/sidecar", - "PING_INTERVAL": 30000, - "REQUEST_TIMEOUT": 90000, - "CONNECT_TIMEOUT": 60000, - "RECONNECT_INTERVAL": 10000 - } - } - ' - - centralkms: - enabled: true - nameOverride: "centralkms" - replicaCount: 1 - image: - repository: mojaloop/central-kms - tag: latest - pullPolicy: IfNotPresent - - service: - name: http-api-and-tcp-websocket - type: ClusterIP - externalPort: 8080 - internalPort: 8080 - - annotations: {} - - # This allows one to point the service to an external backend. - # This is useful for local development where one wishes to hijack - # the communication from the service to the node layer and point - # to a specific endpoint (IP, Port, etc). - external: - enabled: false - # 10.0.2.2 is the magic IP for the host on virtualbox's network - ip: 10.0.2.2 - ports: - api: - name: http-api-and-tcp-websocket - externalPort: 8080 - - readinessProbe: - enabled: true - httpGet: - path: /sidecars - initialDelaySeconds: 45 - periodSeconds: 15 - - livenessProbe: - enabled: true - httpGet: - path: /sidecars - initialDelaySeconds: 45 - periodSeconds: 15 - - ingress: - enabled: true - # Used to create an Ingress record. - hosts: - - central-kms.local - externalPath: / - - annotations: - # kubernetes.io/ingress.class: nginx - - tls: - # Secrets must be manually created in the namespace. - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - - resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - - postgresql: - enabled: true - nameOverride: "centralkms-postgresql" - ## Create a database user - postgresUser: kms - ## Default: random 10 character string - postgresPassword: xD873IyaQB - - service: - type: ClusterIP - port: 5432 - externalIPs: [] - - postgresql: - enabled: true - nameOverride: "forensicloggingsidecar-ledger-postgresql" - ## Create a database user - postgresUser: sidecar - ## Default: random 10 character string - postgresPassword: Wqt0KlkKvL - - service: - type: ClusterIP - port: 5432 - externalIPs: [] - - postgresql: - enabled: true - nameOverride: "centralledger-postgresql" - ## Create a database user - postgresUser: central_ledger - ## Default: random 10 character string - postgresPassword: oyMxgZChuu - - service: - type: ClusterIP - port: 5432 - externalIPs: [] - -centraldirectory: - enabled: true - replicaCount: 1 - image: - repository: mojaloop/central-directory - tag: latest - pullPolicy: IfNotPresent - - readinessProbe: - enabled: true - httpGet: - path: /health - initialDelaySeconds: 60 - periodSeconds: 15 - - livenessProbe: - enabled: true - httpGet: - path: /health - initialDelaySeconds: 60 - periodSeconds: 15 - - config: - default_json: ' - { - "PORT": $service_port, - "HOSTNAME": "http://$ingress_host", - "END_USER_REGISTRY_URL": "http://$centralenduserregistry_host:$centralenduserregistry_port", - "SCHEME_ID": "001", - "DEFAULT_DFSP": "", - "ENABLE_TOKEN_AUTH": false, - "PATHFINDER": { - "PARTNER_ID": 10305, - "SERVICE": "E2U+mm", - "CACHE_TIME": 300000, - "REGEX": { - "PATTERN": "^.*$", - "REPLACE": "mm:#{identifier}@leveloneproject.org" - }, - "QUERY": { - "ADDRESS": "$pathfinder_host", - "PORT": 15353, - "TIMEOUT": 15000 - }, - "PROVISIONING": { - "ADDRESS": "http://$pathfinder_host:$pathfinder_provisioning_port/nrs-pi/services/SIPIX/SendRequest" - } - } - } - ' - - init: - enabled: true - - service: - type: ClusterIP - ports: - api: - name: http-api - externalPort: 3000 - internalPort: 3000 - - annotations: {} - - # This allows one to point the service to an external backend. - # This is useful for local development where one wishes to hijack - # the communication from the service to the node layer and point - # to a specific endpoint (IP, Port, etc). - external: - enabled: false - # 10.0.2.2 is the magic IP for the host on virtualbox's network - ip: 10.0.2.2 - ports: - api: - name: http-api - externalPort: 3000 - - ingress: - enabled: false - externalPath: / - # Used to create an Ingress record. - hosts: - api: central-directory.local - annotations: - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - tls: - # Secrets must be manually created in the namespace. - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - - centralenduserregistry: - enabled: true - nameOverride: "centralenduserregistry" - replicaCount: 1 - image: - repository: mojaloop/central-end-user-registry - tag: latest - pullPolicy: IfNotPresent - - readinessProbe: - enabled: true - httpGet: - path: /health - initialDelaySeconds: 45 - periodSeconds: 15 - - livenessProbe: - enabled: true - httpGet: - path: /health - initialDelaySeconds: 45 - periodSeconds: 15 - - config: - default_json: ' - { - "PORT": $service_port, - "HOSTNAME": "http://$ingress_host" - } - ' - - init: - enabled: true - - service: - type: ClusterIP - ports: - api: - name: http-api - externalPort: 3001 - internalPort: 3001 - - annotations: {} - - # This allows one to point the service to an external backend. - # This is useful for local development where one wishes to hijack - # the communication from the service to the node layer and point - # to a specific endpoint (IP, Port, etc). - external: - enabled: false - # 10.0.2.2 is the magic IP for the host on virtualbox's network - ip: 10.0.2.2 - ports: - provisioning: - name: http-api - externalPort: 3001 - - ingress: - enabled: false - externalPath: / - # Used to create an Ingress record. - hosts: - api: central-end-user-registry.local - annotations: - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - tls: - # Secrets must be manually created in the namespace. - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - - postgresql: - enabled: true - nameOverride: "centralenduserregistry-postgresql" - ## postgres image repository - image: "postgres" - ## postgres image version - ## ref: https://hub.docker.com/r/library/postgres/tags/ - ## - imageTag: "9.6.2" - - ## Specify a imagePullPolicy - ## 'Always' if imageTag is 'latest', else set to 'IfNotPresent' - ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images - ## - # imagePullPolicy: - - ## Create a database user - ## Default: postgres - postgresUser: end_user_registry - ## Default: random 10 character string - postgresPassword: yGnTC07WQ6 - - service: - type: ClusterIP - port: 5432 - externalIPs: [] - - mockpathfinder: - enabled: true - nameOverride: "mockpathfinder" - replicaCount: 1 - image: - repository: mojaloop/mock-pathfinder - tag: latest - pullPolicy: IfNotPresent - - config: - default_json: ' - { - "QUERY": { - "PORT": $query_port, - "DEFAULT_RECORD": { - "order": 10, - "preference": 50, - "flags": "u", - "service": "E2U+pstn:tel", - "regexp": "!^(.*)$!tel:\\1;q_stat=102!", - "replacement": "", - "ttl": 900 - } - }, - "PROVISIONING": { - "PORT": $provisioning_port, - "PATH": "/nrs-pi/services/SIPIX/SendRequest", - "WSDL_FILE": "./sipix-2.0.0.wsdl", - "DEFAULT_CUSTOMER_ID": 1234 - } - } - ' - - service: - type: ClusterIP - ports: - provisioning: - name: tcp-prov - externalPort: 8080 - internalPort: 8080 - query: - name: tcp-query - externalPort: 15353 - internalPort: 15353 - - annotations: {} - - # This allows one to point the service to an external backend. - # This is useful for local development where one wishes to hijack - # the communication from the service to the node layer and point - # to a specific endpoint (IP, Port, etc). - external: - enabled: false - # 10.0.2.2 is the magic IP for the host on virtualbox's network - ip: 10.0.2.2 - ports: - provisioning: - name: tcp-prov - externalPort: 8080 - query: - name: tcp-query - externalPort: 15353 - - - ingress: - enabled: false - # Used to create an Ingress record. - hosts: - api: mock-pathfinder.local - annotations: - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - tls: - # Secrets must be manually created in the namespace. - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - - postgresql: - enabled: true - nameOverride: "mockpathfinder-postgresql" - ## Create a database user - postgresUser: mock-pathfinder - ## Default: random 10 character string - postgresPassword: IypvXbJ1Zb - - service: - type: ClusterIP - port: 5432 - externalIPs: [] - - postgresql: - enabled: true - nameOverride: "centraldirectory-postgresql" - ## Default: postgres - postgresUser: central-directory - ## Default: random 10 character string - postgresPassword: gR5hARbsfa - - service: - type: ClusterIP - port: 5432 - externalIPs: [] diff --git a/config-ingress.yaml b/config-ingress.yaml deleted file mode 100644 index e1ecc01b6..000000000 --- a/config-ingress.yaml +++ /dev/null @@ -1,48 +0,0 @@ -# Default values for nginx-ingress. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -controller: - replicaCount: 1 - image: - repository: quay.io/kubernetes-ingress-controller/nginx-ingress-controller - tag: 0.9.0-beta.19 - pullPolicy: IfNotPresent - extraArgs: - report-node-internal-ip-address: null - config: - map-hash-bucket-size: "128" - # this doesnt work use the next one - #client-max-body-size: "0m" - proxy-body-size: "0m" - proxy-read-timeout: "120" - proxy-send-timeout: "120" - #proxy-connect-timeout: "10" - #enable-sticky-sessions: "true" - stats: - enabled: false - -defaultbackend: - replicaCount: 1 - image: - repository: gcr.io/google_containers/defaultbackend - tag: 1.4 - pullPolicy: IfNotPresent - -# TCP service key:value pairs -# Ref: https://github.com/kubernetes/contrib/tree/master/ingress/controllers/nginx/examples/tcp -## -# tcp: -# 54321: "test/r1-centralkms-postgresql:5432" -# 54322: "test/r1-forensicloggingsidecar-ledger-postgresql:5432" -# 54323: "test/r1-centralledger-postgresql:5432" -tcp: - 54321: "default/dev-centralkms-postgresql:5432" - 54322: "default/dev-forensicloggingsidecar-ledger-postgresql:5432" - 54323: "default/dev-centralledger-postgresql:5432" - -# UDP service key:value pairs -# Ref: https://github.com/kubernetes/contrib/tree/master/ingress/controllers/nginx/examples/udp -## -udp: {} -# 53: "kube-system/kube-dns:53" diff --git a/forensicloggingsidecar/values.aws.yaml b/forensicloggingsidecar/values.aws.yaml deleted file mode 100644 index 1868cdeee..000000000 --- a/forensicloggingsidecar/values.aws.yaml +++ /dev/null @@ -1,264 +0,0 @@ -# Default values for forensic-logging-sidecar. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. -replicaCount: 1 -image: - repository: mojaloop/forensic-logging-sidecar - tag: latest - pullPolicy: IfNotPresent - command: '["/opt/sidecar/server.sh"]' - -service: - name: http-api-and-ws - # type: ClusterIP - type: LoadBalancer - externalPort: 5678 - internalPort: 5678 - - annotations: - service.beta.kubernetes.io/aws-load-balancer-type: "nlb" - - # This allows one to point the service to an external backend. - # This is useful for local development where one wishes to hijack - # the communication from the service to the node layer and point - # to a specific endpoint (IP, Port, etc). - external: - enabled: false - # 10.0.2.2 is the magic IP for the host on virtualbox's network - ip: 10.0.2.2 - ports: - api: - name: http-api-and-ws - externalPort: 5678 - -readinessProbe: - enabled: true - initialDelaySeconds: 120 - periodSeconds: 15 - -livenessProbe: - enabled: true - initialDelaySeconds: 90 - periodSeconds: 15 - -ingress: - enabled: false - # Used to create an Ingress record. - hosts: - api: forensic-logging-sidecar.local - - externalPath: / - - annotations: - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - - tls: - # Secrets must be manually created in the namespace. - # - secretName: chart-example-tls - # hosts: - # - chart-example.local -resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - -config: - default_json: ' - { - "PORT": $servicePort, - "SERVICE": "$serviceName", - "BATCH_SIZE": 64, - "BATCH_TIME_INTERVAL": 300000, - "KMS": { - "URL": "ws://$kmsHost:$kmsPort/sidecar", - "PING_INTERVAL": 30000, - "REQUEST_TIMEOUT": 120000, - "CONNECT_TIMEOUT": 60000, - "RECONNECT_INTERVAL": 10000 - } - } -' - -centralkms: - enabled: true - nameOverride: "centralkms" - replicaCount: 1 - image: - repository: mojaloop/central-kms - tag: latest - pullPolicy: IfNotPresent - - service: - name: http-api-and-tcp-websocket - # type: ClusterIP - type: LoadBalancer - externalPort: 8080 - internalPort: 8080 - - annotations: - service.beta.kubernetes.io/aws-load-balancer-type: "nlb" - - # This allows one to point the service to an external backend. - # This is useful for local development where one wishes to hijack - # the communication from the service to the node layer and point - # to a specific endpoint (IP, Port, etc). - external: - enabled: false - # 10.0.2.2 is the magic IP for the host on virtualbox's network - ip: 10.0.2.2 - ports: - api: - name: http-api-and-tcp-websocket - externalPort: 8080 - - readinessProbe: - enabled: true - httpGet: - path: /sidecars - initialDelaySeconds: 90 - periodSeconds: 15 - - livenessProbe: - enabled: true - httpGet: - path: /sidecars - initialDelaySeconds: 90 - periodSeconds: 15 - - ingress: - enabled: true - # Used to create an Ingress record. - hosts: - - central-kms.local - externalPath: / - - annotations: - # kubernetes.io/ingress.class: nginx - - tls: - # Secrets must be manually created in the namespace. - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - - resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - - postgresql: - enabled: true - nameOverride: "centralkms-postgresql" - ## Create a database user - postgresUser: kms - ## Default: random 10 character string - postgresPassword: xD873IyaQB - - service: - # type: ClusterIP - type: LoadBalancer - port: 5432 - externalIPs: [] - -postgresql: - enabled: true - nameOverride: "forensicloggingsidecar-postgresql" - ## postgres image repository - image: "postgres" - ## postgres image version - ## ref: https://hub.docker.com/r/library/postgres/tags/ - ## - imageTag: "9.6.2" - - ## Specify a imagePullPolicy - ## 'Always' if imageTag is 'latest', else set to 'IfNotPresent' - ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images - ## - # imagePullPolicy: - - ## Create a database user - ## Default: postgres - postgresUser: sidecar - ## Default: random 10 character string - postgresPassword: Wqt0KlkKvL - - ## Create a database - ## Default: the postgres user - postgresDatabase: sidecar - - ## Specify initdb arguments, e.g. --data-checksums - ## ref: https://github.com/docker-library/docs/blob/master/postgres/content.md#postgres_initdb_args - ## ref: https://www.postgresql.org/docs/current/static/app-initdb.html - # postgresInitdbArgs: - - ## Persist data to a persitent volume - persistence: - enabled: false - - ## A manually managed Persistent Volume and Claim - ## Requires persistence.enabled: true - ## If defined, PVC must be created manually before volume will be bound - # existingClaim: - - ## database data Persistent Volume Storage Class - ## If defined, storageClassName: - ## If set to "-", storageClassName: "", which disables dynamic provisioning - ## If undefined (the default) or set to null, no storageClassName spec is - ## set, choosing the default provisioner. (gp2 on AWS, standard on - ## GKE, AWS & OpenStack) - ## - # storageClass: "-" - accessMode: ReadWriteOnce - size: 8Gi - subPath: "postgresql-db" - - metrics: - enabled: false - image: wrouesnel/postgres_exporter - imageTag: v0.1.1 - imagePullPolicy: IfNotPresent - resources: - requests: - memory: 256Mi - cpu: 100m - ## Define additional custom metrics - ## ref: https://github.com/wrouesnel/postgres_exporter#adding-new-metrics-via-a-config-file - # customMetrics: - # pg_database: - # query: "SELECT d.datname AS name, CASE WHEN pg_catalog.has_database_privilege(d.datname, 'CONNECT') THEN pg_catalog.pg_database_size(d.datname) ELSE 0 END AS size FROM pg_catalog.pg_database d where datname not in ('template0', 'template1', 'postgres')" - # metrics: - # - name: - # usage: "LABEL" - # description: "Name of the database" - # - size_bytes: - # usage: "GAUGE" - # description: "Size of the database in bytes" - - ## Configure resource requests and limits - ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ - ## - resources: - requests: - memory: 256Mi - cpu: 100m - - service: - # type: ClusterIP - type: LoadBalancer - port: 5432 - externalIPs: [] diff --git a/mockpathfinder/values.aws.yaml b/mockpathfinder/values.aws.yaml deleted file mode 100644 index 25be200ed..000000000 --- a/mockpathfinder/values.aws.yaml +++ /dev/null @@ -1,175 +0,0 @@ -# Default values for mockpathfinder. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. -replicaCount: 1 -image: - repository: mojaloop/mock-pathfinder - tag: latest - pullPolicy: IfNotPresent - -config: - default_json: ' - { - "QUERY": { - "PORT": $query_port, - "DEFAULT_RECORD": { - "order": 10, - "preference": 50, - "flags": "u", - "service": "E2U+pstn:tel", - "regexp": "!^(.*)$!tel:\\1;q_stat=102!", - "replacement": "", - "ttl": 900 - } - }, - "PROVISIONING": { - "PORT": $provisioning_port, - "PATH": "/nrs-pi/services/SIPIX/SendRequest", - "WSDL_FILE": "./sipix-2.0.0.wsdl", - "DEFAULT_CUSTOMER_ID": 1234 - } - } -' - -service: - type: LoadBalancer - ports: - provisioning: - name: tcp-prov - externalPort: 8080 - internalPort: 8080 - query: - name: tcp-query - externalPort: 15353 - internalPort: 15353 - - annotations: - service.beta.kubernetes.io/aws-load-balancer-type: "nlb" - - # This allows one to point the service to an external backend. - # This is useful for local development where one wishes to hijack - # the communication from the service to the node layer and point - # to a specific endpoint (IP, Port, etc). - external: - enabled: false - # 10.0.2.2 is the magic IP for the host on virtualbox's network - ip: 10.0.2.2 - ports: - provisioning: - name: tcp-prov - externalPort: 8080 - query: - name: tcp-query - externalPort: 15353 - -ingress: - enabled: false - # Used to create an Ingress record. - hosts: - api: mock-pathfinder.local - annotations: - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - tls: - # Secrets must be manually created in the namespace. - # - secretName: chart-example-tls - # hosts: - # - chart-example.local -resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - -postgresql: - enabled: true - nameOverride: "mockpathfinder-postgresql" - ## postgres image repository - image: "postgres" - ## postgres image version - ## ref: https://hub.docker.com/r/library/postgres/tags/ - ## - imageTag: "9.6.2" - - ## Specify a imagePullPolicy - ## 'Always' if imageTag is 'latest', else set to 'IfNotPresent' - ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images - ## - # imagePullPolicy: - - ## Create a database user - ## Default: postgres - postgresUser: mock-pathfinder - ## Default: random 10 character string - postgresPassword: IypvXbJ1Zb - - ## Create a database - ## Default: the postgres user - postgresDatabase: mock_pathfinder - - ## Specify initdb arguments, e.g. --data-checksums - ## ref: https://github.com/docker-library/docs/blob/master/postgres/content.md#postgres_initdb_args - ## ref: https://www.postgresql.org/docs/current/static/app-initdb.html - # postgresInitdbArgs: - - ## Persist data to a persitent volume - persistence: - enabled: false - - ## A manually managed Persistent Volume and Claim - ## Requires persistence.enabled: true - ## If defined, PVC must be created manually before volume will be bound - # existingClaim: - - ## database data Persistent Volume Storage Class - ## If defined, storageClassName: - ## If set to "-", storageClassName: "", which disables dynamic provisioning - ## If undefined (the default) or set to null, no storageClassName spec is - ## set, choosing the default provisioner. (gp2 on AWS, standard on - ## GKE, AWS & OpenStack) - ## - # storageClass: "-" - accessMode: ReadWriteOnce - size: 8Gi - subPath: "postgresql-db" - - metrics: - enabled: false - image: wrouesnel/postgres_exporter - imageTag: v0.1.1 - imagePullPolicy: IfNotPresent - resources: - requests: - memory: 256Mi - cpu: 100m - ## Define additional custom metrics - ## ref: https://github.com/wrouesnel/postgres_exporter#adding-new-metrics-via-a-config-file - # customMetrics: - # pg_database: - # query: "SELECT d.datname AS name, CASE WHEN pg_catalog.has_database_privilege(d.datname, 'CONNECT') THEN pg_catalog.pg_database_size(d.datname) ELSE 0 END AS size FROM pg_catalog.pg_database d where datname not in ('template0', 'template1', 'postgres')" - # metrics: - # - name: - # usage: "LABEL" - # description: "Name of the database" - # - size_bytes: - # usage: "GAUGE" - # description: "Size of the database in bytes" - - ## Configure resource requests and limits - ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ - ## - resources: - requests: - memory: 256Mi - cpu: 100m - - service: - type: LoadBalancer - port: 5432 - externalIPs: [] diff --git a/mojaloop/.helmignore b/mojaloop/.helmignore new file mode 100644 index 000000000..f0c131944 --- /dev/null +++ b/mojaloop/.helmignore @@ -0,0 +1,21 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*~ +# Various IDEs +.project +.idea/ +*.tmproj diff --git a/mojaloop/Chart.yaml b/mojaloop/Chart.yaml new file mode 100644 index 000000000..516265e34 --- /dev/null +++ b/mojaloop/Chart.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +description: Mojaloop Helm chart for Kubernetes +name: mojaloop +version: 0.2.0 +home: http://mojaloop.io +icon: http://mojaloop.io/images/logo.png +sources: + - https://github.com/mojaloop/mojaloop + - https://github.com/mojaloop/helm +maintainers: + - name: Miguel de Barros + email: miguel.debarros@modusbox.com diff --git a/mojaloop/_helpers.tpl b/mojaloop/_helpers.tpl new file mode 100644 index 000000000..dc56e9465 --- /dev/null +++ b/mojaloop/_helpers.tpl @@ -0,0 +1,16 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "mojaloop.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +*/}} +{{- define "mojaloop.fullname" -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} diff --git a/mojaloop/requirements.yaml b/mojaloop/requirements.yaml new file mode 100644 index 000000000..2b2afe297 --- /dev/null +++ b/mojaloop/requirements.yaml @@ -0,0 +1,6 @@ +# requirements.yaml +dependencies: +- name: central + version: 0.2.0 + repository: "file://../central" + condition: central.enabled diff --git a/mojaloop/values.yaml b/mojaloop/values.yaml new file mode 100644 index 000000000..b1787f40d --- /dev/null +++ b/mojaloop/values.yaml @@ -0,0 +1,942 @@ +# Default values for central. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +central: + centralhub: + enabled: true + replicaCount: 1 + image: + repository: mojaloop/central-hub + tag: latest + pullPolicy: IfNotPresent + + readinessProbe: + enabled: true + httpGet: + path: /health + initialDelaySeconds: 45 + periodSeconds: 15 + + livenessProbe: + enabled: true + httpGet: + path: /health + initialDelaySeconds: 45 + periodSeconds: 15 + + config: + default_json: ' + { + "PORT": "$service_port", + "HOSTNAME": "http://$ingress_host", + "API_URL": "http://$centralledger_host:$centralledger_api_port", + "ADMIN_API_URL": "http://$centralledger_host:$centralledger_admin_port" + } + ' + + service: + name: http-api-and-web + type: ClusterIP + externalPort: 4001 + internalPort: 4001 + + annotations: {} + + # This allows one to point the service to an external backend. + # This is useful for local development where one wishes to hijack + # the communication from the service to the node layer and point + # to a specific endpoint (IP, Port, etc). + external: + enabled: false + # 10.0.2.2 is the magic IP for the host on virtualbox's network + ip: 10.0.2.2 + ports: + api: + name: http-api-and-web + externalPort: 4001 + + + ingress: + enabled: true + # Used to create an Ingress record. + hosts: + - central-hub.local + + externalPath: / + + annotations: + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + + tls: + # Secrets must be manually created in the namespace. + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + + resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + + centralledger: + enabled: true + nameOverride: centralledger + # Default values for central-ledger. + # This is a YAML-formatted file. + # Declare variables to be passed into your templates. + replicaCount: 1 + containers: + api: + image: + repository: mojaloop/central-ledger + tag: latest + pullPolicy: IfNotPresent + command: '["node", "src/api/index.js"]' + service: + ports: + api: + name: http-api + externalPort: 3000 + internalPort: 3000 + readinessProbe: + enabled: true + httpGet: + path: /health + initialDelaySeconds: 120 + periodSeconds: 15 + livenessProbe: + enabled: true + httpGet: + path: /health + initialDelaySeconds: 90 + periodSeconds: 15 + + admin: + image: + repository: mojaloop/central-ledger + tag: latest + pullPolicy: IfNotPresent + command: '["node", "src/admin/index.js"]' + service: + ports: + api: + name: http-api-admin + externalPort: 3001 + internalPort: 3001 + readinessProbe: + enabled: true + httpGet: + path: /health + initialDelaySeconds: 120 + periodSeconds: 15 + livenessProbe: + enabled: true + httpGet: + path: /health + initialDelaySeconds: 90 + periodSeconds: 15 + + + config: + # db_type can either be 'postgres' or 'mysql'. Ensure the correct DB is enabled and configured below: postgresql.enabled or mysql.enabled + db_type: 'postgres' + # db_driver can either be 'pg' or 'mysql'. Ensure the correct corresponding db_type above has been set. + db_driver: 'pg' + # default_json config for nodejs. The following variables will be injected by the helm chart (see config.yaml): $service_admin_port, $ingress_hostm $forensicloggingsidecar_host, $forensicloggingsidecar_port + default_json: | + { + "PORT": $service_api_port, + "ADMIN_PORT": $service_admin_port, + "HOSTNAME": "$ingress_host", + "ENABLE_TOKEN_AUTH": false, + "ENABLE_BASIC_AUTH": false, + "LEDGER_ACCOUNT_NAME": "LedgerName", + "LEDGER_ACCOUNT_PASSWORD": "LedgerPassword", + "AMOUNT": { + "PRECISION": 10, + "SCALE": 2 + }, + "SIDECAR": { + "DISABLED": false, + "HOST": "$forensicloggingsidecar_host", + "PORT": $forensicloggingsidecar_port, + "CONNECT_TIMEOUT": 45000, + "RECONNECT_INTERVAL": 5000 + } + } + # default_json config for nodejs db knex lib. The following variables will be injected by the helm chart (see config.yaml): $db_driver + knexfile_js: | + 'use strict' + + const migrationsDirectory = '/opt/central-ledger/migrations' + const Config = require('/opt/central-ledger/src/lib/config') + module.exports = { + client: '$db_driver', + connection: Config.DATABASE_URI, + migrations: { + directory: migrationsDirectory, + tableName: 'migrations', + stub: `${migrationsDirectory}/migration.template` + } + } + + init: + enabled: true + image: + name: wait-for-postgres + repository: bowerswilkins/awaitpostgres + tag: latest + pullPolicy: IfNotPresent + + service: + type: ClusterIP + + annotations: {} + + # This allows one to point the service to an external backend. + # This is useful for local development where one wishes to hijack + # the communication from the service to the node layer and point + # to a specific endpoint (IP, Port, etc). + external: + enabled: false + # 10.0.2.2 is the magic IP for the host on virtualbox's network + ip: 10.0.2.2 + ports: + api: + name: http-api + externalPort: 3000 + admin: + name: http-api-admin + externalPort: 3001 + + ingress: + enabled: true + type: http + externalPath: + api: / + admin: /admin/ + # Used to create an Ingress record. + hosts: + api: central-ledger.local + admin: central-ledger.local + annotations: + nginx.ingress.kubernetes.io/rewrite-target: '/' + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + tls: + # Secrets must be manually created in the namespace. + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + + forensicloggingsidecar: + enabled: true + nameOverride: "forensicloggingsidecar-ledger" + replicaCount: 1 + image: + repository: mojaloop/forensic-logging-sidecar + tag: latest + pullPolicy: IfNotPresent + + service: + name: http-api-and-ws + type: ClusterIP + externalPort: 5678 + internalPort: 5678 + + annotations: {} + + # This allows one to point the service to an external backend. + # This is useful for local development where one wishes to hijack + # the communication from the service to the node layer and point + # to a specific endpoint (IP, Port, etc). + external: + enabled: false + # 10.0.2.2 is the magic IP for the host on virtualbox's network + ip: 10.0.2.2 + ports: + api: + name: http-api-and-ws + externalPort: 5678 + + readinessProbe: + enabled: true + initialDelaySeconds: 90 + periodSeconds: 15 + + livenessProbe: + enabled: true + initialDelaySeconds: 90 + periodSeconds: 15 + + ingress: + enabled: false + # Used to create an Ingress record. + hosts: + api: forensic-logging-sidecar.local + + externalPath: / + + annotations: + # kubernetes.io/ingress.class: nginx + + tls: + # Secrets must be manually created in the namespace. + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + + config: + default_json: ' + { + "PORT": $servicePort, + "SERVICE": "$serviceName", + "BATCH_SIZE": 64, + "BATCH_TIME_INTERVAL": 300000, + "KMS": { + "URL": "ws://$kmsHost:$kmsPort/sidecar", + "PING_INTERVAL": 30000, + "REQUEST_TIMEOUT": 90000, + "CONNECT_TIMEOUT": 60000, + "RECONNECT_INTERVAL": 10000 + } + } + ' + centralkms: + enabled: true + nameOverride: "centralkms" + replicaCount: 1 + image: + repository: mojaloop/central-kms + tag: latest + pullPolicy: IfNotPresent + + service: + name: http-api-and-tcp-websocket + type: ClusterIP + externalPort: 8080 + internalPort: 8080 + + annotations: {} + + # This allows one to point the service to an external backend. + # This is useful for local development where one wishes to hijack + # the communication from the service to the node layer and point + # to a specific endpoint (IP, Port, etc). + external: + enabled: false + # 10.0.2.2 is the magic IP for the host on virtualbox's network + ip: 10.0.2.2 + ports: + api: + name: http-api-and-tcp-websocket + externalPort: 8080 + + readinessProbe: + enabled: true + httpGet: + path: /sidecars + initialDelaySeconds: 30 + periodSeconds: 5 + + livenessProbe: + enabled: true + httpGet: + path: /sidecars + initialDelaySeconds: 30 + periodSeconds: 5 + + ingress: + enabled: true + # Used to create an Ingress record. + hosts: + - central-kms.local + externalPath: / + + annotations: + # kubernetes.io/ingress.class: nginx + + tls: + # Secrets must be manually created in the namespace. + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + + resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + + postgresql: + enabled: true + nameOverride: "centralkms-postgresql" + ## Create a database user + postgresUser: kms + ## Default: random 10 character string + postgresPassword: xD873IyaQB + + service: + type: ClusterIP + port: 5432 + externalIPs: [] + + postgresql: + enabled: true + nameOverride: "forensicloggingsidecar-ledger-postgresql" + ## Create a database user + postgresUser: sidecar + ## Default: random 10 character string + postgresPassword: Wqt0KlkKvL + + service: + type: ClusterIP + port: 5432 + externalIPs: [] + + postgresql: + enabled: true + nameOverride: "centralledger-postgresql" + ## postgres image repository + image: "postgres" + ## postgres image version + ## ref: https://hub.docker.com/r/library/postgres/tags/ + ## + imageTag: "9.6.2" + + ## Specify a imagePullPolicy + ## 'Always' if imageTag is 'latest', else set to 'IfNotPresent' + ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images + ## + # imagePullPolicy: + + ## Create a database user + ## Default: postgres + postgresUser: central_ledger + ## Default: random 10 character string + postgresPassword: oyMxgZChuu + + ## Create a database + ## Default: the postgres user + postgresDatabase: central_ledger + + ## Specify initdb arguments, e.g. --data-checksums + ## ref: https://github.com/docker-library/docs/blob/master/postgres/content.md#postgres_initdb_args + ## ref: https://www.postgresql.org/docs/current/static/app-initdb.html + # postgresInitdbArgs: + + ## Persist data to a persitent volume + persistence: + enabled: false + + ## A manually managed Persistent Volume and Claim + ## Requires persistence.enabled: true + ## If defined, PVC must be created manually before volume will be bound + # existingClaim: + + ## database data Persistent Volume Storage Class + ## If defined, storageClassName: + ## If set to "-", storageClassName: "", which disables dynamic provisioning + ## If undefined (the default) or set to null, no storageClassName spec is + ## set, choosing the default provisioner. (gp2 on AWS, standard on + ## GKE, AWS & OpenStack) + ## + # storageClass: "-" + accessMode: ReadWriteOnce + size: 8Gi + subPath: "postgresql-db" + + metrics: + enabled: false + image: wrouesnel/postgres_exporter + imageTag: v0.1.1 + imagePullPolicy: IfNotPresent + resources: + requests: + memory: 256Mi + cpu: 100m + ## Define additional custom metrics + ## ref: https://github.com/wrouesnel/postgres_exporter#adding-new-metrics-via-a-config-file + # customMetrics: + # pg_database: + # query: "SELECT d.datname AS name, CASE WHEN pg_catalog.has_database_privilege(d.datname, 'CONNECT') THEN pg_catalog.pg_database_size(d.datname) ELSE 0 END AS size FROM pg_catalog.pg_database d where datname not in ('template0', 'template1', 'postgres')" + # metrics: + # - name: + # usage: "LABEL" + # description: "Name of the database" + # - size_bytes: + # usage: "GAUGE" + # description: "Size of the database in bytes" + + ## Configure resource requests and limits + ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ + ## + resources: + requests: + memory: 256Mi + cpu: 100m + + service: + type: ClusterIP + port: 5432 + externalIPs: [] + + mysql: + enabled: false + nameOverride: "centralledger-mysql" + # Default values for Percona XtraDB Cluster + + ## percona image and version + ## ref: https://hub.docker.com/r/percona/percona-xtradb-cluster/tags/ + image: + repository: "percona/percona-xtradb-cluster" + tag: "5.7.19" + pullPolicy: IfNotPresent + + # Desired number of members of xtradb cluster + replicas: 1 + + ## Specify password for root user + ## + # mysqlRootPassword: not-a-secure-password + + ## Specify password for xtradb backup user + ## + # xtraBackupPassword: replicate-my-data + + ## Uncomment to create a database user + ## + mysqlUser: test + mysqlPassword: test + + ## Allow unauthenticated access, uncomment to enable + ## + # mysqlAllowEmptyPassword: true + + ## Uncomment to Create a database + ## + mysqlDatabase: test + + ## hosts to allow root user access from + # set to "127.0.0.1" to deny remote root. + allowRootFrom: "%" + + ## Persist data to a persitent volume + persistence: + enabled: false + ## percona data Persistent Volume Storage Class + ## If defined, storageClassName: + ## If set to "-", storageClassName: "", which disables dynamic provisioning + ## If undefined (the default) or set to null, no storageClassName spec is + ## set, choosing the default provisioner. (gp2 on AWS, standard on + ## GKE, AWS & OpenStack) + ## + # storageClass: "-" + accessMode: ReadWriteOnce + size: 8Gi + + ## Node labels for pod assignment + ## Ref: https://kubernetes.io/docs/user-guide/node-selection/ + ## + nodeSelector: {} + + ## Configure resource requests and limits + ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ + ## + # resources: + # requests: + # memory: 256Mi + # cpu: 100m + + configFiles: + node.cnf: |+ + [mysqld] + datadir=/var/lib/mysql + default_storage_engine=InnoDB + binlog_format=ROW + innodb_flush_log_at_trx_commit = 0 + innodb_flush_method = O_DIRECT + innodb_file_per_table = 1 + innodb_autoinc_lock_mode=2 + bind_address = 0.0.0.0 + wsrep_slave_threads=2 + wsrep_cluster_address=gcomm:// + wsrep_provider=/usr/lib/galera3/libgalera_smm.so + wsrep_cluster_name=galera + wsrep_sst_method=xtrabackup-v2 + ## When set to true will create sidecar for `prom/mysqld-exporter` + ## metrics exporting + metricsExporter: false + + ## When set to true will create sidecar to tail mysql log + logTail: true + + service: + type: ClusterIP + port: 5432 + externalIPs: [] + + centraldirectory: + enabled: true + replicaCount: 1 + image: + repository: mojaloop/central-directory + tag: latest + pullPolicy: IfNotPresent + + readinessProbe: + enabled: true + httpGet: + path: /health + initialDelaySeconds: 60 + periodSeconds: 15 + + livenessProbe: + enabled: true + httpGet: + path: /health + initialDelaySeconds: 60 + periodSeconds: 15 + + config: + default_json: ' + { + "PORT": $service_port, + "HOSTNAME": "http://$ingress_host", + "END_USER_REGISTRY_URL": "http://$centralenduserregistry_host:$centralenduserregistry_port", + "SCHEME_ID": "001", + "DEFAULT_DFSP": "", + "ENABLE_TOKEN_AUTH": false, + "PATHFINDER": { + "PARTNER_ID": 10305, + "SERVICE": "E2U+mm", + "CACHE_TIME": 300000, + "REGEX": { + "PATTERN": "^.*$", + "REPLACE": "mm:#{identifier}@leveloneproject.org" + }, + "QUERY": { + "ADDRESS": "$pathfinder_host", + "PORT": 15353, + "TIMEOUT": 15000 + }, + "PROVISIONING": { + "ADDRESS": "http://$pathfinder_host:$pathfinder_provisioning_port/nrs-pi/services/SIPIX/SendRequest" + } + } + } + ' + + init: + enabled: true + + service: + type: ClusterIP + ports: + api: + name: http-api + externalPort: 3000 + internalPort: 3000 + + annotations: {} + + # This allows one to point the service to an external backend. + # This is useful for local development where one wishes to hijack + # the communication from the service to the node layer and point + # to a specific endpoint (IP, Port, etc). + external: + enabled: false + # 10.0.2.2 is the magic IP for the host on virtualbox's network + ip: 10.0.2.2 + ports: + api: + name: http-api + externalPort: 3000 + + ingress: + enabled: false + externalPath: / + # Used to create an Ingress record. + hosts: + api: central-directory.local + annotations: + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + tls: + # Secrets must be manually created in the namespace. + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + + centralenduserregistry: + enabled: true + nameOverride: "centralenduserregistry" + replicaCount: 1 + image: + repository: mojaloop/central-end-user-registry + tag: latest + pullPolicy: IfNotPresent + + readinessProbe: + enabled: true + httpGet: + path: /health + initialDelaySeconds: 45 + periodSeconds: 15 + + livenessProbe: + enabled: true + httpGet: + path: /health + initialDelaySeconds: 45 + periodSeconds: 15 + + config: + default_json: ' + { + "PORT": $service_port, + "HOSTNAME": "http://$ingress_host" + } + ' + + init: + enabled: true + + service: + type: ClusterIP + ports: + api: + name: http-api + externalPort: 3001 + internalPort: 3001 + + annotations: {} + + # This allows one to point the service to an external backend. + # This is useful for local development where one wishes to hijack + # the communication from the service to the node layer and point + # to a specific endpoint (IP, Port, etc). + external: + enabled: false + # 10.0.2.2 is the magic IP for the host on virtualbox's network + ip: 10.0.2.2 + ports: + provisioning: + name: http-api + externalPort: 3001 + + ingress: + enabled: false + externalPath: / + # Used to create an Ingress record. + hosts: + api: central-end-user-registry.local + annotations: + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + tls: + # Secrets must be manually created in the namespace. + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + + postgresql: + enabled: true + nameOverride: "centralenduserregistry-postgresql" + ## postgres image repository + image: "postgres" + ## postgres image version + ## ref: https://hub.docker.com/r/library/postgres/tags/ + ## + imageTag: "9.6.2" + + ## Specify a imagePullPolicy + ## 'Always' if imageTag is 'latest', else set to 'IfNotPresent' + ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images + ## + # imagePullPolicy: + + ## Create a database user + ## Default: postgres + postgresUser: end_user_registry + ## Default: random 10 character string + postgresPassword: yGnTC07WQ6 + + service: + type: ClusterIP + port: 5432 + externalIPs: [] + + mockpathfinder: + enabled: true + nameOverride: "mockpathfinder" + replicaCount: 1 + image: + repository: mojaloop/mock-pathfinder + tag: latest + pullPolicy: IfNotPresent + + config: + default_json: ' + { + "QUERY": { + "PORT": $query_port, + "DEFAULT_RECORD": { + "order": 10, + "preference": 50, + "flags": "u", + "service": "E2U+pstn:tel", + "regexp": "!^(.*)$!tel:\\1;q_stat=102!", + "replacement": "", + "ttl": 900 + } + }, + "PROVISIONING": { + "PORT": $provisioning_port, + "PATH": "/nrs-pi/services/SIPIX/SendRequest", + "WSDL_FILE": "./sipix-2.0.0.wsdl", + "DEFAULT_CUSTOMER_ID": 1234 + } + } + ' + + service: + type: ClusterIP + ports: + provisioning: + name: tcp-prov + externalPort: 8080 + internalPort: 8080 + query: + name: tcp-query + externalPort: 15353 + internalPort: 15353 + + annotations: {} + + # This allows one to point the service to an external backend. + # This is useful for local development where one wishes to hijack + # the communication from the service to the node layer and point + # to a specific endpoint (IP, Port, etc). + external: + enabled: false + # 10.0.2.2 is the magic IP for the host on virtualbox's network + ip: 10.0.2.2 + ports: + provisioning: + name: tcp-prov + externalPort: 8080 + query: + name: tcp-query + externalPort: 15353 + + + ingress: + enabled: false + # Used to create an Ingress record. + hosts: + api: mock-pathfinder.local + annotations: + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + tls: + # Secrets must be manually created in the namespace. + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + + postgresql: + enabled: true + nameOverride: "mockpathfinder-postgresql" + ## Create a database user + postgresUser: mock-pathfinder + ## Default: random 10 character string + postgresPassword: IypvXbJ1Zb + + service: + type: ClusterIP + port: 5432 + externalIPs: [] + + postgresql: + enabled: true + nameOverride: "centraldirectory-postgresql" + ## Default: postgres + postgresUser: central-directory + ## Default: random 10 character string + postgresPassword: gR5hARbsfa + + service: + type: ClusterIP + port: 5432 + externalIPs: [] diff --git a/package.sh b/package.sh index e2b1d91ba..8f96bfd55 100644 --- a/package.sh +++ b/package.sh @@ -47,6 +47,11 @@ checkCommandResult echo "Packaging Central..." helm package -u -d ./repo ./central checkCommandResult + +echo "Packaging Mojaloop..." +helm package -u -d ./repo ./mojaloop +checkCommandResult + echo "Packaging Ingress-Nginx..." helm package -u -d ./repo ./kube-public/ingress-nginx/ diff --git a/update-charts-dep.sh b/update-charts-dep.sh index d47a585d2..a5489af7a 100755 --- a/update-charts-dep.sh +++ b/update-charts-dep.sh @@ -48,6 +48,10 @@ echo "Updating Central..." helm dep up ./central checkCommandResult +echo "Updating Mojaloop..." +helm dep up ./mojaloop +checkCommandResult + echo "\ Chart updates completed.\n \ Ensure you check the output for any errors. \n \