Skip to content

Commit acae634

Browse files
* Prune sawtooth references from chronicle chart
* WIP Terraform for vault, vault-config, signoz and chronicle-substrate Signed-off-by: Ryan <ryan.roberts@btp.works>
1 parent 5b395f5 commit acae634

39 files changed

+1065
-602
lines changed

charts/chronicle/Chart.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ dependencies:
44
version: 0.1.3
55
- name: node
66
repository: https://paritytech.github.io/helm-charts/
7-
version: 5.6.1
7+
version: 5.7.1
88
- name: vault
99
repository: https://helm.releases.hashicorp.com
1010
version: 0.27.0
11-
digest: sha256:19c6ade52b5c53daab6fd0a8a2c42a81e5371b99eb9de8a5f102b215930dce40
12-
generated: "2024-03-05T14:03:42.428673+03:00"
11+
digest: sha256:6073af2c490fa86b821ac5188b14cd4f9bd9f2c8e61a778d2acbde9861470a0c
12+
generated: "2024-05-01T20:31:33.345331+01:00"

charts/chronicle/Chart.yaml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,4 @@ dependencies:
2727
- name: standard-defs
2828
version: ~0.1.0
2929
repository: https://btp-charts-stable.s3.amazonaws.com/charts/
30-
- name: node
31-
version: ~5.6.1
32-
repository: https://paritytech.github.io/helm-charts/
33-
- name: vault
34-
version: ~0.27
35-
repository: https://helm.releases.hashicorp.com
30+
-26.6 KB
Binary file not shown.
-1 Bytes
Binary file not shown.

charts/chronicle/templates/_chronicle.tpl

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{{- end -}}
44

55
{{- define "tp.replicas" -}}
6-
{{ include "lib.call-nested" (list . "sawtooth" "sawtooth.replicas") | int }}
6+
{{ include "lib.call-nested" (list . "node" "node.replicas") | int }}
77
{{- end -}}
88

99
{{- define "chronicle.service.name" -}}
@@ -26,16 +26,12 @@ chronicle: {{ include "common.names.fullname" . }}
2626
{{ include "chronicle.labels.appLabels" . }}
2727
{{- end -}}
2828

29-
{{- define "chronicle.sawtooth.sawcomp" -}}
30-
{{ include "lib.call-nested" (list . "sawtooth" "sawtooth.ports.sawcomp") | int }}
29+
{{- define "chronicle.substrate.rpc" -}}
30+
9982
3131
{{- end -}}
3232

33-
{{- define "chronicle.sawtooth.rest" -}}
34-
{{ include "lib.call-nested" (list . "sawtooth" "sawtooth.ports.rest") | int }}
35-
{{- end -}}
36-
37-
{{- define "chronicle.sawtooth.service" -}}
38-
{{- $svc := include "lib.call-nested" (list . "sawtooth" "common.names.fullname") -}}
33+
{{- define "chronicle.substrate.service" -}}
34+
{{- $svc := include "lib.call-nested" (list . "node" "common.names.fullname") -}}
3935
{{- $ns := .Release.Namespace -}}
4036
{{- $domain := "svc.cluster.local" -}}
4137
{{ printf "%s.%s.%s" $svc $ns $domain }}
Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
11
---
2-
{{$stlServiceName := include "lib.call-nested" (list . "sawtooth" "common.names.fullname")}}
2+
{{$stlServiceName := include "lib.call-nested" (list . "node" "common.names.fullname")}}
33
apiVersion: v1
44
kind: ConfigMap
55
metadata:
66
name: {{.Release.Name}}-chronicle-config
77
data:
88
config.toml: |
9-
[secrets]
10-
path = "/var/lib/chronicle/secrets/"
11-
[store]
12-
path = "/var/lib/chronicle/store/"
13-
address = "postgresql://{{ .Values.postgres.user }}@{{ .Values.postgres.host }}:5432/{{ .Values.postgres.database }}"
14-
[validator]
15-
address = "tcp://{{ include "chronicle.sawtooth.service" . }}:{{ include "chronicle.sawtooth.sawcomp" . }}"
169
[namespace_bindings]
1710
default = "fd717fd6-70f1-44c1-81de-287d5e101089"

