From e34a23325035529638e65dcf3d83891e86eeaeeb Mon Sep 17 00:00:00 2001 From: Denys Pohrebniak Date: Wed, 27 Aug 2025 17:23:27 +0300 Subject: [PATCH] SDP-1775 add enable AP flag --- charts/stellar-disbursement-platform/README.md | 6 +++++- .../templates/01.1-configmap-sdp.yaml | 3 +++ .../templates/01.2-configmap-ap.yaml | 4 +++- .../templates/02.2-deployment-ap.yaml | 2 ++ .../templates/03.2-service-ap.yaml | 2 ++ .../templates/04.2-ingress-ap.yaml | 2 +- .../templates/05.2-secrets-ap.yaml | 2 +- .../templates/_helpers.tpl | 7 +++++++ .../stellar-disbursement-platform/values.yaml | 17 ++++++++++++----- 9 files changed, 36 insertions(+), 9 deletions(-) diff --git a/charts/stellar-disbursement-platform/README.md b/charts/stellar-disbursement-platform/README.md index 473491c..e0e6365 100644 --- a/charts/stellar-disbursement-platform/README.md +++ b/charts/stellar-disbursement-platform/README.md @@ -23,7 +23,7 @@ This chart bootstraps a Stellar Disbursement Platform (SDP) deployment on a [Kub The SDP is a set of services that enable organizations to disburse funds to recipients using the Stellar network. The SDP consists of the following services: - Stellar Disbursement Platform (SDP) Core Service: the core backend service that performs several functions. -- Anchor Platform: the API server that the wallet uses to authenticate and initiate the recipient’s registration process through the SEP-24 deposit flow. +- Anchor Platform (optional): the API server that the wallet uses to authenticate and initiate the recipient's registration process through the SEP-24 deposit flow. **Note**: Anchor Platform can be disabled via `global.enableAnchorPlatform` (default: `false`). - Transaction Submission Service (TSS): the service that submits all payment transactions to the Stellar network. - Dashboard: the user interface administrators use to initiate and track the progress of disbursements. @@ -181,6 +181,7 @@ These parameters are shared by all charts. | `global.bridgeIntegration.enabled` | Determines if the bridge integration is enabled. If set to true, the bridge integration will be enabled. | `false` | | `global.bridgeIntegration.baseUrl` | The base URL of the bridge api. | `nil` | | `global.bridgeIntegration.apiKey` | The API key for the bridge integration. | `nil` | +| `global.enableAnchorPlatform` | Determines if the Anchor Platform service should be deployed. When disabled, SDP will not have Anchor Platform integration. | `false` | ### Stellar Disbursement Platform (SDP) parameters @@ -235,6 +236,7 @@ Configuration parameters for the SDP Core Service which is the core backend serv | `sdp.configMap.data.MAX_INVITATION_RESEND_ATTEMPTS` | The maximum number of times an invitation can be resent. 0 or negative values disable the job. | `3` | | `sdp.configMap.data.TENANT_XLM_BOOTSTRAP_AMOUNT` | The amount of XLM to be sent to a newly created tenant distribution account. | `5` | | `sdp.configMap.data.CIRCLE_API_TYPE` | The type of Circle API to be used. Options: "TRANSFERS", "PAYOUTS". Default: "TRANSFERS". | `TRANSFERS` | +| `sdp.configMap.data.ENABLE_ANCHOR_PLATFORM` | Determines if Anchor Platform integration is enabled. This is automatically set based on `global.enableAnchorPlatform`. | `false` | | `sdp.configMap.data.ENABLE_BRIDGE_INTEGRATION` | Determines if the bridge integration is enabled. If set to true, the bridge integration will be enabled. | | | `sdp.configMap.data.BRIDGE_BASE_URL` | The base URL of the bridge API. Required if ENABLE_BRIDGE_INTEGRATION is set to true. | | | `sdp.kubeSecrets` | Kubernetes secrets are used to manage sensitive information, such as API keys and private keys. It's crucial that these details are kept private. | | @@ -280,6 +282,8 @@ Configuration parameters for the SDP Core Service which is the core backend serv Configuration parameters for the Anchor Platform which is the API server that the wallet uses to authenticate and initiate the recipient's registration process through the SEP-24 deposit flow. +**Note**: This section is only used when `global.enableAnchorPlatform` is set to `true`. When disabled, SDP will not have Anchor Platform integration and related configurations will not be included in the SDP configmap. + | Name | Description | Value | | ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------- | | `anchorPlatform.route` | Configuration related to the routing of the Anchor Platform service. | | diff --git a/charts/stellar-disbursement-platform/templates/01.1-configmap-sdp.yaml b/charts/stellar-disbursement-platform/templates/01.1-configmap-sdp.yaml index 9571ad3..093e7b1 100644 --- a/charts/stellar-disbursement-platform/templates/01.1-configmap-sdp.yaml +++ b/charts/stellar-disbursement-platform/templates/01.1-configmap-sdp.yaml @@ -24,8 +24,10 @@ data: PORT: {{ include "sdp.port" . | quote }} METRICS_PORT: {{ include "sdp.metricsPort" . | quote }} ADMIN_PORT: {{ include "sdp.adminPort" . | quote }} + {{- if .Values.global.enableAnchorPlatform }} ANCHOR_PLATFORM_BASE_SEP_URL: {{ include "sdp.ap.baseURL" . | quote }} ANCHOR_PLATFORM_BASE_PLATFORM_URL: {{ include "sdp.ap.platformServiceAddress" . | quote }} + {{- end }} {{- /* Values from the `global` section */}} @@ -37,6 +39,7 @@ Values from the `global` section KAFKA_SECURITY_PROTOCOL: {{ .eventBroker.kafka.securityProtocol | quote }} {{- end }} SINGLE_TENANT_MODE: {{ .singleTenantMode | quote }} + ENABLE_ANCHOR_PLATFORM: {{ .enableAnchorPlatform | quote }} {{- if .distributionPublicKey }} DISTRIBUTION_PUBLIC_KEY: {{ .distributionPublicKey | quote }} {{- end }} diff --git a/charts/stellar-disbursement-platform/templates/01.2-configmap-ap.yaml b/charts/stellar-disbursement-platform/templates/01.2-configmap-ap.yaml index a7bf954..4329e4d 100644 --- a/charts/stellar-disbursement-platform/templates/01.2-configmap-ap.yaml +++ b/charts/stellar-disbursement-platform/templates/01.2-configmap-ap.yaml @@ -1,3 +1,4 @@ +{{- if .Values.global.enableAnchorPlatform }} --- apiVersion: v1 kind: ConfigMap @@ -98,4 +99,5 @@ data: {{- /* Values from the ap configmap section - These will override the global values */}} - {{- tpl (toYaml .Values.anchorPlatform.configMap.data | nindent 2) . }} \ No newline at end of file + {{- tpl (toYaml .Values.anchorPlatform.configMap.data | nindent 2) . }} +{{- end }} \ No newline at end of file diff --git a/charts/stellar-disbursement-platform/templates/02.2-deployment-ap.yaml b/charts/stellar-disbursement-platform/templates/02.2-deployment-ap.yaml index d34eda3..6d62081 100644 --- a/charts/stellar-disbursement-platform/templates/02.2-deployment-ap.yaml +++ b/charts/stellar-disbursement-platform/templates/02.2-deployment-ap.yaml @@ -1,3 +1,4 @@ +{{- if .Values.global.enableAnchorPlatform }} apiVersion: apps/v1 kind: Deployment metadata: @@ -128,3 +129,4 @@ spec: tolerations: {{- toYaml . | nindent 8 }} {{- end }} +{{- end }} diff --git a/charts/stellar-disbursement-platform/templates/03.2-service-ap.yaml b/charts/stellar-disbursement-platform/templates/03.2-service-ap.yaml index 7e7719a..cb9363d 100644 --- a/charts/stellar-disbursement-platform/templates/03.2-service-ap.yaml +++ b/charts/stellar-disbursement-platform/templates/03.2-service-ap.yaml @@ -1,3 +1,4 @@ +{{- if .Values.global.enableAnchorPlatform }} apiVersion: v1 kind: Service metadata: @@ -19,3 +20,4 @@ spec: selector: {{- include "sdp.selectorLabelsWithSuffix" (list . "-ap") | nindent 4 }} +{{- end }} diff --git a/charts/stellar-disbursement-platform/templates/04.2-ingress-ap.yaml b/charts/stellar-disbursement-platform/templates/04.2-ingress-ap.yaml index 77084b1..1b90bfd 100644 --- a/charts/stellar-disbursement-platform/templates/04.2-ingress-ap.yaml +++ b/charts/stellar-disbursement-platform/templates/04.2-ingress-ap.yaml @@ -1,4 +1,4 @@ -{{- if .Values.anchorPlatform.ingress.enabled -}} +{{- if and .Values.global.enableAnchorPlatform .Values.anchorPlatform.ingress.enabled -}} apiVersion: networking.k8s.io/v1 kind: Ingress metadata: diff --git a/charts/stellar-disbursement-platform/templates/05.2-secrets-ap.yaml b/charts/stellar-disbursement-platform/templates/05.2-secrets-ap.yaml index 4ba3196..3a5376c 100644 --- a/charts/stellar-disbursement-platform/templates/05.2-secrets-ap.yaml +++ b/charts/stellar-disbursement-platform/templates/05.2-secrets-ap.yaml @@ -1,4 +1,4 @@ -{{- if .Values.anchorPlatform.kubeSecrets.create -}} +{{- if and .Values.global.enableAnchorPlatform .Values.anchorPlatform.kubeSecrets.create -}} --- apiVersion: v1 kind: Secret diff --git a/charts/stellar-disbursement-platform/templates/_helpers.tpl b/charts/stellar-disbursement-platform/templates/_helpers.tpl index 482e00b..328a391 100644 --- a/charts/stellar-disbursement-platform/templates/_helpers.tpl +++ b/charts/stellar-disbursement-platform/templates/_helpers.tpl @@ -298,6 +298,13 @@ Returns: ECDSA private key in PEM format {{- $key -}} {{- end -}} +{{/* +Is Anchor Platform enabled? +*/}} +{{- define "isAnchorPlatformEnabled" -}} +{{- eq .Values.global.enableAnchorPlatform true | default false }} +{{- end }} + {{/* SDP base URL with schema and domain */}} diff --git a/charts/stellar-disbursement-platform/values.yaml b/charts/stellar-disbursement-platform/values.yaml index c65235e..4f74156 100644 --- a/charts/stellar-disbursement-platform/values.yaml +++ b/charts/stellar-disbursement-platform/values.yaml @@ -93,6 +93,9 @@ global: ## @param global.singleTenantMode Determines if the SDP service is running in single-tenant mode. singleTenantMode: false + ## @param global.enableAnchorPlatform Determines if the Anchor Platform service should be deployed. When disabled, SDP will not have Anchor Platform integration. + enableAnchorPlatform: false + ## @param global.distributionPublicKey The public key of the HOST's Stellar distribution account, used to create channel accounts. ## @param global.distributionPrivateKey The private key of the root Stellar distribution account distributionPublicKey: #required @@ -340,11 +343,15 @@ sdp: # NOTE: the hosts to be used here will be the same ones as in the sdp.route section. # =========================== START anchorPlatform =========================== - ## @section Anchor Platform - ## @descriptionStart - ## Configuration parameters for the Anchor Platform which is the API server that the wallet uses to authenticate and initiate - ## the recipient's registration process through the SEP-24 deposit flow. - ## @descriptionEnd +## @section Anchor Platform +## @descriptionStart +## Configuration parameters for the Anchor Platform which is the API server that the wallet uses to authenticate and initiate +## the recipient's registration process through the SEP-24 deposit flow. +## +## Note: This section is only used when `global.enableAnchorPlatform` is set to `true`. +## When disabled, SDP will not have Anchor Platform integration and related configurations +## will not be included in the SDP configmap. +## @descriptionEnd anchorPlatform: ## @extra anchorPlatform.route Configuration related to the routing of the Anchor Platform service.