Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/veritable-cloudagent/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ maintainers:
name: veritable-cloudagent
sources:
- https://github.com/digicatapult/veritable-cloudagent
version: 2.4.56
version: 2.5.0
41 changes: 40 additions & 1 deletion charts/veritable-cloudagent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ The command removes all the Kubernetes components associated with the chart and
| `postgresql.enabled` | Switch to enable or disable the PostgreSQL helm chart | `true` |
| `postgresql.auth.username` | Name for a custom user to create | `veritable-cloudgent` |
| `postgresql.auth.password` | Password for the custom user to create | `""` |
| `postgresql.auth.database` | Name for a custom database to create | `wallet-id` |
| `postgresql.auth.database` | Name for a custom database to create | `did-web-server` |
| `postgresql.auth.existingSecret` | Name of existing secret to use for PostgreSQL credentials | `""` |
| `postgresql.architecture` | PostgreSQL architecture (`standalone` or `replication`) | `standalone` |
| `postgresql.global.security.allowInsecureImages` | Allow usage of `bitnamilegacy` repository` | `true` |
Expand All @@ -343,6 +343,45 @@ The command removes all the Kubernetes components associated with the chart and
| `externalDatabase.existingSecretPasswordKey` | Name of an existing secret key containing the non-root credentials | `""` |
| `externalDatabase.existingSecretPostgresPasswordKey` | Name of an existing secret key containing the admin credentials | `""` |

### Database Migration Init Container Parameters

| Name | Description | Value |
| --------------------------- | ------------------------------------------- | -------------------- |
| `initDbMigrate.enabled` | Run database migration in an init container | `true` |
| `initDbMigrate.environment` | NODE_ENV value used during migration | `production` |
| `initDbMigrate.args` | Arguments supplied to npx knex (array) | `["migrate:latest"]` |

### DID Web Server Parameters

| Name | Description | Value |
| ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------ |
| `didWebServer.enabled` | Enable DID Web Server feature. When false, no related resources/env vars are rendered | `false` |
| `didWebServer.containerPort` | Container port the DID Web Server listens on (maps to DID_WEB_PORT) | `8443` |
| `didWebServer.env.didWebDbName` | Override database name for DID Web Server (DID_WEB_DB_NAME) | `did-web-server` |
| `didWebServer.env.didWebDomain` | Domain portion (URL-encoded) for did:web identifiers (DID_WEB_DOMAIN) | `""` |
| `didWebServer.env.didWebServiceEndpoint` | Explicit service endpoint for DID doc generation; empty => use veritable-cloudagent.defineEndpoint helper (DID_WEB_SERVICE_ENDPOINT) | `""` |
| `didWebServer.env.useDevCert` | Use development self-signed certificate inside container (DID_WEB_USE_DEV_CERT) | `false` |
| `didWebServer.env.devCertPath` | Path to development certificate inside container (DID_WEB_DEV_CERT_PATH) | `""` |
| `didWebServer.env.devKeyPath` | Path to development key inside container (DID_WEB_DEV_KEY_PATH) | `""` |
| `didWebServer.service.enabled` | Create a Service for the DID Web Server | `true` |
| `didWebServer.service.type` | Kubernetes Service type | `ClusterIP` |
| `didWebServer.service.port` | Service port to expose DID Web Server | `80` |
| `didWebServer.service.targetPort` | Target container port for DID Web Server traffic | `8443` |
| `didWebServer.service.annotations` | Additional annotations for DID Web Server service | `{}` |
| `didWebServer.service.labels` | Additional labels for DID Web Server service | `{}` |
| `didWebServer.ingress.enabled` | Create an Ingress for the DID Web Server | `false` |
| `didWebServer.ingress.className` | IngressClass name | `""` |
| `didWebServer.ingress.hostname` | Hostname for DID Web Server ingress | `""` |
| `didWebServer.ingress.path` | Base path for DID Web Server ingress | `/.well-known/did.json` |
| `didWebServer.ingress.pathType` | Ingress pathType | `ImplementationSpecific` |
| `didWebServer.ingress.tls` | TLS configuration entries for DID Web Server ingress | `[]` |
| `didWebServer.ingress.annotations` | Additional annotations for DID Web Server ingress | `{}` |
| `didWebServer.ingress.extraHosts` | Additional hosts for DID Web Server ingress | `[]` |
| `didWebServer.ingress.extraPaths` | Additional paths for primary host | `[]` |
| `didWebServer.ingress.extraTls` | Additional TLS entries | `[]` |
| `didWebServer.ingress.extraRules` | Additional raw ingress rules | `[]` |
| `didWebServer.extraEnv` | Additional map of extra environment variables to inject (merged as simple key/value) | `{}` |

## Configuration and installation details

### [Rolling VS Immutable tags](https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/)
Expand Down
73 changes: 73 additions & 0 deletions charts/veritable-cloudagent/templates/didwebserver-ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{{- if and .Values.didWebServer.enabled .Values.didWebServer.ingress.enabled }}
---
apiVersion: {{ include "common.capabilities.ingress.apiVersion" . }}
kind: Ingress
metadata:
name: {{ include "common.names.fullname" . }}-didweb
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
app.kubernetes.io/component: did-web-server
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if or .Values.didWebServer.ingress.annotations .Values.commonAnnotations }}
annotations:
{{- if .Values.didWebServer.ingress.annotations }}
{{- include "common.tplvalues.render" ( dict "value" .Values.didWebServer.ingress.annotations "context" $) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
{{- end }}
spec:
{{- if .Values.didWebServer.ingress.className }}
ingressClassName: {{ .Values.didWebServer.ingress.className | quote }}
{{- end }}
rules:
{{- if .Values.didWebServer.ingress.hostname }}
- host: {{ .Values.didWebServer.ingress.hostname | quote }}
http:
paths:
{{- $svcName := printf "%s-didweb" (include "common.names.fullname" $) }}
- path: {{ .Values.didWebServer.ingress.path }}
{{- if eq "true" (include "common.ingress.supportsPathType" $) }}
pathType: {{ .Values.didWebServer.ingress.pathType }}
{{- end }}
backend: {{- include "common.ingress.backend" (dict "serviceName" $svcName "servicePort" "http" "context" $) | nindent 14 }}
{{- if .Values.didWebServer.ingress.extraPaths }}
{{- toYaml .Values.didWebServer.ingress.extraPaths | nindent 10 }}
{{- end }}
{{- end }}
{{- range .Values.didWebServer.ingress.extraHosts }}
- host: {{ .name | quote }}
http:
paths:
{{- $svcName := printf "%s-didweb" (include "common.names.fullname" $) }}
{{- if $.Values.didWebServer.ingress.extraPaths }}
{{- toYaml $.Values.didWebServer.ingress.extraPaths | nindent 10 }}
{{- end }}
{{- range .paths }}
- path: {{ .path }}
{{- if eq "true" (include "common.ingress.supportsPathType" $) }}
pathType: {{ default "ImplementationSpecific" .pathType }}
{{- end }}
backend: {{- include "common.ingress.backend" (dict "serviceName" $svcName "servicePort" "http" "context" $) | nindent 14 }}
{{- end }}
{{- end }}
{{- if .Values.didWebServer.ingress.extraRules }}
{{- include "common.tplvalues.render" (dict "value" .Values.didWebServer.ingress.extraRules "context" $) | nindent 4 }}
{{- end }}
{{- if or .Values.didWebServer.ingress.tls .Values.didWebServer.ingress.extraTls }}
tls:
{{- range .Values.didWebServer.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- if .Values.didWebServer.ingress.extraTls }}
{{- include "common.tplvalues.render" (dict "value" .Values.didWebServer.ingress.extraTls "context" $) | nindent 4 }}
{{- end }}
{{- end }}
{{- end }}
33 changes: 33 additions & 0 deletions charts/veritable-cloudagent/templates/didwebserver-svc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{{- if and .Values.didWebServer.enabled .Values.didWebServer.service.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "common.names.fullname" . }}-didweb
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
app.kubernetes.io/component: did-web-server
{{- if .Values.didWebServer.service.labels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.didWebServer.service.labels "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if or .Values.didWebServer.service.annotations .Values.commonAnnotations }}
annotations:
{{- if .Values.didWebServer.service.annotations }}
{{- include "common.tplvalues.render" ( dict "value" .Values.didWebServer.service.annotations "context" $) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
{{- end }}
spec:
type: {{ .Values.didWebServer.service.type }}
selector: {{- include "common.labels.matchLabels" . | nindent 4 }}
app.kubernetes.io/component: veritable-cloudagent
ports:
- name: http
port: {{ .Values.didWebServer.service.port }}
targetPort: {{ .Values.didWebServer.service.targetPort }}
protocol: TCP
{{- end }}
58 changes: 57 additions & 1 deletion charts/veritable-cloudagent/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ spec:
{{- if .Values.terminationGracePeriodSeconds }}
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
{{- end }}
{{- if or .Values.initContainers .Values.ipfs.initConfig (and (not .Values.postgresql.enabled) .Values.externalDatabase.create) }}
{{- if or .Values.initContainers .Values.ipfs.initConfig .Values.initDbMigrate.enabled (and (not .Values.postgresql.enabled) .Values.externalDatabase.create) }}
initContainers:
{{- if and (not .Values.postgresql.enabled) .Values.externalDatabase.create }}
- name: database-create
Expand Down Expand Up @@ -154,6 +154,31 @@ spec:
value: {{ .Values.ipfs.initConfig.bootNodeAddress }}
{{- end}}
{{- end }}
{{- if .Values.initDbMigrate.enabled }}
- name: database-migrate
image: {{ template "veritable-cloudagent.image" . }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ['npx','knex']
{{- if .Values.initDbMigrate.args }}
args: {{- include "common.tplvalues.render" (dict "value" .Values.initDbMigrate.args "context" $) | nindent 12 }}
{{- end }}
env:
- name: NODE_ENV
value: {{ .Values.initDbMigrate.environment | quote }}
- name: POSTGRES_HOST
value: {{ template "veritable-cloudagent.databaseHost" . }}
- name: POSTGRES_PORT
value: {{ template "veritable-cloudagent.databasePort" . }}
- name: POSTGRES_USERNAME
value: {{ template "veritable-cloudagent.databaseUser" . }}
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "veritable-cloudagent.databaseSecretName" . }}
key: {{ include "veritable-cloudagent.databaseSecretPasswordKey" . }}
- name: DID_WEB_DB_NAME
value: {{ .Values.didWebServer.env.didWebDbName | default "did-web-server" | quote }}
{{- end }}
{{- if .Values.initContainers }}
{{- include "common.tplvalues.render" (dict "value" .Values.initContainers "context" $) | nindent 8 }}
{{- end }}
Expand Down Expand Up @@ -256,6 +281,33 @@ spec:
- name: VERIFIED_DRPC_OPTIONS_PROOF_REQUEST_OPTIONS
value: {{ .Values.verifiedDrpcOptionsProofRequestOptions | quote }}
{{- end }}
{{- if .Values.didWebServer.enabled }}
# TODO: Race condition exists where DID document generation occurs before didWebServer
# is fully started and pod/ingress are ready. The application may exit when it cannot
# lookup the DID document at the specified DID_WEB_DOMAIN address during startup.
- name: DID_WEB_ENABLED
value: "true"
- name: DID_WEB_PORT
value: {{ .Values.didWebServer.containerPort | quote }}
- name: DID_WEB_DB_NAME
value: {{ .Values.didWebServer.env.didWebDbName | quote }}
- name: DID_WEB_DOMAIN
value: {{ .Values.didWebServer.env.didWebDomain | quote }}
- name: DID_WEB_SERVICE_ENDPOINT
value: {{ (default (include "veritable-cloudagent.defineEndpoint" .) .Values.didWebServer.env.didWebServiceEndpoint) | quote }}
- name: DID_WEB_USE_DEV_CERT
value: {{ ternary "true" "false" .Values.didWebServer.env.useDevCert | quote }}
- name: DID_WEB_DEV_CERT_PATH
value: {{ .Values.didWebServer.env.devCertPath | quote }}
- name: DID_WEB_DEV_KEY_PATH
value: {{ .Values.didWebServer.env.devKeyPath | quote }}
{{- if .Values.didWebServer.extraEnv }}
{{- range $k, $v := .Values.didWebServer.extraEnv }}
- name: {{ $k }}
value: {{ $v | quote }}
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.extraEnvVars }}
{{- include "common.tplvalues.render" (dict "value" .Values.extraEnvVars "context" $) | nindent 12 }}
{{- end }}
Expand All @@ -278,6 +330,10 @@ spec:
containerPort: {{ .Values.containerPorts.ws }}
- name: admin
containerPort: {{ .Values.containerPorts.admin }}
{{- if .Values.didWebServer.enabled }}
- name: http-didweb
containerPort: {{ .Values.didWebServer.containerPort }}
{{- end }}
{{- if not .Values.diagnosticMode.enabled }}
{{- if .Values.customLivenessProbe }}
livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customLivenessProbe "context" $) | nindent 12 }}
Expand Down
Loading