charts/chronicle/templates/chronicle-init.yaml

Lines changed: 0 additions & 231 deletions
This file was deleted.

charts/chronicle/templates/statefulset.yaml

Lines changed: 2 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{$stlServiceName := include "lib.call-nested" (list . "sawtooth" "common.names.fullname")}}
1+
{{$substrateServiceName := include "lib.call-nested" (list . "node" "common.names.fullname")}}
22
---
33
apiVersion: apps/v1
44
kind: StatefulSet
@@ -19,57 +19,6 @@ spec:
1919
spec:
2020
serviceAccountName: {{ include "lib.serviceAccountName" . }}
2121
affinity: {{ include "lib.safeToYaml" .Values.affinity | nindent 8 }}
22-
initContainers:
23-
- name: chronicle-permissions
24-
image: busybox:1.36
25-
command: [ "sh", "-c"]
26-
args:
27-
- |
28-
chown -R 999:999 /var/lib/chronicle || true
29-
volumeMounts:
30-
- name: chronicle-config
31-
mountPath: /etc/chronicle/config/
32-
- name: chronicle-secrets
33-
mountPath: /var/lib/chronicle/secrets/
34-
readOnly: false
35-
- name: chronicle-keystore
36-
{{- include "lib.image" (dict "imageRoot" .Values.image "global" .Values.global ) | nindent 10 }}
37-
command: [ "bash", "-c"]
38-
args:
39-
- |
40-
/usr/local/bin/chronicle \
41-
-c /etc/chronicle/config/config.toml \
42-
verify-keystore
43-
env: {{ include "lib.safeToYaml" .Values.env | nindent 12 }}
44-
- name: RUST_LOG
45-
value: {{ .Values.logLevel }}
46-
volumeMounts:
47-
- name: chronicle-config
48-
mountPath: /etc/chronicle/config/
49-
- name: chronicle-secrets
50-
mountPath: /var/lib/chronicle/secrets/
51-
readOnly: false
52-
{{- if and .Values.opa.enabled .Values.opa.policy.url }}
53-
- name: wait-for-opa-settings
54-
{{- include "lib.image" (dict "imageRoot" .Values.sawset.image "global" .Values.global ) | nindent 10 }}
55-
command: [ "bash", "-exc"]
56-
args:
57-
- |
58-
keepTrying=true
59-
while [ $keepTrying = "true" ]; do
60-
if sawtooth settings list --url http://$HOST:$PORT | grep -q "chronicle.opa.policy_name"; then
61-
break
62-
else
63-
echo "Waiting for OPA policy id."
64-
sleep 10
65-
fi
66-
done
67-
env:
68-
- name: HOST
69-
value: {{ $stlServiceName }}.{{ .Release.Namespace }}.svc.cluster.local
70-
- name: PORT
71-
value: "{{ include "chronicle.sawtooth.rest" . }}"
72-
{{- end }}
7322
containers:
7423
{{- if .Values.postgres.enabled }}
7524
- name: postgres
@@ -113,7 +62,7 @@ spec:
11362
chronicle \
11463
-c /etc/chronicle/config/config.toml \
11564
--console-logging json \
116-
--sawtooth tcp://{{ include "chronicle.sawtooth.service" . }}:{{ include "chronicle.sawtooth.sawcomp" . }} \
65+
--substrate grpc://{{ include "chronicle.substrate.service" . }}:{{ include "chronicle.substrate.rpc" . }} \
11766
--remote-database \
11867
--database-name {{ .Values.postgres.database }} \
11968
--database-username {{ .Values.postgres.user }} \

0 commit comments

Comments
 (0)