Skip to content

Commit 3e0c5c2

Browse files
githubuser-daDA Machine
andauthored
Release Helm charts 0.2.0 (#50)
https://circleci.com/gh/DACH-NY/daml-enterprise-k8s-support/6566 Notable changes: * JWT custom audience (participant) * Move key `bootstrap` into new key `testing` (domain and participant) * New Canton image with non-root user * Run all pods/containers with a `securityContext` Co-authored-by: DA Machine <da-machine@digitalasset.com>
1 parent d921e07 commit 3e0c5c2

31 files changed

+924
-369
lines changed

charts/canton-domain/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
apiVersion: v2
33
name: "canton-domain"
4-
version: 0.1.0
5-
appVersion: 2.6.4
4+
version: 0.2.0
5+
appVersion: 2.6.5
66
kubeVersion: ">= 1.22.0-0"
77
description: "A Helm chart for Canton Domains"
88
home: https://github.com/digital-asset/daml-helm-charts/tree/main/charts/canton-domain

charts/canton-domain/README.md

Lines changed: 179 additions & 143 deletions
Large diffs are not rendered by default.

charts/canton-domain/templates/_helpers.tpl

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,24 @@ Return image for containers.
6565
{{- if .Values.image.registry }}
6666
{{- printf "%s/%s%s%s" .Values.image.registry .Values.image.repository $separator $termination -}}
6767
{{- else -}}
68-
{{- printf "%s%s%s" .Values.image.repository $separator $termination -}}
68+
{{- printf "%s%s%s" .Values.image.repository $separator $termination -}}
69+
{{- end -}}
70+
{{- end -}}
71+
72+
{{/*
73+
Return image for console containers.
74+
*/}}
75+
{{- define "console.image" -}}
76+
{{- $separator := ":" -}}
77+
{{- $termination := .Values.console.image.tag | default .Chart.AppVersion -}}
78+
{{- if .Values.console.image.digest }}
79+
{{- $separator = "@" -}}
80+
{{- $termination = .Values.console.image.digest -}}
81+
{{- end -}}
82+
{{- if .Values.image.registry }}
83+
{{- printf "%s/%s%s%s" .Values.image.registry .Values.console.image.repository $separator $termination -}}
84+
{{- else -}}
85+
{{- printf "%s%s%s" .Values.console.image.repository $separator $termination -}}
6986
{{- end -}}
7087
{{- end -}}
7188

charts/canton-domain/templates/_remotes.tpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Params:
99
- Context - Dict - Required. Current context for the template evaluation.
1010
*/}}
1111
{{ define "remoteParticipants" }}
12-
{{ range $remoteParticipant := .Values.common.remoteParticipants }}
12+
{{ range $remoteParticipant := .Values.testing.bootstrap.remoteParticipants }}
1313
remote-participants {
1414
{{ $remoteParticipant.name }} {
1515
ledger-api {
@@ -36,7 +36,7 @@ Params:
3636
- Context - Dict - Required. Current context for the template evaluation.
3737
*/}}
3838
{{- define "remoteParticipants.volumeMounts" }}
39-
{{- range $remoteParticipant := .Values.common.remoteParticipants }}
39+
{{- range $remoteParticipant := .Values.testing.bootstrap.remoteParticipants }}
4040
{{- if (($remoteParticipant.tls).admin).enabled }}
4141
- name: tls-{{ $remoteParticipant.name }}
4242
mountPath: "/tls-{{ $remoteParticipant.name }}"
@@ -87,7 +87,7 @@ Params:
8787
{{- define "remoteParticipants.volumes" }}
8888
{{- $top := index . 0 }}
8989
{{- $component := index . 1 }}
90-
{{- range $remoteParticipant := $top.Values.common.remoteParticipants }}
90+
{{- range $remoteParticipant := $top.Values.testing.bootstrap.remoteParticipants }}
9191
{{- if and (($remoteParticipant.tls).admin).enabled ((($remoteParticipant.tls).admin).certManager).issuerName }}
9292
# Dummy certificate only used to mount the root CA certificate
9393
{{- include "certManager.csi" (list $top $component (include "remoteParticipant.tls.name" $remoteParticipant.name) $remoteParticipant.tls.admin.certManager "") }}

charts/canton-domain/templates/bootstrap/configmap.yaml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ data:
1414
bootstrap.canton: |
1515
logger.info("Bootstrap start")
1616
17+
val domainManager = domainManagers.remote.head
18+
val mediator = mediators.remote.head
19+
val sequencer = sequencers.remote.head
20+
1721
import com.digitalasset.canton.config.NonNegativeDuration
1822
1923
logger.debug("Setting script commands timeout")
@@ -24,28 +28,28 @@ data:
2428
node.health.wait_for_running()
2529
}
2630
27-
logger.info(s"Bootstrapping domain ${domainManagers.remote.head.name}")
28-
domainManagers.remote.head.setup.bootstrap_domain(sequencers.all, Seq(mediators.remote.head))
31+
logger.info(s"Bootstrapping domain ${domainManager.name}")
32+
domainManager.setup.bootstrap_domain(Seq(sequencer), Seq(mediator))
2933
30-
{{ if .Values.common.remoteParticipants -}}
34+
{{ if .Values.testing.bootstrap.remoteParticipants -}}
3135
logger.info("Bootstrapping participant(s)")
3236
participants.remote.foreach { participant =>
3337
logger.info(s"Waiting for participant ${participant.name} to be initialized")
3438
participant.health.wait_for_initialized()
3539
3640
{{- if .Values.manager.topology.open }}
37-
logger.warn(s"Your domain ${domainManagers.remote.head.name} is open, any participant can join ⚠️")
41+
logger.warn(s"Your domain ${domainManager.name} is open, any participant can join ⚠️")
3842
{{- else }}
39-
if (domainManagers.remote.head.participants.list.forall(_.item.participant != participant.id)) {
40-
logger.info(s"Registering participant ${participant.name} to domain ${domainManagers.remote.head.name}")
41-
domainManagers.remote.head.participants.set_state(participant.id, ParticipantPermission.Submission, TrustLevel.Ordinary)
43+
if (domainManager.participants.list.exists(_.item.participant == participant.id)) {
44+
logger.info(s"Participant ${participant.name} already registered to domain ${domainManager.name}")
4245
} else {
43-
logger.info(s"Participant already registered in domain ${domainManagers.remote.head.name}")
46+
logger.info(s"Registering participant ${participant.name} to domain ${domainManager.name}")
47+
domainManager.participants.set_state(participant.id, ParticipantPermission.Submission, TrustLevel.Ordinary)
4448
}
4549
{{- end }}
4650
47-
logger.info(s"Connecting participant ${participant.name} to domain ${domainManagers.remote.head.name} and sequencer(s) ${sequencers.remote.head.name}")
48-
participant.domains.connect_multi(domainManagers.remote.head.name, Seq(sequencers.remote.head))
51+
logger.info(s"Connecting participant ${participant.name} to domain ${domainManager.name} and sequencer(s) ${sequencer.name}")
52+
participant.domains.connect_multi(domainManager.name, Seq(sequencer))
4953
5054
logger.info(s"Pinging participant ${participant.name} to make sure everything is alright")
5155
participant.health.ping(participant)

charts/canton-domain/templates/bootstrap/job.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,16 @@ spec:
4848
imagePullSecrets: {{- toYaml . | nindent 8 }}
4949
{{- end }}
5050
restartPolicy: Never
51+
{{- if .Values.bootstrap.pod.securityContext.enabled }}
52+
securityContext: {{- omit .Values.bootstrap.pod.securityContext "enabled" | toYaml | nindent 8 }}
53+
{{- end }}
5154
containers:
5255
- name: canton
5356
image: {{ include "common.image" . | quote }}
5457
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
58+
{{- if .Values.bootstrap.securityContext.enabled }}
59+
securityContext: {{- omit .Values.bootstrap.securityContext "enabled" | toYaml | nindent 12 }}
60+
{{- end }}
5561
args:
5662
- "run"
5763
- "--log-profile=container"

charts/canton-domain/templates/console/deployment.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,16 @@ spec:
5252
imagePullSecrets: {{- toYaml . | nindent 8 }}
5353
{{- end }}
5454
terminationGracePeriodSeconds: {{ .Values.console.terminationGracePeriodSeconds }}
55+
{{- if .Values.console.pod.securityContext.enabled }}
56+
securityContext: {{- omit .Values.console.pod.securityContext "enabled" | toYaml | nindent 8 }}
57+
{{- end }}
5558
containers:
56-
- name: canton
57-
image: {{ include "common.image" . | quote }}
59+
- name: console
60+
image: {{ include "console.image" . | quote }}
5861
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
62+
{{- if .Values.console.securityContext.enabled }}
63+
securityContext: {{- omit .Values.console.securityContext "enabled" | toYaml | nindent 12 }}
64+
{{- end }}
5965
command: ["tail", "-f", "/dev/null"]
6066
envFrom:
6167
{{- if .Values.console.environment }}

charts/canton-domain/templates/manager/deployment.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,16 @@ spec:
4545
{{- with .Values.image.pullSecrets }}
4646
imagePullSecrets: {{- toYaml . | nindent 8 }}
4747
{{- end }}
48+
{{- if .Values.common.pod.securityContext.enabled }}
49+
securityContext: {{- omit .Values.common.pod.securityContext "enabled" | toYaml | nindent 8 }}
50+
{{- end }}
4851
containers:
4952
- name: canton
5053
image: {{ include "common.image" . | quote }}
5154
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
55+
{{- if .Values.common.securityContext.enabled }}
56+
securityContext: {{- omit .Values.common.securityContext "enabled" | toYaml | nindent 12 }}
57+
{{- end }}
5258
args:
5359
- "daemon"
5460
- "--log-profile=container"

charts/canton-domain/templates/mediator/deployment.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,16 @@ spec:
4545
{{- with .Values.image.pullSecrets }}
4646
imagePullSecrets: {{- toYaml . | nindent 8 }}
4747
{{- end }}
48+
{{- if .Values.common.pod.securityContext.enabled }}
49+
securityContext: {{- omit .Values.common.pod.securityContext "enabled" | toYaml | nindent 8 }}
50+
{{- end }}
4851
containers:
4952
- name: canton
5053
image: {{ include "common.image" . | quote }}
5154
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
55+
{{- if .Values.common.securityContext.enabled }}
56+
securityContext: {{- omit .Values.common.securityContext "enabled" | toYaml | nindent 12 }}
57+
{{- end }}
5258
args:
5359
- "daemon"
5460
- "--log-profile=container"

charts/canton-domain/templates/sequencer/deployment.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,16 @@ spec:
4646
{{- with .Values.image.pullSecrets }}
4747
imagePullSecrets: {{- toYaml . | nindent 8 }}
4848
{{- end }}
49+
{{- if .Values.common.pod.securityContext.enabled }}
50+
securityContext: {{- omit .Values.common.pod.securityContext "enabled" | toYaml | nindent 8 }}
51+
{{- end }}
4952
containers:
5053
- name: canton
5154
image: {{ include "common.image" . | quote }}
5255
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
56+
{{- if .Values.common.securityContext.enabled }}
57+
securityContext: {{- omit .Values.common.securityContext "enabled" | toYaml | nindent 12 }}
58+
{{- end }}
5359
args:
5460
- "daemon"
5561
- "--log-profile=container"

0 commit comments

Comments
 (0)