Skip to content

Commit

Permalink
Merge pull request #678 from 0xPolygonID/update-helm-vaules
Browse files Browse the repository at this point in the history
chore: add custom did methods
  • Loading branch information
martinsaporiti authored Jun 28, 2024
2 parents befbf9e + 63443c6 commit 7737138
Show file tree
Hide file tree
Showing 14 changed files with 29 additions and 12 deletions.
2 changes: 1 addition & 1 deletion infrastructure/local/docker-compose-infra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ services:
"--spider",
"--proxy",
"off",
"http://localhost:8200/v1/sys/health?standbyok=true",
"http://vault:8200/v1/sys/health?standbyok=true",
]
interval: 10s
timeout: 3s
Expand Down
9 changes: 7 additions & 2 deletions k8s/helm/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,14 @@ export PRIVATE_KEY='YOUR PRIVATE KEY' # Private key of the wal
export PUBLIC_IP='YOUR PUBLIC IP' # Provide the PUBLIC IP if you have any otherwise leave this field.
export MAINNET=false # Specify if the network is main, if this value is false issuer node will use amoy
export UIPASSWORD="my ui password" # Password for user: ui-user. This password is used when the user visit the ui.
export UI_INSECURE=true # Set as true if the ui doesn't require basic auth. If this value true UIPASSWORD can be blank
export ISSUERNAME="My Issuer" # Issuer Name. This value is shown in the UI
export ISSUER_ETHERUM_URL="https://polygon-amoy.XXXX" # Blockchain RPC.
export INGRESS_ENABLED=true # If this value is false you must provide a STATIC_IP
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
Expand All @@ -59,7 +61,9 @@ 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-json issuerCustomDidMethods="$ISSUER_CUSTOM_DID_METHODS" \
--set issuerUiInsecure=$UI_INSECURE
```

In the code above, the PUBLIC_IP is not provided because is not needed when the ingress is enabled.
Expand All @@ -82,7 +86,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.
Expand Down
6 changes: 6 additions & 0 deletions k8s/helm/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}
2 changes: 2 additions & 0 deletions k8s/helm/templates/issuer-node-api-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}




2 changes: 1 addition & 1 deletion k8s/helm/templates/issuer-node-api-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion k8s/helm/templates/issuer-node-api-ui-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion k8s/helm/templates/issuer-node-notifications.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion k8s/helm/templates/issuer-node-pending-publisher.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
3 changes: 2 additions & 1 deletion k8s/helm/templates/issuer-node-ui-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ data:
ISSUER_API_UI_AUTH_PASSWORD: {{ .Values.uiIssuerNode.configMap.issuerApiUiAuthPassword }}
ISSUER_API_UI_ISSUER_NAME: {{ .Values.issuerName }}
ISSUER_UI_IPFS_GATEWAY_URL: {{ .Values.uiIssuerNode.configMap.issuerUiIpfsGatewayUrl }}
ISSUER_UI_SCHEMA_EXPLORER_AND_BUILDER_URL: {{ .Values.uiIssuerNode.configMap.issuerUiSchemaExplorerAndBuilderUrl }}
ISSUER_UI_SCHEMA_EXPLORER_AND_BUILDER_URL: {{ .Values.uiIssuerNode.configMap.issuerUiSchemaExplorerAndBuilderUrl }}
ISSUER_UI_INSECURE: {{ .Values.issuerUiInsecure | quote }}
1 change: 1 addition & 0 deletions k8s/helm/templates/issuer-node-ui-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion k8s/helm/templates/postgres-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion k8s/helm/templates/redis-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion k8s/helm/templates/vault-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 3 additions & 1 deletion k8s/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -464,6 +464,7 @@ issuerEthereumUrl: https://polygon-amoy.g.alchemy.com/v2/
mainnet: false
publicIP: nil
uiPassword: password
issuerUiInsecure: false
issuerName: "My Issuer!"
ingressEnabled: false
privateKey: metamask private key
Expand All @@ -475,3 +476,4 @@ issuerKeyType: BJJ
rhsMode: None
rhsUrl: nil

issuerCustomDidMethods: ""

0 comments on commit 7737138

Please sign in to comment.