From 1fabf84bd7a0e0629e10c56faf5e72187c50a7d8 Mon Sep 17 00:00:00 2001 From: stmSi Date: Mon, 5 Feb 2024 11:27:55 +0630 Subject: [PATCH 1/9] feat: add merchant registry helm charts --- README.md | 2 +- merchant-registry-svc/Chart.yaml | 44 +++++++ merchant-registry-svc/README.md | 40 +++++++ .../chart-acquirer-backend/Chart.yaml | 24 ++++ .../templates/deployment.yaml | 55 +++++++++ .../templates/service.yaml | 11 ++ .../chart-acquirer-backend/values.yaml | 30 +++++ .../chart-acquirer-frontend/Chart.yaml | 24 ++++ .../templates/deployment.yaml | 27 +++++ .../templates/service.yaml | 11 ++ .../chart-acquirer-frontend/values.yaml | 15 +++ .../chart-merchant-db/Chart.yaml | 24 ++++ .../templates/configmap.yaml | 10 ++ .../templates/deployment.yaml | 39 +++++++ .../chart-merchant-db/templates/pvc.yaml | 11 ++ .../chart-merchant-db/templates/secret.yaml | 8 ++ .../chart-merchant-db/templates/service.yaml | 12 ++ .../chart-merchant-db/values.yaml | 22 ++++ merchant-registry-svc/chart-minio/Chart.yaml | 24 ++++ .../chart-minio/templates/deployment.yaml | 36 ++++++ .../chart-minio/templates/pvc.yaml | 11 ++ .../chart-minio/templates/service.yaml | 12 ++ merchant-registry-svc/chart-minio/values.yaml | 20 ++++ .../chart-rabbitmq/Chart.yaml | 24 ++++ .../chart-rabbitmq/templates/deployment.yaml | 27 +++++ .../chart-rabbitmq/templates/service.yaml | 14 +++ .../chart-rabbitmq/values.yaml | 19 ++++ .../chart-registry-oracle/Chart.yaml | 24 ++++ .../templates/deployment.yaml | 42 +++++++ .../templates/service.yaml | 12 ++ .../chart-registry-oracle/values.yaml | 21 ++++ merchant-registry-svc/templates/ingress.yaml | 25 ++++ merchant-registry-svc/values.yaml | 107 ++++++++++++++++++ update-charts-dep.sh | 1 + 34 files changed, 827 insertions(+), 1 deletion(-) create mode 100644 merchant-registry-svc/Chart.yaml create mode 100644 merchant-registry-svc/README.md create mode 100644 merchant-registry-svc/chart-acquirer-backend/Chart.yaml create mode 100644 merchant-registry-svc/chart-acquirer-backend/templates/deployment.yaml create mode 100644 merchant-registry-svc/chart-acquirer-backend/templates/service.yaml create mode 100644 merchant-registry-svc/chart-acquirer-backend/values.yaml create mode 100644 merchant-registry-svc/chart-acquirer-frontend/Chart.yaml create mode 100644 merchant-registry-svc/chart-acquirer-frontend/templates/deployment.yaml create mode 100644 merchant-registry-svc/chart-acquirer-frontend/templates/service.yaml create mode 100644 merchant-registry-svc/chart-acquirer-frontend/values.yaml create mode 100644 merchant-registry-svc/chart-merchant-db/Chart.yaml create mode 100644 merchant-registry-svc/chart-merchant-db/templates/configmap.yaml create mode 100644 merchant-registry-svc/chart-merchant-db/templates/deployment.yaml create mode 100644 merchant-registry-svc/chart-merchant-db/templates/pvc.yaml create mode 100644 merchant-registry-svc/chart-merchant-db/templates/secret.yaml create mode 100644 merchant-registry-svc/chart-merchant-db/templates/service.yaml create mode 100644 merchant-registry-svc/chart-merchant-db/values.yaml create mode 100644 merchant-registry-svc/chart-minio/Chart.yaml create mode 100644 merchant-registry-svc/chart-minio/templates/deployment.yaml create mode 100644 merchant-registry-svc/chart-minio/templates/pvc.yaml create mode 100644 merchant-registry-svc/chart-minio/templates/service.yaml create mode 100644 merchant-registry-svc/chart-minio/values.yaml create mode 100644 merchant-registry-svc/chart-rabbitmq/Chart.yaml create mode 100644 merchant-registry-svc/chart-rabbitmq/templates/deployment.yaml create mode 100644 merchant-registry-svc/chart-rabbitmq/templates/service.yaml create mode 100644 merchant-registry-svc/chart-rabbitmq/values.yaml create mode 100644 merchant-registry-svc/chart-registry-oracle/Chart.yaml create mode 100644 merchant-registry-svc/chart-registry-oracle/templates/deployment.yaml create mode 100644 merchant-registry-svc/chart-registry-oracle/templates/service.yaml create mode 100644 merchant-registry-svc/chart-registry-oracle/values.yaml create mode 100644 merchant-registry-svc/templates/ingress.yaml create mode 100644 merchant-registry-svc/values.yaml diff --git a/README.md b/README.md index f3c966867..5b108fd27 100644 --- a/README.md +++ b/README.md @@ -252,7 +252,7 @@ Mojaloop Helm deployments currently include the following provisioning (`setup`) 1. Add the following to your hosts file and ensure you have installed Ingress Controller on your Kubernetes Cluster: - ` ml-api-adapter.local central-ledger.local account-lookup-service.local quoting-service.local central-settlement.local moja-simulator.local testing-toolkit.local testing-toolkit-specapi.local` + ` ml-api-adapter.local central-ledger.local account-lookup-service.local quoting-service.local central-settlement.local moja-simulator.local testing-toolkit.local testing-toolkit-specapi.local www.acquirer-merchant.local` 2. Curl Health End-points for ML-API-Adapter diff --git a/merchant-registry-svc/Chart.yaml b/merchant-registry-svc/Chart.yaml new file mode 100644 index 000000000..f51ca7b79 --- /dev/null +++ b/merchant-registry-svc/Chart.yaml @@ -0,0 +1,44 @@ +apiVersion: v2 +name: helms +description: A Helm chart for Kubernetes + +dependencies: + - name: chart-acquirer-backend + version: 0.1.0 + repository: file://./chart-acquirer-backend + - name: chart-acquirer-frontend + version: 0.1.0 + repository: file://./chart-acquirer-frontend + - name: chart-merchant-db + version: 0.1.0 + repository: file://./chart-merchant-db + - name: chart-minio + version: 0.1.0 + repository: file://./chart-minio + - name: chart-rabbitmq + version: 0.1.0 + repository: file://./chart-rabbitmq + - name: chart-registry-oracle + version: 0.1.0 + repository: file://./chart-registry-oracle + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "1.16.0" diff --git a/merchant-registry-svc/README.md b/merchant-registry-svc/README.md new file mode 100644 index 000000000..f734be6fb --- /dev/null +++ b/merchant-registry-svc/README.md @@ -0,0 +1,40 @@ +## Merchant Registry Helm Charts Deployment + +### Default Ingress DNS (add following records to the `/etc/hosts` file) + +- ` www.acquirer-merchant.local` + +### Prerequisites + +- Kubernetes cluster +- Helm 3 +- SendGrid API Key (for sending verification emails) + + - Update the `sendgridApiKey` in the `./chart-acquirer-backend/values.yaml` + - Update the `senderEmail` in the `./chart-acquirer-backend/values.yaml` + +- Register for Google reCAPTCHA v2 and Add Ingress Domain + - https://www.google.com/recaptcha/admin/create + - Update the `./chart-acquirer-backend/values.yaml` file with the following values: + - `recaptchaBackendSiteKey` + - Update the `./chart-acquirer-frontend/values.yaml` file with the following values: + - `recaptchaFrontendSiteKey` + +### Deploying the Helm Charts + +1. Build Dependency Chart + +```bash +helm dep up ./ +``` + +2. Install the Helm chart: + +```bash +helm install merchant ./ --namespace mojaloop +``` + +### IMPORTANT NOTES: + +When updating ingress's host make sure to update the `apiUrl` of `./chart-acquirer-frontend/values.yaml` file too. +Otherwise frontend will not be able to communicate with backend. diff --git a/merchant-registry-svc/chart-acquirer-backend/Chart.yaml b/merchant-registry-svc/chart-acquirer-backend/Chart.yaml new file mode 100644 index 000000000..4dc9ed690 --- /dev/null +++ b/merchant-registry-svc/chart-acquirer-backend/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: chart-acquirer-backend +description: A Helm chart for Kubernetes + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "1.16.0" diff --git a/merchant-registry-svc/chart-acquirer-backend/templates/deployment.yaml b/merchant-registry-svc/chart-acquirer-backend/templates/deployment.yaml new file mode 100644 index 000000000..829ef2878 --- /dev/null +++ b/merchant-registry-svc/chart-acquirer-backend/templates/deployment.yaml @@ -0,0 +1,55 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.Name }}-acquirer-backend-deployment +spec: + replicas: {{ .Values.acquirerBackend.replicaCount }} + selector: + matchLabels: + component: acquirer-backend + template: + metadata: + labels: + component: acquirer-backend + spec: + containers: + - name: acquirer-backend + image: "{{ .Values.acquirerBackend.image.repository }}:{{ .Values.acquirerBackend.image.tag }}" + ports: + - containerPort: {{ .Values.acquirerBackend.service.port }} + env: + - name: APP_URL # for email redirect verification + value: "{{ .Values.acquirerBackend.env.appURL }}" + - name: FRONTEND_SET_PASSWORD_URL + value: "{{ .Values.acquirerBackend.env.frontendSetPasswordRedirectURL }}" + - name: RECAPTCHA_SECRET_KEY + value: "{{ .Values.acquirerBackend.env.recaptchaBackendSiteKey }}" + - name: DB_HOST + value: "{{ .Release.Name }}-{{ .Values.acquirerBackend.env.dbHost }}" + - name: DB_PORT + value: "{{ .Values.acquirerBackend.env.dbPort }}" + - name: DB_DATABASE + value: "{{ .Values.acquirerBackend.env.database }}" + - name: DB_USERNAME + value: "{{ .Values.acquirerBackend.env.dbUsername }}" + - name: DB_PASSWORD + valueFrom: + secretKeyRef: + name: {{ .Release.Name }}-merchant-db-secret + key: mysql-root-password + - name: SENDGRID_API_KEY + value: "{{ .Values.acquirerBackend.env.sendgridApiKey }}" + - name: SENDER_EMAIL + value: "{{ .Values.acquirerBackend.env.senderEmail }}" + + - name: S3_ENDPOINT + value: "{{ .Release.Name }}-{{ .Values.acquirerBackend.env.s3Endpoint }}" + + - name: RABBITMQ_HOST + value: "{{ .Release.Name }}-{{ .Values.acquirerBackend.env.rabbitmqHost }}" + - name: RABBITMQ_PORT + value: "{{ .Values.acquirerBackend.env.rabbitmqPort }}" + - name: RABBITMQ_USERNAME + value: "{{ .Values.acquirerBackend.env.rabbitmqUsername }}" + - name: RABBITMQ_PASSWORD + value: "{{ .Values.acquirerBackend.env.rabbitmqPassword }}" diff --git a/merchant-registry-svc/chart-acquirer-backend/templates/service.yaml b/merchant-registry-svc/chart-acquirer-backend/templates/service.yaml new file mode 100644 index 000000000..265fe0447 --- /dev/null +++ b/merchant-registry-svc/chart-acquirer-backend/templates/service.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Release.Name}}-acquirer-backend-clusterip-service +spec: + type: {{ .Values.acquirerBackend.service.type }} + selector: + component: acquirer-backend + ports: + - port: {{ .Values.acquirerBackend.service.port }} + targetPort: {{ .Values.acquirerBackend.service.port }} diff --git a/merchant-registry-svc/chart-acquirer-backend/values.yaml b/merchant-registry-svc/chart-acquirer-backend/values.yaml new file mode 100644 index 000000000..f3fb7481d --- /dev/null +++ b/merchant-registry-svc/chart-acquirer-backend/values.yaml @@ -0,0 +1,30 @@ +# Default values for acquirer-backend. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +acquirerBackend: + replicaCount: 1 + image: + repository: mojaloop/merchant-acquirer-backend + tag: 0.1.3 + service: + type: ClusterIP + port: 5555 + env: + dbHost: merchant-db-clusterip-service + dbPort: "3306" + database: acquirer_db + dbUsername: root + # db password will be fetched from k8s secret object + + rabbitmqHost: rabbitmq-clusterip-service + rabbitmqPort: "5672" + rabbitmqUsername: guest + rabbitmqPassword: guest + sendgridApiKey: "YOUR_SENDGIRD_API_KEY" # 3rd Party Email Service + senderEmail: "test@example.com" + s3Endpoint: minio-clusterip-service + appURL: "http://www.acquirer-merchant.local" # for email verification backend link + frontendSetPasswordRedirectURL: "http://www.acquirer-merchant.local/set-password" # reset password link after email verification + recaptchaBackendSiteKey: "6LcEfT4pAAAAAF9a9PgebViC87aRPsd10JQDalNy" + diff --git a/merchant-registry-svc/chart-acquirer-frontend/Chart.yaml b/merchant-registry-svc/chart-acquirer-frontend/Chart.yaml new file mode 100644 index 000000000..c5b43da71 --- /dev/null +++ b/merchant-registry-svc/chart-acquirer-frontend/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: chart-acquirer-frontend +description: A Helm chart for Kubernetes + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "1.16.0" diff --git a/merchant-registry-svc/chart-acquirer-frontend/templates/deployment.yaml b/merchant-registry-svc/chart-acquirer-frontend/templates/deployment.yaml new file mode 100644 index 000000000..be4879517 --- /dev/null +++ b/merchant-registry-svc/chart-acquirer-frontend/templates/deployment.yaml @@ -0,0 +1,27 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.Name }}-acquirer-frontend-deployment +spec: + replicas: {{ .Values.acquirerFrontend.replicaCount }} + selector: + matchLabels: + component: acquirer-frontend + template: + metadata: + labels: + component: acquirer-frontend + spec: + containers: + - name: acquirer-frontend + image: "{{ .Values.acquirerFrontend.image.repository }}:{{ .Values.acquirerFrontend.image.tag }}" + ports: + - containerPort: {{ .Values.acquirerFrontend.service.port }} + env: + - name: VITE_API_URL + value: "{{ .Values.acquirerFrontend.env.apiURL }}" + - name: VITE_PORT + value: "{{ .Values.acquirerFrontend.service.port }}" + - name: VITE_RECAPTCHA_SITE_KEY + value: {{ .Values.acquirerFrontend.env.recaptchaFrontendSiteKey }} + diff --git a/merchant-registry-svc/chart-acquirer-frontend/templates/service.yaml b/merchant-registry-svc/chart-acquirer-frontend/templates/service.yaml new file mode 100644 index 000000000..9d0016b84 --- /dev/null +++ b/merchant-registry-svc/chart-acquirer-frontend/templates/service.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Release.Name }}-acquirer-frontend-clusterip-service +spec: + type: {{ .Values.acquirerFrontend.service.type }} + selector: + component: acquirer-frontend + ports: + - port: {{ .Values.acquirerFrontend.service.port }} + targetPort: {{ .Values.acquirerFrontend.service.port }} diff --git a/merchant-registry-svc/chart-acquirer-frontend/values.yaml b/merchant-registry-svc/chart-acquirer-frontend/values.yaml new file mode 100644 index 000000000..9916a1b8d --- /dev/null +++ b/merchant-registry-svc/chart-acquirer-frontend/values.yaml @@ -0,0 +1,15 @@ +# Default values for acquirer-frontend. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +acquirerFrontend: + replicaCount: 1 + image: + repository: mojaloop/merchant-acquirer-frontend + tag: 0.1.3 + service: + type: ClusterIP + port: 5173 + env: + apiURL: "http://www.acquirer-merchant.local/api/v1" + recaptchaFrontendSiteKey: "6LcEfT4pAAAAAAONtUPIQYSoYvNSbvKiexaZLo4R" diff --git a/merchant-registry-svc/chart-merchant-db/Chart.yaml b/merchant-registry-svc/chart-merchant-db/Chart.yaml new file mode 100644 index 000000000..24c149023 --- /dev/null +++ b/merchant-registry-svc/chart-merchant-db/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: chart-merchant-db +description: A Helm chart for Kubernetes + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "1.16.0" diff --git a/merchant-registry-svc/chart-merchant-db/templates/configmap.yaml b/merchant-registry-svc/chart-merchant-db/templates/configmap.yaml new file mode 100644 index 000000000..bfcdb56a8 --- /dev/null +++ b/merchant-registry-svc/chart-merchant-db/templates/configmap.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Release.Name }}-merchant-db-init-script +data: + init-db.sql: | + {{- range .Values.merchantDb.databases }} + CREATE DATABASE IF NOT EXISTS {{ .name }}; + {{- end }} + diff --git a/merchant-registry-svc/chart-merchant-db/templates/deployment.yaml b/merchant-registry-svc/chart-merchant-db/templates/deployment.yaml new file mode 100644 index 000000000..6ab057e1e --- /dev/null +++ b/merchant-registry-svc/chart-merchant-db/templates/deployment.yaml @@ -0,0 +1,39 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.Name }}-merchant-db-deployment +spec: + replicas: {{ .Values.merchantDb.replicaCount }} + selector: + matchLabels: + component: merchant-db + template: + metadata: + labels: + component: merchant-db + spec: + containers: + - name: merchant-db + image: "{{ .Values.merchantDb.image.repository }}:{{ .Values.merchantDb.image.tag }}" + args: ["--default-authentication-plugin=mysql_native_password"] + env: + - name: MYSQL_ROOT_PASSWORD + valueFrom: + secretKeyRef: + name: {{ .Release.Name }}-{{ .Values.merchantDb.secret.name }} + key: mysql-root-password + ports: + - containerPort: {{ .Values.merchantDb.service.port }} + volumeMounts: + - name: merchant-db-vol + mountPath: /var/lib/mysql + - name: init-script + mountPath: /docker-entrypoint-initdb.d + volumes: + - name: merchant-db-vol + persistentVolumeClaim: + claimName: {{ .Release.Name }}-merchant-db-pvc + - name: init-script + configMap: + name: {{ .Release.Name }}-{{ .Values.merchantDb.initScript.name }} + diff --git a/merchant-registry-svc/chart-merchant-db/templates/pvc.yaml b/merchant-registry-svc/chart-merchant-db/templates/pvc.yaml new file mode 100644 index 000000000..a0f339d7b --- /dev/null +++ b/merchant-registry-svc/chart-merchant-db/templates/pvc.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ .Release.Name }}-merchant-db-pvc +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: {{ .Values.merchantDb.pvc.size }} + diff --git a/merchant-registry-svc/chart-merchant-db/templates/secret.yaml b/merchant-registry-svc/chart-merchant-db/templates/secret.yaml new file mode 100644 index 000000000..5bbb971ed --- /dev/null +++ b/merchant-registry-svc/chart-merchant-db/templates/secret.yaml @@ -0,0 +1,8 @@ +apiVersion: v1 +kind: Secret +metadata: + name: {{ .Release.Name }}-merchant-db-secret +type: Opaque +data: + mysql-root-password: {{ .Values.merchantDb.secret.mysqlRootPassword }} + diff --git a/merchant-registry-svc/chart-merchant-db/templates/service.yaml b/merchant-registry-svc/chart-merchant-db/templates/service.yaml new file mode 100644 index 000000000..c053a3742 --- /dev/null +++ b/merchant-registry-svc/chart-merchant-db/templates/service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Release.Name }}-merchant-db-clusterip-service +spec: + type: {{ .Values.merchantDb.service.type }} + selector: + component: merchant-db + ports: + - protocol: TCP + port: {{ .Values.merchantDb.service.port }} + targetPort: {{ .Values.merchantDb.service.port }} diff --git a/merchant-registry-svc/chart-merchant-db/values.yaml b/merchant-registry-svc/chart-merchant-db/values.yaml new file mode 100644 index 000000000..e4e8ac1b4 --- /dev/null +++ b/merchant-registry-svc/chart-merchant-db/values.yaml @@ -0,0 +1,22 @@ +# Default values for merchant-db. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +merchantDb: + replicaCount: 1 + image: + repository: mysql + tag: 8.0.33 + service: + type: ClusterIP + port: 3306 + pvc: + size: 2Gi + secret: + name: merchant-db-secret + mysqlRootPassword: "cGFzc3dvcmQ=" # make sure to base64 encode the password + databases: + - name: acquirer_db + - name: registry_db + initScript: + name: merchant-db-init-script diff --git a/merchant-registry-svc/chart-minio/Chart.yaml b/merchant-registry-svc/chart-minio/Chart.yaml new file mode 100644 index 000000000..a28d503c5 --- /dev/null +++ b/merchant-registry-svc/chart-minio/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: chart-minio +description: A Helm chart for Kubernetes + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "1.16.0" diff --git a/merchant-registry-svc/chart-minio/templates/deployment.yaml b/merchant-registry-svc/chart-minio/templates/deployment.yaml new file mode 100644 index 000000000..dc27795a5 --- /dev/null +++ b/merchant-registry-svc/chart-minio/templates/deployment.yaml @@ -0,0 +1,36 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.Name }}-minio-deployment +spec: + selector: + matchLabels: + component: minio + replicas: {{ .Values.minio.replicaCount }} + template: + metadata: + labels: + component: minio + spec: + containers: + - name: minio + image: "{{ .Values.minio.image.repository }}:{{ .Values.minio.image.tag }}" + args: + - server + - /data + env: + - name: MINIO_ROOT_USER + value: "{{ .Values.minio.env.rootUser }}" + - name: MINIO_ROOT_PASSWORD + value: "{{ .Values.minio.env.rootPassword }}" + - name: MINIO_SERVER_URL + value: "{{ .Values.minio.env.serverUrl }}" + ports: + - containerPort: {{ .Values.minio.service.port }} + volumeMounts: + - name: storage + mountPath: "/data" + volumes: + - name: storage + persistentVolumeClaim: + claimName: {{ .Release.Name }}-minio-s3-pvc diff --git a/merchant-registry-svc/chart-minio/templates/pvc.yaml b/merchant-registry-svc/chart-minio/templates/pvc.yaml new file mode 100644 index 000000000..37f56d1a3 --- /dev/null +++ b/merchant-registry-svc/chart-minio/templates/pvc.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ .Release.Name }}-minio-s3-pvc +spec: + accessModes: + - {{ .Values.minio.pvc.accessMode }} + resources: + requests: + storage: {{ .Values.minio.pvc.size }} + diff --git a/merchant-registry-svc/chart-minio/templates/service.yaml b/merchant-registry-svc/chart-minio/templates/service.yaml new file mode 100644 index 000000000..e1bf62e16 --- /dev/null +++ b/merchant-registry-svc/chart-minio/templates/service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Release.Name }}-minio-clusterip-service +spec: + type: {{ .Values.minio.service.type }} + ports: + - port: {{ .Values.minio.service.port }} + targetPort: {{ .Values.minio.service.port }} + selector: + component: minio + diff --git a/merchant-registry-svc/chart-minio/values.yaml b/merchant-registry-svc/chart-minio/values.yaml new file mode 100644 index 000000000..90b0020f9 --- /dev/null +++ b/merchant-registry-svc/chart-minio/values.yaml @@ -0,0 +1,20 @@ +# Default values for chart-minio. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +minio: + replicaCount: 1 + image: + repository: minio/minio + tag: RELEASE.2023-07-21T21-12-44Z + service: + type: ClusterIP + port: 9000 + pvc: + name: minio-s3-pvc + accessMode: ReadWriteOnce + size: 2Gi + env: + rootUser: "minioadmin" + rootPassword: "minioadmin" + serverUrl: "http://s3.acquirer-merchant.local" diff --git a/merchant-registry-svc/chart-rabbitmq/Chart.yaml b/merchant-registry-svc/chart-rabbitmq/Chart.yaml new file mode 100644 index 000000000..7a83fdc73 --- /dev/null +++ b/merchant-registry-svc/chart-rabbitmq/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: chart-rabbitmq +description: A Helm chart for Kubernetes + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "1.16.0" diff --git a/merchant-registry-svc/chart-rabbitmq/templates/deployment.yaml b/merchant-registry-svc/chart-rabbitmq/templates/deployment.yaml new file mode 100644 index 000000000..d0b3c76f1 --- /dev/null +++ b/merchant-registry-svc/chart-rabbitmq/templates/deployment.yaml @@ -0,0 +1,27 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.Name }}-rabbitmq-deployment +spec: + replicas: {{ .Values.rabbitmq.replicaCount }} + selector: + matchLabels: + component: rabbitmq + template: + metadata: + labels: + component: rabbitmq + spec: + containers: + - name: rabbitmq + image: "{{ .Values.rabbitmq.image.repository }}:{{ .Values.rabbitmq.image.tag }}" + env: + - name: RABBITMQ_DEFAULT_USER + value: "{{ .Values.rabbitmq.env.defaultUser }}" + - name: RABBITMQ_DEFAULT_PASS + value: "{{ .Values.rabbitmq.env.defaultPass }}" + ports: + {{- range .Values.rabbitmq.service.ports }} + - containerPort: {{ .port }} + {{- end }} + diff --git a/merchant-registry-svc/chart-rabbitmq/templates/service.yaml b/merchant-registry-svc/chart-rabbitmq/templates/service.yaml new file mode 100644 index 000000000..c427a884e --- /dev/null +++ b/merchant-registry-svc/chart-rabbitmq/templates/service.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Release.Name }}-rabbitmq-clusterip-service +spec: + type: {{ .Values.rabbitmq.service.type }} + ports: + {{- range .Values.rabbitmq.service.ports }} + - name: {{ .name }} + port: {{ .port }} + targetPort: {{ .targetPort }} + {{- end }} + selector: + component: rabbitmq diff --git a/merchant-registry-svc/chart-rabbitmq/values.yaml b/merchant-registry-svc/chart-rabbitmq/values.yaml new file mode 100644 index 000000000..8b15dcdc2 --- /dev/null +++ b/merchant-registry-svc/chart-rabbitmq/values.yaml @@ -0,0 +1,19 @@ +# Default values for chart-rabbitmq. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +rabbitmq: + replicaCount: 1 + image: + repository: rabbitmq + tag: 3.12.4-management-alpine + service: + type: ClusterIP + ports: + - name: amqp + port: 5672 + - name: management + port: 15672 + env: + defaultUser: "guest" + defaultPass: "guest" diff --git a/merchant-registry-svc/chart-registry-oracle/Chart.yaml b/merchant-registry-svc/chart-registry-oracle/Chart.yaml new file mode 100644 index 000000000..4cc0b204e --- /dev/null +++ b/merchant-registry-svc/chart-registry-oracle/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: chart-registry-oracle +description: A Helm chart for Kubernetes + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "1.16.0" diff --git a/merchant-registry-svc/chart-registry-oracle/templates/deployment.yaml b/merchant-registry-svc/chart-registry-oracle/templates/deployment.yaml new file mode 100644 index 000000000..b09d48c61 --- /dev/null +++ b/merchant-registry-svc/chart-registry-oracle/templates/deployment.yaml @@ -0,0 +1,42 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.Name }}-registry-oracle-deployment +spec: + replicas: {{ .Values.registryOracle.replicaCount }} + selector: + matchLabels: + component: registry-oracle + template: + metadata: + labels: + component: registry-oracle + spec: + containers: + - name: registry-oracle + image: "{{ .Values.registryOracle.image.repository }}:{{ .Values.registryOracle.image.tag }}" + ports: + - containerPort: {{ .Values.registryOracle.service.port }} + env: + - name: DB_HOST + value: "{{ .Release.Name }}-{{ .Values.registryOracle.env.dbHost }}" + - name: DB_PORT + value: "{{ .Values.registryOracle.env.dbPort }}" + - name: DB_DATABASE + value: "{{ .Values.registryOracle.env.database }}" + - name: DB_USERNAME + value: "{{ .Values.registryOracle.env.dbUsername }}" + - name: DB_PASSWORD + valueFrom: + secretKeyRef: + name: {{ .Release.Name }}-{{ .Values.registryOracle.env.dbPasswordSecret.name }} + key: {{ .Values.registryOracle.env.dbPasswordSecret.key }} + - name: RABBITMQ_HOST + value: "{{ .Release.Name }}-{{ .Values.registryOracle.env.rabbitmqHost }}" + - name: RABBITMQ_PORT + value: "{{ .Values.registryOracle.env.rabbitmqPort }}" + - name: RABBITMQ_USERNAME + value: "{{ .Values.registryOracle.env.rabbitmqUsername }}" + - name: RABBITMQ_PASSWORD + value: "{{ .Values.registryOracle.env.rabbitmqPassword }}" + diff --git a/merchant-registry-svc/chart-registry-oracle/templates/service.yaml b/merchant-registry-svc/chart-registry-oracle/templates/service.yaml new file mode 100644 index 000000000..75d817a8f --- /dev/null +++ b/merchant-registry-svc/chart-registry-oracle/templates/service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Release.Name }}-registry-oracle-clusterip-service +spec: + type: {{ .Values.registryOracle.service.type }} + selector: + component: registry-oracle + ports: + - port: {{ .Values.registryOracle.service.port }} + targetPort: {{ .Values.registryOracle.service.port }} + diff --git a/merchant-registry-svc/chart-registry-oracle/values.yaml b/merchant-registry-svc/chart-registry-oracle/values.yaml new file mode 100644 index 000000000..3f0b56dff --- /dev/null +++ b/merchant-registry-svc/chart-registry-oracle/values.yaml @@ -0,0 +1,21 @@ +registryOracle: + replicaCount: 1 + image: + repository: mojaloop/merchant-registry-oracle + tag: 0.1.3 + service: + type: ClusterIP + port: 8888 + env: + dbHost: merchant-db-clusterip-service + dbPort: "3306" + database: registry_db + dbUsername: root + dbPasswordSecret: + name: merchant-db-secret + key: mysql-root-password + rabbitmqHost: rabbitmq-clusterip-service + rabbitmqPort: "5672" + rabbitmqUsername: guest + rabbitmqPassword: guest + diff --git a/merchant-registry-svc/templates/ingress.yaml b/merchant-registry-svc/templates/ingress.yaml new file mode 100644 index 000000000..71521b106 --- /dev/null +++ b/merchant-registry-svc/templates/ingress.yaml @@ -0,0 +1,25 @@ +{{- if .Values.ingress.enabled }} +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ .Release.Name }}-merchant-ingress + annotations: +{{ toYaml .Values.ingress.annotations | nindent 4 }} +spec: + rules: + {{- $releaseName := .Release.Name }} + {{- range .Values.ingress.hosts }} + - host: "{{ .host }}" + http: + paths: + {{- range .paths }} + - path: "{{ .path }}" + pathType: {{ .pathType }} + backend: + service: + name: "{{ $releaseName }}-{{ .serviceName }}" + port: + number: {{ .servicePort }} + {{- end }} + {{- end }} +{{- end }} diff --git a/merchant-registry-svc/values.yaml b/merchant-registry-svc/values.yaml new file mode 100644 index 000000000..1276b0770 --- /dev/null +++ b/merchant-registry-svc/values.yaml @@ -0,0 +1,107 @@ +# Default values for helms. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. +replicaCount: 1 + +ingress: + enabled: true + annotations: + nginx.ingress.kubernetes.io/proxy-body-size: "100m" + # nginx.ingress.kubernetes.io/ssl-redirect: "true" + hosts: + - host: "www.acquirer-merchant.local" + paths: + - path: /api/v1 + pathType: Prefix + serviceName: acquirer-backend-clusterip-service + servicePort: 5555 + - path: /participants + pathType: Prefix + serviceName: registry-oracle-clusterip-service + servicePort: 8888 + - path: / + pathType: Prefix + serviceName: acquirer-frontend-clusterip-service + servicePort: 5173 + - host: "s3.acquirer-merchant.local" + paths: + - path: / + pathType: Prefix + serviceName: minio-clusterip-service + servicePort: 5173 +image: + repository: nginx + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "" + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podAnnotations: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 80 + +# ingress: +# enabled: false +# className: "" +# annotations: {} +# # kubernetes.io/ingress.class: nginx +# # kubernetes.io/tls-acme: "true" +# hosts: +# - host: chart-example.local +# paths: +# - path: / +# pathType: ImplementationSpecific +# tls: [] +# # - 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 + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +nodeSelector: {} + +tolerations: [] + +affinity: {} diff --git a/update-charts-dep.sh b/update-charts-dep.sh index 1f6bc0bf7..434975cae 100755 --- a/update-charts-dep.sh +++ b/update-charts-dep.sh @@ -49,6 +49,7 @@ declare -a charts=( thirdparty/chart-consent-oracle thirdparty/chart-tp-api-svc thirdparty + merchant-registry-svc mojaloop ) From ff7b9f60aa07524b29671ea3ce4013170c5d0786 Mon Sep 17 00:00:00 2001 From: stmSi Date: Mon, 5 Feb 2024 17:17:03 +0630 Subject: [PATCH 2/9] feat: add instruction doc for how to add Oracle to ALS --- merchant-registry-svc/README.md | 49 +++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/merchant-registry-svc/README.md b/merchant-registry-svc/README.md index f734be6fb..771326cd5 100644 --- a/merchant-registry-svc/README.md +++ b/merchant-registry-svc/README.md @@ -34,6 +34,55 @@ helm dep up ./ helm install merchant ./ --namespace mojaloop ``` +### Registering Merchant Oracle in Account Lookup Service + +1. Make sure the `account-lookup-service-admin` is running and accessible. +2. Make sure the `merchant-registry-oracle-clusterip-service` is accessible from the `account-lookup-service-admin` pod. +3. Run the following command to register the merchant oracle with `ALIAS` type: + +Replace `` and `` with the Cluster IP Addresses. +`kubectl get svc -n mojaloop` can be used to get the Cluster IP Addresses. + + +```bash +curl -X POST "http:///oracles" \ + -H "accept: application/json" -H "Content-Type: application/json" \ + -d '{ + "oracleIdType": "ALIAS", + "endpoint": { + "value": ":8888", + "endpointType": "URL" + }, + "currency": "USD", + "isDefault": true + }' +``` + +4. Verify the registration by running the following command: + +```bash +curl -X GET "http:///oracles" \ + -H "accept: application/json" \ + -H "Content-Type: application/json" \ + -H "date: $(date -Ru)" +``` + +should return the registered oracle. +```json +[ + { + "oracleId":1, + "oracleIdType":"ALIAS", + "endpoint":{ + "value":"10.43.83.251:8888", + "endpointType":"URL" + }, + "currency":"USD", + "isDefault":1 + } +] +``` + ### IMPORTANT NOTES: When updating ingress's host make sure to update the `apiUrl` of `./chart-acquirer-frontend/values.yaml` file too. From e5602e996d6c140174b7cf9aa8f167a691363af9 Mon Sep 17 00:00:00 2001 From: stmSi Date: Mon, 5 Feb 2024 17:47:31 +0630 Subject: [PATCH 3/9] feat: some style changes and add merchant to lint-charts.sh and package.sh --- lint-charts.sh | 1 + merchant-registry-svc/Chart.yaml | 28 +++++----------------------- package.sh | 1 + 3 files changed, 7 insertions(+), 23 deletions(-) diff --git a/lint-charts.sh b/lint-charts.sh index 9bcd479da..59a6195fc 100755 --- a/lint-charts.sh +++ b/lint-charts.sh @@ -49,6 +49,7 @@ else mojaloop-bulk/ mojaloop-simulator mojaloop + merchant-registry-svc # kube-system/ntpd/ # Deprecated - No longer supported ml-operator thirdparty/chart-auth-svc diff --git a/merchant-registry-svc/Chart.yaml b/merchant-registry-svc/Chart.yaml index f51ca7b79..29b6669f0 100644 --- a/merchant-registry-svc/Chart.yaml +++ b/merchant-registry-svc/Chart.yaml @@ -1,6 +1,9 @@ apiVersion: v2 -name: helms -description: A Helm chart for Kubernetes +name: merchant-registry +type: application +version: 0.1.0 +appVersion: "1.16.0" +description: Merchant Registry Helm chart for Kubernetes dependencies: - name: chart-acquirer-backend @@ -21,24 +24,3 @@ dependencies: - name: chart-registry-oracle version: 0.1.0 repository: file://./chart-registry-oracle - -# A chart can be either an 'application' or a 'library' chart. -# -# Application charts are a collection of templates that can be packaged into versioned archives -# to be deployed. -# -# Library charts provide useful utilities or functions for the chart developer. They're included as -# a dependency of application charts to inject those utilities and functions into the rendering -# pipeline. Library charts do not define any templates and therefore cannot be deployed. -type: application - -# This is the chart version. This version number should be incremented each time you make changes -# to the chart and its templates, including the app version. -# Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.0 - -# This is the version number of the application being deployed. This version number should be -# incremented each time you make changes to the application. Versions are not expected to -# follow Semantic Versioning. They should reflect the version the application is using. -# It is recommended to use it with quotes. -appVersion: "1.16.0" diff --git a/package.sh b/package.sh index c597977a8..24824ef6d 100755 --- a/package.sh +++ b/package.sh @@ -55,6 +55,7 @@ else thirdparty/chart-tp-api-svc thirdparty mojaloop + merchant-registry-svc kube-system/ntpd/ ml-operator ) From 31f2cb37387a0f952825b6cc909941946ad88643 Mon Sep 17 00:00:00 2001 From: stmSi Date: Tue, 6 Feb 2024 09:20:09 +0630 Subject: [PATCH 4/9] feat: add 3rd party service note --- merchant-registry-svc/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/merchant-registry-svc/README.md b/merchant-registry-svc/README.md index 771326cd5..64c9a0321 100644 --- a/merchant-registry-svc/README.md +++ b/merchant-registry-svc/README.md @@ -87,3 +87,7 @@ should return the registered oracle. When updating ingress's host make sure to update the `apiUrl` of `./chart-acquirer-frontend/values.yaml` file too. Otherwise frontend will not be able to communicate with backend. + +The system utilize RabbitMQ for message queuing between services and SendGrid for email verification. +Adopters can substitute these services with their preferred choices for a customized integration. + From ac3e6d0f6080a91fdf8b8421a631fa32e336b728 Mon Sep 17 00:00:00 2001 From: stmSi Date: Thu, 8 Feb 2024 10:19:55 +0630 Subject: [PATCH 5/9] feat: bump merchant services to v1.0.1 and add some note about MinIO S3 instance --- merchant-registry-svc/Chart.yaml | 10 ++++----- merchant-registry-svc/README.md | 3 +++ .../chart-acquirer-backend/Chart.yaml | 22 ++----------------- .../chart-acquirer-backend/values.yaml | 2 +- .../chart-acquirer-frontend/Chart.yaml | 22 ++----------------- .../chart-acquirer-frontend/values.yaml | 2 +- .../chart-registry-oracle/Chart.yaml | 22 ++----------------- .../chart-registry-oracle/values.yaml | 2 +- 8 files changed, 17 insertions(+), 68 deletions(-) diff --git a/merchant-registry-svc/Chart.yaml b/merchant-registry-svc/Chart.yaml index 29b6669f0..fd8ad5598 100644 --- a/merchant-registry-svc/Chart.yaml +++ b/merchant-registry-svc/Chart.yaml @@ -1,16 +1,16 @@ apiVersion: v2 name: merchant-registry type: application -version: 0.1.0 -appVersion: "1.16.0" +version: 1.0.1 +appVersion: "1.0.1" description: Merchant Registry Helm chart for Kubernetes dependencies: - name: chart-acquirer-backend - version: 0.1.0 + version: ">= 1.0.0" repository: file://./chart-acquirer-backend - name: chart-acquirer-frontend - version: 0.1.0 + version: ">= 1.0.0" repository: file://./chart-acquirer-frontend - name: chart-merchant-db version: 0.1.0 @@ -22,5 +22,5 @@ dependencies: version: 0.1.0 repository: file://./chart-rabbitmq - name: chart-registry-oracle - version: 0.1.0 + version: ">= 1.0.0" repository: file://./chart-registry-oracle diff --git a/merchant-registry-svc/README.md b/merchant-registry-svc/README.md index 64c9a0321..2141d7bf8 100644 --- a/merchant-registry-svc/README.md +++ b/merchant-registry-svc/README.md @@ -22,6 +22,9 @@ ### Deploying the Helm Charts +Note For Production: Recommended to use external Third Party S3 Services (like Amazon S3, Digital Ocean Space etc.) for storing the documents and QR Images instead of the MinIO S3 instance service. +See the [`./chart-acquirer-backend/values.yaml`](./chart-acquirer-backend/values.yaml) for the configuration. + 1. Build Dependency Chart ```bash diff --git a/merchant-registry-svc/chart-acquirer-backend/Chart.yaml b/merchant-registry-svc/chart-acquirer-backend/Chart.yaml index 4dc9ed690..81b319286 100644 --- a/merchant-registry-svc/chart-acquirer-backend/Chart.yaml +++ b/merchant-registry-svc/chart-acquirer-backend/Chart.yaml @@ -1,24 +1,6 @@ apiVersion: v2 name: chart-acquirer-backend description: A Helm chart for Kubernetes - -# A chart can be either an 'application' or a 'library' chart. -# -# Application charts are a collection of templates that can be packaged into versioned archives -# to be deployed. -# -# Library charts provide useful utilities or functions for the chart developer. They're included as -# a dependency of application charts to inject those utilities and functions into the rendering -# pipeline. Library charts do not define any templates and therefore cannot be deployed. type: application - -# This is the chart version. This version number should be incremented each time you make changes -# to the chart and its templates, including the app version. -# Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.0 - -# This is the version number of the application being deployed. This version number should be -# incremented each time you make changes to the application. Versions are not expected to -# follow Semantic Versioning. They should reflect the version the application is using. -# It is recommended to use it with quotes. -appVersion: "1.16.0" +version: 1.0.0 +appVersion: "1.0.1" diff --git a/merchant-registry-svc/chart-acquirer-backend/values.yaml b/merchant-registry-svc/chart-acquirer-backend/values.yaml index f3fb7481d..991a673f2 100644 --- a/merchant-registry-svc/chart-acquirer-backend/values.yaml +++ b/merchant-registry-svc/chart-acquirer-backend/values.yaml @@ -6,7 +6,7 @@ acquirerBackend: replicaCount: 1 image: repository: mojaloop/merchant-acquirer-backend - tag: 0.1.3 + tag: 1.0.1 service: type: ClusterIP port: 5555 diff --git a/merchant-registry-svc/chart-acquirer-frontend/Chart.yaml b/merchant-registry-svc/chart-acquirer-frontend/Chart.yaml index c5b43da71..76139a71a 100644 --- a/merchant-registry-svc/chart-acquirer-frontend/Chart.yaml +++ b/merchant-registry-svc/chart-acquirer-frontend/Chart.yaml @@ -1,24 +1,6 @@ apiVersion: v2 name: chart-acquirer-frontend description: A Helm chart for Kubernetes - -# A chart can be either an 'application' or a 'library' chart. -# -# Application charts are a collection of templates that can be packaged into versioned archives -# to be deployed. -# -# Library charts provide useful utilities or functions for the chart developer. They're included as -# a dependency of application charts to inject those utilities and functions into the rendering -# pipeline. Library charts do not define any templates and therefore cannot be deployed. type: application - -# This is the chart version. This version number should be incremented each time you make changes -# to the chart and its templates, including the app version. -# Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.0 - -# This is the version number of the application being deployed. This version number should be -# incremented each time you make changes to the application. Versions are not expected to -# follow Semantic Versioning. They should reflect the version the application is using. -# It is recommended to use it with quotes. -appVersion: "1.16.0" +version: 1.0.0 +appVersion: "1.0.1" diff --git a/merchant-registry-svc/chart-acquirer-frontend/values.yaml b/merchant-registry-svc/chart-acquirer-frontend/values.yaml index 9916a1b8d..65bd6b7fa 100644 --- a/merchant-registry-svc/chart-acquirer-frontend/values.yaml +++ b/merchant-registry-svc/chart-acquirer-frontend/values.yaml @@ -6,7 +6,7 @@ acquirerFrontend: replicaCount: 1 image: repository: mojaloop/merchant-acquirer-frontend - tag: 0.1.3 + tag: 1.0.1 service: type: ClusterIP port: 5173 diff --git a/merchant-registry-svc/chart-registry-oracle/Chart.yaml b/merchant-registry-svc/chart-registry-oracle/Chart.yaml index 4cc0b204e..cec50e6e4 100644 --- a/merchant-registry-svc/chart-registry-oracle/Chart.yaml +++ b/merchant-registry-svc/chart-registry-oracle/Chart.yaml @@ -1,24 +1,6 @@ apiVersion: v2 name: chart-registry-oracle description: A Helm chart for Kubernetes - -# A chart can be either an 'application' or a 'library' chart. -# -# Application charts are a collection of templates that can be packaged into versioned archives -# to be deployed. -# -# Library charts provide useful utilities or functions for the chart developer. They're included as -# a dependency of application charts to inject those utilities and functions into the rendering -# pipeline. Library charts do not define any templates and therefore cannot be deployed. type: application - -# This is the chart version. This version number should be incremented each time you make changes -# to the chart and its templates, including the app version. -# Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.0 - -# This is the version number of the application being deployed. This version number should be -# incremented each time you make changes to the application. Versions are not expected to -# follow Semantic Versioning. They should reflect the version the application is using. -# It is recommended to use it with quotes. -appVersion: "1.16.0" +version: 1.0.0 +appVersion: "1.0.1" diff --git a/merchant-registry-svc/chart-registry-oracle/values.yaml b/merchant-registry-svc/chart-registry-oracle/values.yaml index 3f0b56dff..3f705ce8a 100644 --- a/merchant-registry-svc/chart-registry-oracle/values.yaml +++ b/merchant-registry-svc/chart-registry-oracle/values.yaml @@ -2,7 +2,7 @@ registryOracle: replicaCount: 1 image: repository: mojaloop/merchant-registry-oracle - tag: 0.1.3 + tag: 1.0.1 service: type: ClusterIP port: 8888 From 809edd34d553ded935b2b6d7d3a3cb2b170c56d5 Mon Sep 17 00:00:00 2001 From: stmSi Date: Thu, 15 Feb 2024 08:56:18 +0630 Subject: [PATCH 6/9] feat: bump external dependencies versions to >= 1.0.0 --- merchant-registry-svc/Chart.yaml | 6 ++--- .../chart-merchant-db/Chart.yaml | 22 ++----------------- merchant-registry-svc/chart-minio/Chart.yaml | 22 ++----------------- .../chart-rabbitmq/Chart.yaml | 22 ++----------------- 4 files changed, 9 insertions(+), 63 deletions(-) diff --git a/merchant-registry-svc/Chart.yaml b/merchant-registry-svc/Chart.yaml index fd8ad5598..3eaa9ad2a 100644 --- a/merchant-registry-svc/Chart.yaml +++ b/merchant-registry-svc/Chart.yaml @@ -13,13 +13,13 @@ dependencies: version: ">= 1.0.0" repository: file://./chart-acquirer-frontend - name: chart-merchant-db - version: 0.1.0 + version: ">= 1.0.0" repository: file://./chart-merchant-db - name: chart-minio - version: 0.1.0 + version: ">= 1.0.0" repository: file://./chart-minio - name: chart-rabbitmq - version: 0.1.0 + version: ">= 1.0.0" repository: file://./chart-rabbitmq - name: chart-registry-oracle version: ">= 1.0.0" diff --git a/merchant-registry-svc/chart-merchant-db/Chart.yaml b/merchant-registry-svc/chart-merchant-db/Chart.yaml index 24c149023..3616c3f7a 100644 --- a/merchant-registry-svc/chart-merchant-db/Chart.yaml +++ b/merchant-registry-svc/chart-merchant-db/Chart.yaml @@ -1,24 +1,6 @@ apiVersion: v2 name: chart-merchant-db -description: A Helm chart for Kubernetes - -# A chart can be either an 'application' or a 'library' chart. -# -# Application charts are a collection of templates that can be packaged into versioned archives -# to be deployed. -# -# Library charts provide useful utilities or functions for the chart developer. They're included as -# a dependency of application charts to inject those utilities and functions into the rendering -# pipeline. Library charts do not define any templates and therefore cannot be deployed. +description: MySQL database for Merchant Registry type: application - -# This is the chart version. This version number should be incremented each time you make changes -# to the chart and its templates, including the app version. -# Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.0 - -# This is the version number of the application being deployed. This version number should be -# incremented each time you make changes to the application. Versions are not expected to -# follow Semantic Versioning. They should reflect the version the application is using. -# It is recommended to use it with quotes. +version: 1.0.0 appVersion: "1.16.0" diff --git a/merchant-registry-svc/chart-minio/Chart.yaml b/merchant-registry-svc/chart-minio/Chart.yaml index a28d503c5..390c804c5 100644 --- a/merchant-registry-svc/chart-minio/Chart.yaml +++ b/merchant-registry-svc/chart-minio/Chart.yaml @@ -1,24 +1,6 @@ apiVersion: v2 name: chart-minio -description: A Helm chart for Kubernetes - -# A chart can be either an 'application' or a 'library' chart. -# -# Application charts are a collection of templates that can be packaged into versioned archives -# to be deployed. -# -# Library charts provide useful utilities or functions for the chart developer. They're included as -# a dependency of application charts to inject those utilities and functions into the rendering -# pipeline. Library charts do not define any templates and therefore cannot be deployed. +description: MinIO chart for Merchant Registry type: application - -# This is the chart version. This version number should be incremented each time you make changes -# to the chart and its templates, including the app version. -# Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.0 - -# This is the version number of the application being deployed. This version number should be -# incremented each time you make changes to the application. Versions are not expected to -# follow Semantic Versioning. They should reflect the version the application is using. -# It is recommended to use it with quotes. +version: 1.0.0 appVersion: "1.16.0" diff --git a/merchant-registry-svc/chart-rabbitmq/Chart.yaml b/merchant-registry-svc/chart-rabbitmq/Chart.yaml index 7a83fdc73..d28ed205b 100644 --- a/merchant-registry-svc/chart-rabbitmq/Chart.yaml +++ b/merchant-registry-svc/chart-rabbitmq/Chart.yaml @@ -1,24 +1,6 @@ apiVersion: v2 name: chart-rabbitmq -description: A Helm chart for Kubernetes - -# A chart can be either an 'application' or a 'library' chart. -# -# Application charts are a collection of templates that can be packaged into versioned archives -# to be deployed. -# -# Library charts provide useful utilities or functions for the chart developer. They're included as -# a dependency of application charts to inject those utilities and functions into the rendering -# pipeline. Library charts do not define any templates and therefore cannot be deployed. +description: RabbitMQ chart for Merchant Registry type: application - -# This is the chart version. This version number should be incremented each time you make changes -# to the chart and its templates, including the app version. -# Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.0 - -# This is the version number of the application being deployed. This version number should be -# incremented each time you make changes to the application. Versions are not expected to -# follow Semantic Versioning. They should reflect the version the application is using. -# It is recommended to use it with quotes. +version: 1.0.0 appVersion: "1.16.0" From bee44f02a53d3b5cd335a8202e7cb60e76d82757 Mon Sep 17 00:00:00 2001 From: stmSi Date: Wed, 21 Feb 2024 11:50:33 +0630 Subject: [PATCH 7/9] feat: add automountServiceAccountToken and resources --- .../chart-acquirer-backend/templates/deployment.yaml | 2 ++ .../chart-acquirer-frontend/templates/deployment.yaml | 2 ++ .../chart-merchant-db/templates/deployment.yaml | 2 ++ merchant-registry-svc/chart-minio/templates/deployment.yaml | 2 ++ merchant-registry-svc/chart-rabbitmq/templates/deployment.yaml | 2 ++ .../chart-registry-oracle/templates/deployment.yaml | 2 ++ 6 files changed, 12 insertions(+) diff --git a/merchant-registry-svc/chart-acquirer-backend/templates/deployment.yaml b/merchant-registry-svc/chart-acquirer-backend/templates/deployment.yaml index 829ef2878..62f162744 100644 --- a/merchant-registry-svc/chart-acquirer-backend/templates/deployment.yaml +++ b/merchant-registry-svc/chart-acquirer-backend/templates/deployment.yaml @@ -12,11 +12,13 @@ spec: labels: component: acquirer-backend spec: + automountServiceAccountToken: false containers: - name: acquirer-backend image: "{{ .Values.acquirerBackend.image.repository }}:{{ .Values.acquirerBackend.image.tag }}" ports: - containerPort: {{ .Values.acquirerBackend.service.port }} + resources: {} env: - name: APP_URL # for email redirect verification value: "{{ .Values.acquirerBackend.env.appURL }}" diff --git a/merchant-registry-svc/chart-acquirer-frontend/templates/deployment.yaml b/merchant-registry-svc/chart-acquirer-frontend/templates/deployment.yaml index be4879517..4e48c38f6 100644 --- a/merchant-registry-svc/chart-acquirer-frontend/templates/deployment.yaml +++ b/merchant-registry-svc/chart-acquirer-frontend/templates/deployment.yaml @@ -12,11 +12,13 @@ spec: labels: component: acquirer-frontend spec: + automountServiceAccountToken: false containers: - name: acquirer-frontend image: "{{ .Values.acquirerFrontend.image.repository }}:{{ .Values.acquirerFrontend.image.tag }}" ports: - containerPort: {{ .Values.acquirerFrontend.service.port }} + resources: {} env: - name: VITE_API_URL value: "{{ .Values.acquirerFrontend.env.apiURL }}" diff --git a/merchant-registry-svc/chart-merchant-db/templates/deployment.yaml b/merchant-registry-svc/chart-merchant-db/templates/deployment.yaml index 6ab057e1e..937d8d3e0 100644 --- a/merchant-registry-svc/chart-merchant-db/templates/deployment.yaml +++ b/merchant-registry-svc/chart-merchant-db/templates/deployment.yaml @@ -12,10 +12,12 @@ spec: labels: component: merchant-db spec: + automountServiceAccountToken: false containers: - name: merchant-db image: "{{ .Values.merchantDb.image.repository }}:{{ .Values.merchantDb.image.tag }}" args: ["--default-authentication-plugin=mysql_native_password"] + resources: {} env: - name: MYSQL_ROOT_PASSWORD valueFrom: diff --git a/merchant-registry-svc/chart-minio/templates/deployment.yaml b/merchant-registry-svc/chart-minio/templates/deployment.yaml index dc27795a5..c6ae065a5 100644 --- a/merchant-registry-svc/chart-minio/templates/deployment.yaml +++ b/merchant-registry-svc/chart-minio/templates/deployment.yaml @@ -12,6 +12,7 @@ spec: labels: component: minio spec: + automountServiceAccountToken: false containers: - name: minio image: "{{ .Values.minio.image.repository }}:{{ .Values.minio.image.tag }}" @@ -30,6 +31,7 @@ spec: volumeMounts: - name: storage mountPath: "/data" + resources: {} volumes: - name: storage persistentVolumeClaim: diff --git a/merchant-registry-svc/chart-rabbitmq/templates/deployment.yaml b/merchant-registry-svc/chart-rabbitmq/templates/deployment.yaml index d0b3c76f1..0e7c4fec5 100644 --- a/merchant-registry-svc/chart-rabbitmq/templates/deployment.yaml +++ b/merchant-registry-svc/chart-rabbitmq/templates/deployment.yaml @@ -12,9 +12,11 @@ spec: labels: component: rabbitmq spec: + automountServiceAccountToken: false containers: - name: rabbitmq image: "{{ .Values.rabbitmq.image.repository }}:{{ .Values.rabbitmq.image.tag }}" + resources: {} env: - name: RABBITMQ_DEFAULT_USER value: "{{ .Values.rabbitmq.env.defaultUser }}" diff --git a/merchant-registry-svc/chart-registry-oracle/templates/deployment.yaml b/merchant-registry-svc/chart-registry-oracle/templates/deployment.yaml index b09d48c61..190bb4014 100644 --- a/merchant-registry-svc/chart-registry-oracle/templates/deployment.yaml +++ b/merchant-registry-svc/chart-registry-oracle/templates/deployment.yaml @@ -12,9 +12,11 @@ spec: labels: component: registry-oracle spec: + automountServiceAccountToken: false containers: - name: registry-oracle image: "{{ .Values.registryOracle.image.repository }}:{{ .Values.registryOracle.image.tag }}" + resources: {} ports: - containerPort: {{ .Values.registryOracle.service.port }} env: From 1ac8f0b355fadaf0463d6649cf227d1b2071001d Mon Sep 17 00:00:00 2001 From: stmSi Date: Wed, 21 Feb 2024 13:54:37 +0630 Subject: [PATCH 8/9] feat: add resource limits and requests for merchant helm chart values --- .../chart-acquirer-backend/templates/deployment.yaml | 3 ++- merchant-registry-svc/chart-acquirer-backend/values.yaml | 7 +++++++ .../chart-acquirer-frontend/templates/deployment.yaml | 3 ++- .../chart-acquirer-frontend/values.yaml | 9 +++++++++ .../chart-merchant-db/templates/deployment.yaml | 3 ++- merchant-registry-svc/chart-merchant-db/values.yaml | 9 +++++++++ .../chart-minio/templates/deployment.yaml | 3 ++- merchant-registry-svc/chart-minio/values.yaml | 9 +++++++++ .../chart-rabbitmq/templates/deployment.yaml | 3 ++- merchant-registry-svc/chart-rabbitmq/values.yaml | 8 ++++++++ .../chart-registry-oracle/templates/deployment.yaml | 3 ++- merchant-registry-svc/chart-registry-oracle/values.yaml | 7 +++++++ 12 files changed, 61 insertions(+), 6 deletions(-) diff --git a/merchant-registry-svc/chart-acquirer-backend/templates/deployment.yaml b/merchant-registry-svc/chart-acquirer-backend/templates/deployment.yaml index 62f162744..fe8ca932a 100644 --- a/merchant-registry-svc/chart-acquirer-backend/templates/deployment.yaml +++ b/merchant-registry-svc/chart-acquirer-backend/templates/deployment.yaml @@ -18,7 +18,8 @@ spec: image: "{{ .Values.acquirerBackend.image.repository }}:{{ .Values.acquirerBackend.image.tag }}" ports: - containerPort: {{ .Values.acquirerBackend.service.port }} - resources: {} + resources: + {{- toYaml .Values.resources | nindent 12 }} env: - name: APP_URL # for email redirect verification value: "{{ .Values.acquirerBackend.env.appURL }}" diff --git a/merchant-registry-svc/chart-acquirer-backend/values.yaml b/merchant-registry-svc/chart-acquirer-backend/values.yaml index 991a673f2..e304c4b30 100644 --- a/merchant-registry-svc/chart-acquirer-backend/values.yaml +++ b/merchant-registry-svc/chart-acquirer-backend/values.yaml @@ -28,3 +28,10 @@ acquirerBackend: frontendSetPasswordRedirectURL: "http://www.acquirer-merchant.local/set-password" # reset password link after email verification recaptchaBackendSiteKey: "6LcEfT4pAAAAAF9a9PgebViC87aRPsd10JQDalNy" +resources: + requests: + cpu: "200m" + memory: "256Mi" + limits: + cpu: "1000m" + memory: "512Mi" diff --git a/merchant-registry-svc/chart-acquirer-frontend/templates/deployment.yaml b/merchant-registry-svc/chart-acquirer-frontend/templates/deployment.yaml index 4e48c38f6..566ea4329 100644 --- a/merchant-registry-svc/chart-acquirer-frontend/templates/deployment.yaml +++ b/merchant-registry-svc/chart-acquirer-frontend/templates/deployment.yaml @@ -18,7 +18,8 @@ spec: image: "{{ .Values.acquirerFrontend.image.repository }}:{{ .Values.acquirerFrontend.image.tag }}" ports: - containerPort: {{ .Values.acquirerFrontend.service.port }} - resources: {} + resources: + {{- toYaml .Values.resources | nindent 12 }} env: - name: VITE_API_URL value: "{{ .Values.acquirerFrontend.env.apiURL }}" diff --git a/merchant-registry-svc/chart-acquirer-frontend/values.yaml b/merchant-registry-svc/chart-acquirer-frontend/values.yaml index 65bd6b7fa..a1da83371 100644 --- a/merchant-registry-svc/chart-acquirer-frontend/values.yaml +++ b/merchant-registry-svc/chart-acquirer-frontend/values.yaml @@ -13,3 +13,12 @@ acquirerFrontend: env: apiURL: "http://www.acquirer-merchant.local/api/v1" recaptchaFrontendSiteKey: "6LcEfT4pAAAAAAONtUPIQYSoYvNSbvKiexaZLo4R" + +resources: + requests: + cpu: "50m" + memory: "128Mi" + limits: + cpu: "200m" + memory: "256Mi" + diff --git a/merchant-registry-svc/chart-merchant-db/templates/deployment.yaml b/merchant-registry-svc/chart-merchant-db/templates/deployment.yaml index 937d8d3e0..30502c210 100644 --- a/merchant-registry-svc/chart-merchant-db/templates/deployment.yaml +++ b/merchant-registry-svc/chart-merchant-db/templates/deployment.yaml @@ -17,7 +17,8 @@ spec: - name: merchant-db image: "{{ .Values.merchantDb.image.repository }}:{{ .Values.merchantDb.image.tag }}" args: ["--default-authentication-plugin=mysql_native_password"] - resources: {} + resources: + {{- toYaml .Values.resources | nindent 12 }} env: - name: MYSQL_ROOT_PASSWORD valueFrom: diff --git a/merchant-registry-svc/chart-merchant-db/values.yaml b/merchant-registry-svc/chart-merchant-db/values.yaml index e4e8ac1b4..7c299dc74 100644 --- a/merchant-registry-svc/chart-merchant-db/values.yaml +++ b/merchant-registry-svc/chart-merchant-db/values.yaml @@ -20,3 +20,12 @@ merchantDb: - name: registry_db initScript: name: merchant-db-init-script + +resources: + requests: + cpu: "200m" + memory: "256Mi" + limits: + cpu: "1000m" + memory: "512Mi" + diff --git a/merchant-registry-svc/chart-minio/templates/deployment.yaml b/merchant-registry-svc/chart-minio/templates/deployment.yaml index c6ae065a5..fb3360813 100644 --- a/merchant-registry-svc/chart-minio/templates/deployment.yaml +++ b/merchant-registry-svc/chart-minio/templates/deployment.yaml @@ -31,7 +31,8 @@ spec: volumeMounts: - name: storage mountPath: "/data" - resources: {} + resources: + {{- toYaml .Values.resources | nindent 12 }} volumes: - name: storage persistentVolumeClaim: diff --git a/merchant-registry-svc/chart-minio/values.yaml b/merchant-registry-svc/chart-minio/values.yaml index 90b0020f9..dc7261065 100644 --- a/merchant-registry-svc/chart-minio/values.yaml +++ b/merchant-registry-svc/chart-minio/values.yaml @@ -18,3 +18,12 @@ minio: rootUser: "minioadmin" rootPassword: "minioadmin" serverUrl: "http://s3.acquirer-merchant.local" + +resources: + requests: + cpu: "200m" + memory: "256Mi" + limits: + cpu: "1000m" + memory: "512Mi" + diff --git a/merchant-registry-svc/chart-rabbitmq/templates/deployment.yaml b/merchant-registry-svc/chart-rabbitmq/templates/deployment.yaml index 0e7c4fec5..da24e23a0 100644 --- a/merchant-registry-svc/chart-rabbitmq/templates/deployment.yaml +++ b/merchant-registry-svc/chart-rabbitmq/templates/deployment.yaml @@ -16,7 +16,8 @@ spec: containers: - name: rabbitmq image: "{{ .Values.rabbitmq.image.repository }}:{{ .Values.rabbitmq.image.tag }}" - resources: {} + resources: + {{- toYaml .Values.resources | nindent 12 }} env: - name: RABBITMQ_DEFAULT_USER value: "{{ .Values.rabbitmq.env.defaultUser }}" diff --git a/merchant-registry-svc/chart-rabbitmq/values.yaml b/merchant-registry-svc/chart-rabbitmq/values.yaml index 8b15dcdc2..87325c8d7 100644 --- a/merchant-registry-svc/chart-rabbitmq/values.yaml +++ b/merchant-registry-svc/chart-rabbitmq/values.yaml @@ -17,3 +17,11 @@ rabbitmq: env: defaultUser: "guest" defaultPass: "guest" + +resources: + requests: + cpu: "200m" + memory: "256Mi" + limits: + cpu: "1000m" + memory: "512Mi" diff --git a/merchant-registry-svc/chart-registry-oracle/templates/deployment.yaml b/merchant-registry-svc/chart-registry-oracle/templates/deployment.yaml index 190bb4014..a3e487945 100644 --- a/merchant-registry-svc/chart-registry-oracle/templates/deployment.yaml +++ b/merchant-registry-svc/chart-registry-oracle/templates/deployment.yaml @@ -16,7 +16,8 @@ spec: containers: - name: registry-oracle image: "{{ .Values.registryOracle.image.repository }}:{{ .Values.registryOracle.image.tag }}" - resources: {} + resources: + {{- toYaml .Values.resources | nindent 12 }} ports: - containerPort: {{ .Values.registryOracle.service.port }} env: diff --git a/merchant-registry-svc/chart-registry-oracle/values.yaml b/merchant-registry-svc/chart-registry-oracle/values.yaml index 3f705ce8a..648d5430d 100644 --- a/merchant-registry-svc/chart-registry-oracle/values.yaml +++ b/merchant-registry-svc/chart-registry-oracle/values.yaml @@ -19,3 +19,10 @@ registryOracle: rabbitmqUsername: guest rabbitmqPassword: guest +resources: + requests: + cpu: "200m" + memory: "256Mi" + limits: + cpu: "1000m" + memory: "512Mi" From 8a20ec6179ca58c6fdefd7704bb962e4e37730be Mon Sep 17 00:00:00 2001 From: stmSi Date: Thu, 22 Feb 2024 15:17:03 +0630 Subject: [PATCH 9/9] add: storage limit to merchant-db and minio --- .../chart-acquirer-backend/.helmignore | 23 +++++++++++++++++++ .../chart-acquirer-frontend/.helmignore | 23 +++++++++++++++++++ .../chart-merchant-db/.helmignore | 23 +++++++++++++++++++ .../chart-merchant-db/values.yaml | 1 + merchant-registry-svc/chart-minio/.helmignore | 23 +++++++++++++++++++ merchant-registry-svc/chart-minio/values.yaml | 1 + .../chart-rabbitmq/.helmignore | 23 +++++++++++++++++++ .../chart-registry-oracle/.helmignore | 23 +++++++++++++++++++ 8 files changed, 140 insertions(+) create mode 100644 merchant-registry-svc/chart-acquirer-backend/.helmignore create mode 100644 merchant-registry-svc/chart-acquirer-frontend/.helmignore create mode 100644 merchant-registry-svc/chart-merchant-db/.helmignore create mode 100644 merchant-registry-svc/chart-minio/.helmignore create mode 100644 merchant-registry-svc/chart-rabbitmq/.helmignore create mode 100644 merchant-registry-svc/chart-registry-oracle/.helmignore diff --git a/merchant-registry-svc/chart-acquirer-backend/.helmignore b/merchant-registry-svc/chart-acquirer-backend/.helmignore new file mode 100644 index 000000000..0e8a0eb36 --- /dev/null +++ b/merchant-registry-svc/chart-acquirer-backend/.helmignore @@ -0,0 +1,23 @@ +# 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 +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/merchant-registry-svc/chart-acquirer-frontend/.helmignore b/merchant-registry-svc/chart-acquirer-frontend/.helmignore new file mode 100644 index 000000000..0e8a0eb36 --- /dev/null +++ b/merchant-registry-svc/chart-acquirer-frontend/.helmignore @@ -0,0 +1,23 @@ +# 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 +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/merchant-registry-svc/chart-merchant-db/.helmignore b/merchant-registry-svc/chart-merchant-db/.helmignore new file mode 100644 index 000000000..0e8a0eb36 --- /dev/null +++ b/merchant-registry-svc/chart-merchant-db/.helmignore @@ -0,0 +1,23 @@ +# 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 +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/merchant-registry-svc/chart-merchant-db/values.yaml b/merchant-registry-svc/chart-merchant-db/values.yaml index 7c299dc74..3e897160d 100644 --- a/merchant-registry-svc/chart-merchant-db/values.yaml +++ b/merchant-registry-svc/chart-merchant-db/values.yaml @@ -28,4 +28,5 @@ resources: limits: cpu: "1000m" memory: "512Mi" + ephemeral-storage: "2Gi" diff --git a/merchant-registry-svc/chart-minio/.helmignore b/merchant-registry-svc/chart-minio/.helmignore new file mode 100644 index 000000000..0e8a0eb36 --- /dev/null +++ b/merchant-registry-svc/chart-minio/.helmignore @@ -0,0 +1,23 @@ +# 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 +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/merchant-registry-svc/chart-minio/values.yaml b/merchant-registry-svc/chart-minio/values.yaml index dc7261065..2b1f7a255 100644 --- a/merchant-registry-svc/chart-minio/values.yaml +++ b/merchant-registry-svc/chart-minio/values.yaml @@ -26,4 +26,5 @@ resources: limits: cpu: "1000m" memory: "512Mi" + ephemeral-storage: "2Gi" diff --git a/merchant-registry-svc/chart-rabbitmq/.helmignore b/merchant-registry-svc/chart-rabbitmq/.helmignore new file mode 100644 index 000000000..0e8a0eb36 --- /dev/null +++ b/merchant-registry-svc/chart-rabbitmq/.helmignore @@ -0,0 +1,23 @@ +# 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 +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/merchant-registry-svc/chart-registry-oracle/.helmignore b/merchant-registry-svc/chart-registry-oracle/.helmignore new file mode 100644 index 000000000..0e8a0eb36 --- /dev/null +++ b/merchant-registry-svc/chart-registry-oracle/.helmignore @@ -0,0 +1,23 @@ +# 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 +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/