Skip to content

Commit

Permalink
* Prune sawtooth references from chronicle chart
Browse files Browse the repository at this point in the history
* WIP Terraform for vault, vault-config, signoz and chronicle-substrate

Signed-off-by: Ryan <[email protected]>
  • Loading branch information
ryan-s-roberts committed May 6, 2024
1 parent 5b395f5 commit acae634
Show file tree
Hide file tree
Showing 39 changed files with 1,065 additions and 602 deletions.
6 changes: 3 additions & 3 deletions charts/chronicle/Chart.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ dependencies:
version: 0.1.3
- name: node
repository: https://paritytech.github.io/helm-charts/
version: 5.6.1
version: 5.7.1
- name: vault
repository: https://helm.releases.hashicorp.com
version: 0.27.0
digest: sha256:19c6ade52b5c53daab6fd0a8a2c42a81e5371b99eb9de8a5f102b215930dce40
generated: "2024-03-05T14:03:42.428673+03:00"
digest: sha256:6073af2c490fa86b821ac5188b14cd4f9bd9f2c8e61a778d2acbde9861470a0c
generated: "2024-05-01T20:31:33.345331+01:00"
7 changes: 1 addition & 6 deletions charts/chronicle/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,4 @@ dependencies:
- name: standard-defs
version: ~0.1.0
repository: https://btp-charts-stable.s3.amazonaws.com/charts/
- name: node
version: ~5.6.1
repository: https://paritytech.github.io/helm-charts/
- name: vault
version: ~0.27
repository: https://helm.releases.hashicorp.com

Binary file removed charts/chronicle/charts/node-5.6.1.tgz
Binary file not shown.
Binary file modified charts/chronicle/charts/standard-defs-0.1.3.tgz
Binary file not shown.
14 changes: 5 additions & 9 deletions charts/chronicle/templates/_chronicle.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{{- end -}}

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

{{- define "chronicle.service.name" -}}
Expand All @@ -26,16 +26,12 @@ chronicle: {{ include "common.names.fullname" . }}
{{ include "chronicle.labels.appLabels" . }}
{{- end -}}

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

{{- define "chronicle.sawtooth.rest" -}}
{{ include "lib.call-nested" (list . "sawtooth" "sawtooth.ports.rest") | int }}
{{- end -}}

{{- define "chronicle.sawtooth.service" -}}
{{- $svc := include "lib.call-nested" (list . "sawtooth" "common.names.fullname") -}}
{{- define "chronicle.substrate.service" -}}
{{- $svc := include "lib.call-nested" (list . "node" "common.names.fullname") -}}
{{- $ns := .Release.Namespace -}}
{{- $domain := "svc.cluster.local" -}}
{{ printf "%s.%s.%s" $svc $ns $domain }}
Expand Down
9 changes: 1 addition & 8 deletions charts/chronicle/templates/chronicle-config.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
---
{{$stlServiceName := include "lib.call-nested" (list . "sawtooth" "common.names.fullname")}}
{{$stlServiceName := include "lib.call-nested" (list . "node" "common.names.fullname")}}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{.Release.Name}}-chronicle-config
data:
config.toml: |
[secrets]
path = "/var/lib/chronicle/secrets/"
[store]
path = "/var/lib/chronicle/store/"
address = "postgresql://{{ .Values.postgres.user }}@{{ .Values.postgres.host }}:5432/{{ .Values.postgres.database }}"
[validator]
address = "tcp://{{ include "chronicle.sawtooth.service" . }}:{{ include "chronicle.sawtooth.sawcomp" . }}"
[namespace_bindings]
default = "fd717fd6-70f1-44c1-81de-287d5e101089"
231 changes: 0 additions & 231 deletions charts/chronicle/templates/chronicle-init.yaml

This file was deleted.

55 changes: 2 additions & 53 deletions charts/chronicle/templates/statefulset.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{$stlServiceName := include "lib.call-nested" (list . "sawtooth" "common.names.fullname")}}
{{$substrateServiceName := include "lib.call-nested" (list . "node" "common.names.fullname")}}
---
apiVersion: apps/v1
kind: StatefulSet
Expand All @@ -19,57 +19,6 @@ spec:
spec:
serviceAccountName: {{ include "lib.serviceAccountName" . }}
affinity: {{ include "lib.safeToYaml" .Values.affinity | nindent 8 }}
initContainers:
- name: chronicle-permissions
image: busybox:1.36
command: [ "sh", "-c"]
args:
- |
chown -R 999:999 /var/lib/chronicle || true
volumeMounts:
- name: chronicle-config
mountPath: /etc/chronicle/config/
- name: chronicle-secrets
mountPath: /var/lib/chronicle/secrets/
readOnly: false
- name: chronicle-keystore
{{- include "lib.image" (dict "imageRoot" .Values.image "global" .Values.global ) | nindent 10 }}
command: [ "bash", "-c"]
args:
- |
/usr/local/bin/chronicle \
-c /etc/chronicle/config/config.toml \
verify-keystore
env: {{ include "lib.safeToYaml" .Values.env | nindent 12 }}
- name: RUST_LOG
value: {{ .Values.logLevel }}
volumeMounts:
- name: chronicle-config
mountPath: /etc/chronicle/config/
- name: chronicle-secrets
mountPath: /var/lib/chronicle/secrets/
readOnly: false
{{- if and .Values.opa.enabled .Values.opa.policy.url }}
- name: wait-for-opa-settings
{{- include "lib.image" (dict "imageRoot" .Values.sawset.image "global" .Values.global ) | nindent 10 }}
command: [ "bash", "-exc"]
args:
- |
keepTrying=true
while [ $keepTrying = "true" ]; do
if sawtooth settings list --url http://$HOST:$PORT | grep -q "chronicle.opa.policy_name"; then
break
else
echo "Waiting for OPA policy id."
sleep 10
fi
done
env:
- name: HOST
value: {{ $stlServiceName }}.{{ .Release.Namespace }}.svc.cluster.local
- name: PORT
value: "{{ include "chronicle.sawtooth.rest" . }}"
{{- end }}
containers:
{{- if .Values.postgres.enabled }}
- name: postgres
Expand Down Expand Up @@ -113,7 +62,7 @@ spec:
chronicle \
-c /etc/chronicle/config/config.toml \
--console-logging json \
--sawtooth tcp://{{ include "chronicle.sawtooth.service" . }}:{{ include "chronicle.sawtooth.sawcomp" . }} \
--substrate grpc://{{ include "chronicle.substrate.service" . }}:{{ include "chronicle.substrate.rpc" . }} \
--remote-database \
--database-name {{ .Values.postgres.database }} \
--database-username {{ .Values.postgres.user }} \
Expand Down
Loading

0 comments on commit acae634

Please sign in to comment.