Skip to content

Commit

Permalink
[stable/burrow] move burrow's config to values.yaml (helm#13501)
Browse files Browse the repository at this point in the history
* move burrow's config to values.yaml

Signed-off-by: Gregory Hill <[email protected]>

* switch to toJson

Signed-off-by: Gregory Hill <[email protected]>
  • Loading branch information
Greg Hill authored and k8s-ci-robot committed May 8, 2019
1 parent 9dd21e8 commit 05f6dab
Show file tree
Hide file tree
Showing 13 changed files with 152 additions and 166 deletions.
4 changes: 2 additions & 2 deletions stable/burrow/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: burrow
version: 1.1.6
appVersion: 0.25.0
version: 1.2.0
appVersion: 0.25.1
description: Burrow is a permissionable smart contract machine
home: https://github.com/hyperledger/burrow
icon: https://raw.githubusercontent.com/hyperledger/burrow/develop/docs/assets/images/burrow.png
Expand Down
64 changes: 28 additions & 36 deletions stable/burrow/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,42 +51,50 @@ The following table lists the configurable parameters of the Burrow chart and it

| Parameter | Description | Default |
| --------- | ----------- | ------- |
| `image.repository` | image repository | `"hyperledger/burrow"` |
| `image.tag` | image tag | `"0.25.0"` |
| `image.pullPolicy` | image pull policy | `"IfNotPresent"` |
| `affinity` | node/pod affinities | `{}` |
| `chain.nodes` | number of nodes for the blockchain network | `1` |
| `chain.logLevel` | log level for the nodes (`debug`, `info`, `warn`) | `"info"` |
| `chain.extraSeeds` | network seeds to dial in addition to the cluster booted by the chart; each entry in the array should be in the form `ip:port` (note: because P2P connects over tcp, the port is absolutely required) | `[]` |
| `chain.restore.enabled` | toggle chain restore mechanism | `false` |
| `chain.restore.dumpURL` | accessible dump file from absolute url | `""` |
| `chain.testing` | toggle pre-generated keys & genesis for ci testing | `false` |
| `config` | the [burrow configuration file](https://github.com/hyperledger/burrow/blob/develop/tests/chain/burrow.toml) | `{}` |
| `contracts.enabled` | toggle post-install contract deployment | `false` |
| `contracts.image` | contract deployer image | `""` |
| `contracts.tag` | contract deployer tag | `""` |
| `contracts.deploy` | command to run in post-install hook | `""` |
| `chain.restore.enabled` | toggle chain restore mechanism | `false` |
| `chain.restore.dumpURL` | accessible dump file from absolute url | `""` |
| `validatorAddresses` | list of validators to deploy | `[]` |
| `env` | environment variables to configure burrow | `{}` |
| `extraArgs` | extra arguments to give to the build in `burrow start` command | `{}` |
| `image.repository` | image repository | `"hyperledger/burrow"` |
| `image.tag` | image tag | `"0.25.1"` |
| `image.pullPolicy` | image pull policy | `"IfNotPresent"` |
| `livenessProbe.enabled` | enable liveness checks | `true` |
| `livenessProbe.path` | http endpoint | `"/status?block_seen_time_within=3m"` |
| `livenessProbe.initialDelaySeconds` | start after | `240` |
| `livenessProbe.timeoutSeconds` | retry after | `1` |
| `livenessProbe.periodSeconds` | check every | `30` |
| `nodeSelector` | node labels for pod assignment | `{}` |
| `organization` | name of the organization running these nodes (used in the peer's moniker) | `""` |
| `persistence.enabled` | enable pvc for the chain data | `true` |
| `persistence.size` | size of the chain data pvc | `"80Gi"` |
| `persistence.storageClass` | storage class for the chain data pvc | `"standard"` |
| `persistence.accessMode` | access mode for the chain data pvc | `"ReadWriteOnce"` |
| `persistence.persistentVolumeReclaimPolicy` | does not delete on node restart | `"Retain"` |
| `peer.service.type` | service type | `"ClusterIP"` |
| `peer.service.port` | peer port | `26656` |
| `peer.ingress.enabled` | expose port | `false` |
| `peer.ingress.hosts` | - | `[]` |
| `rpcGRPC.enabled` | enable grpc service | `true` |
| `rpcGRPC.service.port` | grpc port | `10997` |
| `podAnnotations` | annotations to add to each pod | `{}` |
| `podLabels` | labels to add to each pod | `{}` |
| `readinessProbe.enabled` | enable readiness checks | `true` |
| `readinessProbe.path` | http endpoint | `"/status"` |
| `readinessProbe.initialDelaySeconds` | start after | `5` |
| `resources.limits.cpu` | - | `"500m"` |
| `resources.limits.memory` | - | `"1Gi"` |
| `resources.requests.cpu` | - | `"100m"` |
| `resources.requests.memory` | - | `"256Mi"` |
| `rpcGRPC.service.type` | service type | `"ClusterIP"` |
| `rpcGRPC.service.loadBalance` | enable load balancing across nodes | `true` |
| `rpcGRPC.ingress.enabled` | expose port | `false` |
| `rpcGRPC.ingress.hosts` | - | `[]` |
| `rpcGRPC.ingress.annotations` | extra annotations | `` |
| `rpcGRPC.ingress.tls` | - | `` |
| `rpcInfo.enabled` | enable Info service | `true` |
| `rpcInfo.service.port` | Info port | `26658` |
| `rpcInfo.service.type` | service type | `"ClusterIP"` |
| `rpcInfo.service.loadBalance` | enable load balancing across nodes | `true` |
| `rpcInfo.ingress.enabled` | expose port | `false` |
Expand All @@ -95,29 +103,13 @@ The following table lists the configurable parameters of the Burrow chart and it
| `rpcInfo.ingress.annotations` | extra annotations | `` |
| `rpcInfo.ingress.hosts` | - | `[]` |
| `rpcInfo.ingress.tls` | - | `` |
| `rpcMetrics.enabled` | enable Info service | `true` |
| `rpcMetrics.port` | Info port | `9102` |
| `rpcMetrics.path` | http endpoint | `"/metrics"` |
| `rpcMetrics.blockSampleSize` | number of previous blocks to utilize in calculating the histograms and summaries which are sent to prometheus | `100` |
| `rpcProfiler.enabled` | enable Info service | `false` |
| `rpcProfiler.port` | Info port | `6060` |
| `resources.limits.cpu` | - | `"500m"` |
| `resources.limits.memory` | - | `"1Gi"` |
| `resources.requests.cpu` | - | `"100m"` |
| `resources.requests.memory` | - | `"256Mi"` |
| `livenessProbe.enabled` | enable liveness checks | `true` |
| `livenessProbe.path` | http endpoint | `"/status?block_seen_time_within=3m"` |
| `livenessProbe.initialDelaySeconds` | start after | `240` |
| `livenessProbe.timeoutSeconds` | retry after | `1` |
| `livenessProbe.periodSeconds` | check every | `30` |
| `readinessProbe.enabled` | enable readiness checks | `true` |
| `readinessProbe.path` | http endpoint | `"/status"` |
| `readinessProbe.initialDelaySeconds` | start after | `5` |
| `podAnnotations` | annotations to add to each pod | `{}` |
| `podLabels` | labels to add to each pod | `{}` |
| `affinity` | node/pod affinities | `{}` |
| `rpcPeer.service.type` | service type | `"ClusterIP"` |
| `rpcPeer.service.port` | peer port | `26656` |
| `rpcPeer.ingress.enabled` | expose port | `false` |
| `rpcPeer.ingress.hosts` | - | `[]` |
| `tolerations` | list of node taints to tolerate | `[]` |
| `nodeSelector` | node labels for pod assignment | `{}` |
| `validatorAddresses` | list of validators to deploy | `[]` |


Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,

Expand Down
2 changes: 1 addition & 1 deletion stable/burrow/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ You have successfully provisioned {{ .Values.chain.nodes }} Burrow nodes!

** Please be patient while the chart is being deployed. **

{{- if .Values.peer.ingress.enabled }}
{{- if .Values.RPC.Peer.ingress.enabled }}

As ingress is enabled, it may take some time to propagate DNS entries.

Expand Down
12 changes: 6 additions & 6 deletions stable/burrow/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -35,28 +35,28 @@ Create chart name and version as used by the chart label.
Formulate the how the seeds feed is populated.
*/}}
{{- define "burrow.seeds" -}}
{{- if (and .Values.peer.ingress.enabled (not (eq (len .Values.peer.ingress.hosts) 0))) -}}
{{- $host := index .Values.peer.ingress.hosts 0 -}}
{{- if (and .Values.RPC.Peer.ingress.enabled (not (eq (len .Values.RPC.Peer.ingress.hosts) 0))) -}}
{{- $host := index .Values.RPC.Peer.ingress.hosts 0 -}}
{{- range (until (sub $.Values.chain.nodes 1 | int)) -}}
{{- $addr := (index $.Values.validatorAddresses ( print "Validator_" . )).NodeAddress | lower -}}
{{- $node := printf "%03d" . -}}
tcp://{{ $addr }}@{{ $node }}.{{ $host }}:{{ $.Values.peer.service.port }},
tcp://{{ $addr }}@{{ $node }}.{{ $host }}:{{ $.Values.config.Tendermint.ListenPort }},
{{- end -}}
{{- $addr := (index $.Values.validatorAddresses ( print "Validator_" (sub .Values.chain.nodes 1))).NodeAddress | lower -}}
{{- $node := sub .Values.chain.nodes 1 | printf "%03d" -}}
tcp://{{ $addr }}@{{ $node }}.{{ $host }}:{{ $.Values.peer.service.port }}
tcp://{{ $addr }}@{{ $node }}.{{ $host }}:{{ $.Values.config.Tendermint.ListenPort }}
{{- if not (eq (len .Values.chain.extraSeeds) 0) -}}
{{- range .Values.chain.extraSeeds -}},{{ . }}{{- end -}}
{{- end -}}
{{- else -}}
{{- range (until (sub $.Values.chain.nodes 1 | int)) -}}
{{- $addr := (index $.Values.validatorAddresses ( print "Validator_" . )).NodeAddress | lower -}}
{{- $node := printf "%03d" . -}}
tcp://{{ $addr }}@{{ template "burrow.fullname" $ }}-peer-{{ $node }}:{{ $.Values.peer.service.port }},
tcp://{{ $addr }}@{{ template "burrow.fullname" $ }}-peer-{{ $node }}:{{ $.Values.config.Tendermint.ListenPort }},
{{- end -}}
{{- $addr := (index $.Values.validatorAddresses ( print "Validator_" (sub .Values.chain.nodes 1))).NodeAddress | lower -}}
{{- $node := sub .Values.chain.nodes 1 | printf "%03d" -}}
tcp://{{ $addr }}@{{ template "burrow.fullname" $ }}-peer-{{ $node }}:{{ $.Values.peer.service.port }}
tcp://{{ $addr }}@{{ template "burrow.fullname" $ }}-peer-{{ $node }}:{{ $.Values.config.Tendermint.ListenPort }}
{{- if not (eq (len .Values.chain.extraSeeds) 0) -}}
{{- range .Values.chain.extraSeeds -}},{{ . }}{{- end -}}
{{- end -}}
Expand Down
35 changes: 4 additions & 31 deletions stable/burrow/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{{- $config := .Values.config }}
{{- $pp := dict "Tendermint" (dict "PersistentPeers" (include "burrow.seeds" .)) }}
kind: ConfigMap
apiVersion: v1
metadata:
Expand All @@ -8,34 +10,5 @@ metadata:
release: {{ $.Release.Name }}
name: {{ template "burrow.fullname" . }}-config
data:
burrow.toml: |-
BurrowDir = ".burrow"
[Tendermint]
Seeds = ""
SeedMode = false
PersistentPeers = "{{ template "burrow.seeds" . }}"
ListenAddress = "tcp://0.0.0.0:{{ .Values.peer.service.port }}"
ExternalAddress = ""
Moniker = ""
[Execution]
[Keys]
GRPCServiceEnabled = true
AllowBadFilePermissions = true
RemoteAddress = ""
KeysDirectory = "/keys"
[RPC]
[RPC.Info]
Enabled = {{ .Values.rpcInfo.enabled }}
ListenAddress = "tcp://0.0.0.0:{{ .Values.rpcInfo.service.port }}"
[RPC.Profiler]
Enabled = {{ .Values.rpcProfiler.enabled }}
ListenAddress = "tcp://0.0.0.0:{{ .Values.rpcProfiler.port }}"
[RPC.GRPC]
Enabled = {{ .Values.rpcGRPC.enabled }}
ListenAddress = "tcp://0.0.0.0:{{ .Values.rpcGRPC.service.port }}"
[RPC.Metrics]
Enabled = {{ .Values.rpcMetrics.enabled }}
ListenAddress = "tcp://0.0.0.0:{{ .Values.rpcMetrics.port }}"
MetricsPath = {{ .Values.rpcMetrics.path | quote }}
BlockSampleSize = {{ .Values.rpcMetrics.blockSampleSize }}
{{ toToml .Values.config | indent 4 }}
burrow.json: |-
{{ toJson (mergeOverwrite $config $pp) | indent 4 }}
2 changes: 1 addition & 1 deletion stable/burrow/templates/contracts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ spec:
name: ref-dir
env:
- name: CHAIN_URL_GRPC
value: {{ template "burrow.fullname" $ }}-grpc:{{ .Values.rpcGRPC.service.port }}
value: {{ template "burrow.fullname" $ }}-grpc:{{ .Values.config.RPC.GRPC.ListenPort }}
{{- include "settings" . | indent 8 }}
command: ["/bin/sh", "-c", "{{ .Values.contracts.deploy }}"]
restartPolicy: Never
Expand Down
33 changes: 18 additions & 15 deletions stable/burrow/templates/deployments.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ spec:
nodeNumber: {{ $nodeNumber | quote }}
template:
metadata:
{{- if (or $.Values.podAnnotations $.Values.rpcMetrics.enabled) }}
{{- if (or $.Values.podAnnotations $.Values.config.RPC.Metrics.Enabled) }}
annotations:
{{- if $.Values.rpcMetrics.enabled }}
{{- if $.Values.config.RPC.Metrics.Enabled }}
prometheus.io/scrape: "true"
prometheus.io/port: {{ $.Values.rpcMetrics.port | quote }}
prometheus.io/path: {{ $.Values.rpcMetrics.path }}
prometheus.io/port: {{ $.Values.config.RPC.Metrics.ListenPort | quote }}
prometheus.io/path: {{ $.Values.config.RPC.Metrics.path }}
{{- end }}
{{- if $.Values.podAnnotations }}
{{ toYaml $.Values.podAnnotations | indent 8 }}
Expand Down Expand Up @@ -83,9 +83,10 @@ spec:
args:
- restore
- --config
- "{{ $refDir }}/burrow.toml"
- "{{ $refDir }}/burrow.json"
- --genesis
- "{{ $refDir }}/genesis.json"
- --silent
- dumpFile
- --validator-address
- {{ (index $.Values.validatorAddresses ( printf "Validator_%d" $nodeIndex )).Address | quote }}
Expand All @@ -107,16 +108,16 @@ spec:
args:
- start
- --config
- "{{ $refDir }}/burrow.toml"
- "{{ $refDir }}/burrow.json"
- --genesis
- "{{ $refDir }}/genesis.json"
- --validator-address
- {{ (index $.Values.validatorAddresses ( printf "Validator_%d" $nodeIndex )).Address | quote }}
- --validator-moniker
- {{ printf "%s-validator-%s" $.Values.organization $nodeNumber | quote }}
{{- if (and $.Values.peer.ingress.enabled (not (eq (len $.Values.peer.ingress.hosts) 0))) }}
{{- if (and $.Values.RPC.Peer.ingress.enabled (not (eq (len $.Values.RPC.Peer.ingress.hosts) 0))) }}
- --external-address
- "{{ $nodeNumber }}.{{ index $.Values.peer.ingress.hosts 0 }}:{{ $.Values.peer.service.port }}"
- "{{ $nodeNumber }}.{{ index $.Values.RPC.Peer.ingress.hosts 0 }}:{{ $.Values.config.Tendermint.ListenPort }}"
{{- end }}
{{- range $key, $value := $.Values.extraArgs }}
- --{{ $key }}={{ $value }}
Expand All @@ -135,21 +136,21 @@ spec:
ports:
- name: peer
protocol: TCP
containerPort: {{ $.Values.peer.service.port }}
{{- if $.Values.rpcGRPC.enabled }}
containerPort: {{ $.Values.config.Tendermint.ListenPort }}
{{- if $.Values.config.RPC.GRPC.Enabled }}
- name: grpc
protocol: TCP
containerPort: {{ $.Values.rpcGRPC.service.port }}
containerPort: {{ $.Values.config.RPC.GRPC.ListenPort }}
{{- end }}
{{- if $.Values.rpcInfo.enabled }}
{{- if $.Values.config.RPC.Info.Enabled }}
- name: info
protocol: TCP
containerPort: {{ $.Values.rpcInfo.service.port }}
containerPort: {{ $.Values.config.RPC.Info.ListenPort }}
{{- end }}
{{- if $.Values.rpcMetrics.enabled }}
{{- if $.Values.config.RPC.Metrics.Enabled }}
- name: metrics
protocol: TCP
containerPort: {{ $.Values.rpcMetrics.port }}
containerPort: {{ $.Values.config.RPC.Metrics.ListenPort }}
{{- end }}
{{- if not $.Values.chain.testing }}
{{- if $.Values.livenessProbe.enabled }}
Expand Down Expand Up @@ -209,6 +210,8 @@ spec:
nodeSelector:
{{ toYaml $.Values.nodeSelector | indent 8 }}
{{- end }}
{{- if $.Values.tolerations }}
tolerations:
{{ toYaml $.Values.tolerations | indent 8 }}
{{- end }}
{{- end }}
12 changes: 6 additions & 6 deletions stable/burrow/templates/ingress-grpc.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- if .Values.rpcGRPC.ingress.enabled -}}
{{- if .Values.RPC.GRPC.ingress.enabled -}}
{{- $serviceName := printf "%s-grpc" (include "burrow.fullname" .) -}}
{{- $servicePort := .Values.rpcGRPC.service.port -}}
{{- $servicePort := .Values.RPC.GRPC.service.port -}}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
Expand All @@ -11,12 +11,12 @@ metadata:
release: {{ .Release.Name }}
name: {{ template "burrow.fullname" . }}-grpc
annotations:
{{- range $key, $value := .Values.rpcGRPC.ingress.annotations }}
{{- range $key, $value := .Values.RPC.GRPC.ingress.annotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
rules:
{{- range $host := .Values.rpcGRPC.ingress.hosts }}
{{- range $host := .Values.RPC.GRPC.ingress.hosts }}
- host: {{ $host }}
http:
paths:
Expand All @@ -25,8 +25,8 @@ spec:
serviceName: {{ $serviceName }}
servicePort: {{ $servicePort }}
{{- end -}}
{{- if .Values.rpcGRPC.ingress.tls }}
{{- if .Values.RPC.GRPC.ingress.tls }}
tls:
{{ toYaml .Values.rpcGRPC.ingress.tls | indent 4 }}
{{ toYaml .Values.RPC.GRPC.ingress.tls | indent 4 }}
{{- end -}}
{{- end -}}
16 changes: 8 additions & 8 deletions stable/burrow/templates/ingress-info.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{{- if .Values.rpcInfo.ingress.enabled -}}
{{- if .Values.RPC.Info.ingress.enabled -}}
{{- $serviceName := printf "%s-info" (include "burrow.fullname" .) -}}
{{- $servicePort := .Values.rpcInfo.service.port -}}
{{- $pathLeader := .Values.rpcInfo.ingress.pathLeader -}}
{{- $partialIngress := .Values.rpcInfo.ingress.partial -}}
{{- $servicePort := $.Values.config.RPC.Info.ListenPort -}}
{{- $pathLeader := .Values.RPC.Info.ingress.pathLeader -}}
{{- $partialIngress := .Values.RPC.Info.ingress.partial -}}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
Expand All @@ -13,10 +13,10 @@ metadata:
release: {{ .Release.Name }}
name: {{ template "burrow.fullname" . }}-info
annotations:
{{ toYaml .Values.rpcInfo.ingress.annotations | indent 4 }}
{{ toYaml .Values.RPC.Info.ingress.annotations | indent 4 }}
spec:
rules:
{{- range $host := .Values.rpcInfo.ingress.hosts }}
{{- range $host := .Values.RPC.Info.ingress.hosts }}
- host: {{ $host }}
http:
paths:
Expand All @@ -36,8 +36,8 @@ spec:
servicePort: {{ $servicePort }}
{{- end -}}
{{- end -}}
{{- if .Values.rpcInfo.ingress.tls }}
{{- if .Values.RPC.Info.ingress.tls }}
tls:
{{ toYaml .Values.rpcInfo.ingress.tls | indent 4 }}
{{ toYaml .Values.RPC.Info.ingress.tls | indent 4 }}
{{- end -}}
{{- end -}}
10 changes: 5 additions & 5 deletions stable/burrow/templates/service-grpc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ metadata:
heritage: {{ .Release.Service }}
name: {{ template "burrow.fullname" . }}-grpc
spec:
type: {{ .Values.rpcGRPC.service.type }}
{{- if .Values.rpcGRPC.service.loadBalance }}
type: {{ .Values.RPC.GRPC.service.type }}
{{- if .Values.RPC.GRPC.service.loadBalance }}
sessionAffinity: ClientIP
sessionAffinityConfig:
clientIP:
timeoutSeconds: 600
{{- end }}
ports:
- name: grpc
port: {{ .Values.rpcGRPC.service.port }}
port: {{ $.Values.config.RPC.GRPC.ListenPort }}
targetPort: grpc
protocol: TCP
selector:
app: {{ template "burrow.name" . }}
release: {{ .Release.Name }}
{{- if not .Values.rpcGRPC.service.loadBalance }}
nodeNumber: {{ .Values.rpcGRPC.service.node | quote }}
{{- if not .Values.RPC.GRPC.service.loadBalance }}
nodeNumber: {{ .Values.RPC.GRPC.service.node | quote }}
{{- end }}
Loading

0 comments on commit 05f6dab

Please sign in to comment.