From a5943506eb89a9749b9da4e7b259e1ccd2c73496 Mon Sep 17 00:00:00 2001 From: Martin Saporiti Date: Fri, 21 Jun 2024 13:59:48 -0300 Subject: [PATCH] chore: add custom did methods --- k8s/helm/readme.md | 7 +++++-- k8s/helm/templates/_helpers.tpl | 6 ++++++ k8s/helm/templates/issuer-node-api-configmap.yaml | 2 ++ k8s/helm/templates/issuer-node-api-deployment.yaml | 2 +- k8s/helm/templates/issuer-node-api-ui-deployment.yaml | 2 +- k8s/helm/templates/issuer-node-notifications.yaml | 2 +- k8s/helm/templates/issuer-node-pending-publisher.yaml | 2 +- k8s/helm/templates/issuer-node-ui-deployment.yaml | 1 + k8s/helm/templates/postgres-deployment.yaml | 2 +- k8s/helm/templates/redis-deployment.yaml | 2 +- k8s/helm/templates/vault-deployment.yaml | 2 +- k8s/helm/values.yaml | 3 ++- 12 files changed, 23 insertions(+), 10 deletions(-) diff --git a/k8s/helm/readme.md b/k8s/helm/readme.md index ce69d44a6..357757143 100644 --- a/k8s/helm/readme.md +++ b/k8s/helm/readme.md @@ -39,6 +39,7 @@ export INGRESS_ENABLED=true # If this value is false export VAULT_PWD=password # Vault password. export RHS_MODE=None # Reverse Hash Service mode. Options: None, OnChain, OffChain export RHS_URL="https://reverse-hash-service.com" # Reverse Hash Service URL. Required if RHS_MODE is OffChain +export ISSUER_CUSTOM_DID_METHODS='[{"blockchain":"camino","network":"columbus","networkFlag":"0b10000011","chainID":501}]' # Custom DID methods ``` ## Install the helm chart with ingress and domain names @@ -59,7 +60,8 @@ helm install "$APP_INSTANCE_NAME" . \ --set privateKey="$PRIVATE_KEY" \ --set vaultpwd="$VAULT_PWD" \ --set rhsMode="$RHS_MODE" \ ---set rhsUrl="$RHS_URL" +--set rhsUrl="$RHS_URL" \ +--set issuerCustomDidMethods="$ISSUER_CUSTOM_DID_METHODS" ``` In the code above, the PUBLIC_IP is not provided because is not needed when the ingress is enabled. @@ -82,7 +84,8 @@ helm install "$APP_INSTANCE_NAME" . \ --set privateKey="$PRIVATE_KEY" \ --set vaultpwd="$VAULT_PWD" \ --set rhsMode="$RHS_MODE" \ ---set rhsUrl="$RHS_URL" +--set rhsUrl="$RHS_URL" \ +--set issuerCustomDidMethods="$ISSUER_CUSTOM_DID_METHODS" ``` In the code above, the publicIP is provided because is needed when the ingress is not enabled. In this case `$APP_DOMAIN`, `$UI_DOMAIN` and `$API_DOMAIN` are not used. diff --git a/k8s/helm/templates/_helpers.tpl b/k8s/helm/templates/_helpers.tpl index cd7201ba1..42d343528 100644 --- a/k8s/helm/templates/_helpers.tpl +++ b/k8s/helm/templates/_helpers.tpl @@ -278,3 +278,9 @@ Define custom service selectorLabels for vault {{- define "polygon-id-issuer.vaultIssuerNode.Labels" -}} app: {{ .Values.vaultIssuerNode.service.selector }} {{- end }} + + + +{{- define "helpers.serviceAccountName" -}} +{{- printf "%s-%s%s" .Release.Name .Release.Namespace "-service-account" -}} +{{- end -}} \ No newline at end of file diff --git a/k8s/helm/templates/issuer-node-api-configmap.yaml b/k8s/helm/templates/issuer-node-api-configmap.yaml index 1d3abf7bb..849aeb97e 100644 --- a/k8s/helm/templates/issuer-node-api-configmap.yaml +++ b/k8s/helm/templates/issuer-node-api-configmap.yaml @@ -48,6 +48,8 @@ data: ISSUER_CREDENTIAL_STATUS_RHS_CHAIN_ID : {{ include "helpers.api-rsh-chain-id" . | nindent 4 }} ISSUER_CREDENTIAL_STATUS_ONCHAIN_TREE_STORE_SUPPORTED_CONTRACT : {{ include "helpers.api-rsh-contract" . | nindent 4 }} ISSUER_IPFS_GATEWAY_URL : {{ .Values.apiIssuerNode.configMap.issuerIpfsGatewayUrl | quote }} + ISSUER_CUSTOM_DID_METHODS : {{ .Values.issuerCustomDidMethods | toJson | quote }} + \ No newline at end of file diff --git a/k8s/helm/templates/issuer-node-api-deployment.yaml b/k8s/helm/templates/issuer-node-api-deployment.yaml index e413ca47d..552a00be7 100644 --- a/k8s/helm/templates/issuer-node-api-deployment.yaml +++ b/k8s/helm/templates/issuer-node-api-deployment.yaml @@ -17,7 +17,7 @@ spec: {{- include "polygon-id-issuer.apiIssuerNode.Labels" . | nindent 8 }} {{- include "polygon-id-issuer.selectorLabels" . | nindent 8 }} spec: - serviceAccountName: issuer-node-service-account + serviceAccountName: {{ include "helpers.serviceAccountName" . }} containers: - name: {{ .Values.apiIssuerNode.deployment.containerName }} image: {{ .Values.issuernode_repository_image }}:{{ .Values.issuernode_repository_tag }} diff --git a/k8s/helm/templates/issuer-node-api-ui-deployment.yaml b/k8s/helm/templates/issuer-node-api-ui-deployment.yaml index f736d6feb..8f00bda58 100644 --- a/k8s/helm/templates/issuer-node-api-ui-deployment.yaml +++ b/k8s/helm/templates/issuer-node-api-ui-deployment.yaml @@ -17,7 +17,7 @@ spec: {{- include "polygon-id-issuer.apiUiIssuerNode.Labels" . | nindent 8 }} {{- include "polygon-id-issuer.selectorLabels" . | nindent 8 }} spec: - serviceAccountName: issuer-node-service-account + serviceAccountName: {{ include "helpers.serviceAccountName" . }} initContainers: - name: {{ .Values.apiUiIssuerNode.deployment.init.containerName }} image: {{ .Values.issuernode_repository_image }}:{{ .Values.issuernode_repository_tag }} diff --git a/k8s/helm/templates/issuer-node-notifications.yaml b/k8s/helm/templates/issuer-node-notifications.yaml index 71124c72a..0febae3a3 100644 --- a/k8s/helm/templates/issuer-node-notifications.yaml +++ b/k8s/helm/templates/issuer-node-notifications.yaml @@ -17,7 +17,7 @@ spec: {{- include "polygon-id-issuer.notificationsIssuerNode.Labels" . | nindent 8 }} {{- include "polygon-id-issuer.selectorLabels" . | nindent 8 }} spec: - serviceAccountName: issuer-node-service-account + serviceAccountName: {{ include "helpers.serviceAccountName" . }} containers: - name: {{ .Values.notificationsIssuerNode.deployment.containerName }} image: {{ .Values.issuernode_repository_image }}:{{ .Values.issuernode_repository_tag }} diff --git a/k8s/helm/templates/issuer-node-pending-publisher.yaml b/k8s/helm/templates/issuer-node-pending-publisher.yaml index 539202600..6ef63dae9 100644 --- a/k8s/helm/templates/issuer-node-pending-publisher.yaml +++ b/k8s/helm/templates/issuer-node-pending-publisher.yaml @@ -17,7 +17,7 @@ spec: {{- include "polygon-id-issuer.pendingPublisherIssuerNode.Labels" . | nindent 8 }} {{- include "polygon-id-issuer.selectorLabels" . | nindent 8 }} spec: - serviceAccountName: issuer-node-service-account + serviceAccountName: {{ include "helpers.serviceAccountName" . }} containers: - name: {{ .Values.pendingPublisherIssuerNode.deployment.containerName }} image: {{ .Values.issuernode_repository_image }}:{{ .Values.issuernode_repository_tag }} diff --git a/k8s/helm/templates/issuer-node-ui-deployment.yaml b/k8s/helm/templates/issuer-node-ui-deployment.yaml index 097e95b1d..fc6a0d162 100644 --- a/k8s/helm/templates/issuer-node-ui-deployment.yaml +++ b/k8s/helm/templates/issuer-node-ui-deployment.yaml @@ -17,6 +17,7 @@ spec: {{- include "polygon-id-issuer.uiIssuerNode.Labels" . | nindent 8 }} {{- include "polygon-id-issuer.selectorLabels" . | nindent 8 }} spec: + serviceAccountName: {{ include "helpers.serviceAccountName" . }} containers: - name: {{ .Values.uiIssuerNode.deployment.containerName }} image: {{ .Values.issuernode_ui_repository_image }}:{{ .Values.issuernode_ui_repository_tag }} diff --git a/k8s/helm/templates/postgres-deployment.yaml b/k8s/helm/templates/postgres-deployment.yaml index 0c20e79ca..7e6e423dd 100644 --- a/k8s/helm/templates/postgres-deployment.yaml +++ b/k8s/helm/templates/postgres-deployment.yaml @@ -17,7 +17,7 @@ spec: {{- include "polygon-id-issuer.postgresIssuerNode.Labels" . | nindent 8 }} {{- include "polygon-id-issuer.selectorLabels" . | nindent 8 }} spec: - serviceAccountName: issuer-node-service-account + serviceAccountName: {{ include "helpers.serviceAccountName" . }} containers: - name: {{ .Values.postgresIssuerNode.deployment.containerName }} image: {{ .Values.postgresIssuerNode.deployment.image.repository }}:{{ .Values.postgresIssuerNode.deployment.image.tag }} diff --git a/k8s/helm/templates/redis-deployment.yaml b/k8s/helm/templates/redis-deployment.yaml index d65bfbf11..370c3d905 100644 --- a/k8s/helm/templates/redis-deployment.yaml +++ b/k8s/helm/templates/redis-deployment.yaml @@ -17,7 +17,7 @@ spec: {{- include "polygon-id-issuer.redisIssuerNode.Labels" . | nindent 8 }} {{- include "polygon-id-issuer.selectorLabels" . | nindent 8 }} spec: - serviceAccountName: issuer-node-service-account + serviceAccountName: {{ include "helpers.serviceAccountName" . }} containers: - name: {{ .Values.redisIssuerNode.deployment.containerName }} image: {{ .Values.redisIssuerNode.deployment.image.repository }}:{{ .Values.redisIssuerNode.deployment.image.tag }} diff --git a/k8s/helm/templates/vault-deployment.yaml b/k8s/helm/templates/vault-deployment.yaml index 767ede10b..ffbf8306b 100644 --- a/k8s/helm/templates/vault-deployment.yaml +++ b/k8s/helm/templates/vault-deployment.yaml @@ -18,7 +18,7 @@ spec: {{- include "polygon-id-issuer.vaultIssuerNode.Labels" . | nindent 8 }} {{- include "polygon-id-issuer.selectorLabels" . | nindent 8 }} spec: - serviceAccountName: issuer-node-service-account + serviceAccountName: {{ include "helpers.serviceAccountName" . }} containers: - name: {{ .Values.vaultIssuerNode.deployment.containerName }} securityContext: diff --git a/k8s/helm/values.yaml b/k8s/helm/values.yaml index 0d261de1b..4d3146aa8 100644 --- a/k8s/helm/values.yaml +++ b/k8s/helm/values.yaml @@ -208,7 +208,7 @@ uiIssuerNode: issuerUiBlockExplorerUrlMain: https://polygonscan.com/ issuerUiIpfsGatewayUrl: https://ipfs.io issuerApiUiName: issuer-node-ui-configmap - issuerUiSchemaExplorerAndBuilderUrl: https://schema-builder.polygonid.me + issuerUiSchemaExplorerAndBuilderUrl: https://tools.privado.id postgresIssuerNode: deployment: @@ -475,3 +475,4 @@ issuerKeyType: BJJ rhsMode: None rhsUrl: nil +issuerCustomDidMethods: ""