Skip to content

Commit

Permalink
fix(chart): use boolean values instead of string literals for booleans (
Browse files Browse the repository at this point in the history
#744)

Signed-off-by: Lenin Mehedy <[email protected]>
  • Loading branch information
leninmehedy authored Feb 8, 2024
1 parent b2872a1 commit d6567a9
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ exporters:
const_labels:
source: p-{{ default "otel-collector" .otelDefaults.nameOverride }} # PromQL: {source="p-otel-collector"}

{{- if eq .otelDefaults.exporters.prometheusRemoteWrite.enabled "true" }}
{{- if .otelDefaults.exporters.prometheusRemoteWrite.enabled }}
prometheusremotewrite:
endpoint: "{{ .otelDefaults.exporters.prometheusRemoteWrite.endpoint }}"
tls:
Expand Down Expand Up @@ -55,6 +55,6 @@ service:
processors: [batch]
exporters:
- prometheus
{{- if eq .otelDefaults.exporters.prometheusRemoteWrite.enabled "true" }}
{{- if .otelDefaults.exporters.prometheusRemoteWrite.enabled }}
- prometheusremotewrite
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if or $.Values.cloud.selfSignedClusterIssuer.enabled (index $.Values "hedera-explorer" "certClusterIssuerType" | ne "self-signed" ) }}
{{- if index $.Values "hedera-explorer" "enabled" | eq true }}
{{- if index $.Values "hedera-explorer" "enabled" }}
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ spec:
volumes:
- name: hgcapp-storage # change me
emptyDir: {}
{{- if default $defaults.sidecars.otelCollector.enabled $otelCollector.enabled | eq "true" }}
{{- if $otelCollector.enabled }}
- name: otel-collector-volume
configMap:
name: otel-collector-cm
Expand Down Expand Up @@ -90,6 +90,7 @@ spec:
mountPath: /opt/hgcapp/
env:
{{- include "fullstack.defaultEnvVars" . | nindent 10 }}
{{- if $balanceUploader.enabled }}
# Sidecar: {{ $node.name }}-account-balance-uploader
- name: {{ default "account-balance-uploader" $balanceUploader.nameOverride }}
image: {{ include "fullstack.container.image" (dict "image" $balanceUploader.image "Chart" $.Chart "defaults" $defaults.sidecars.accountBalanceUploader ) }}
Expand Down Expand Up @@ -125,9 +126,9 @@ spec:
- name: STREAM_SIG_EXTENSION
value: "pb_sig"
- name: STREAM_EXTENSION
value: {{ default $defaults.sidecars.accountBalanceUploader.config.compression ($balanceUploader.config).compression | eq "true" | ternary "pb.gz" "pb" | quote }}
value: {{ default $defaults.sidecars.accountBalanceUploader.config.compression ($balanceUploader.config).compression | ternary "pb.gz" "pb" | quote }}
- name: SIG_EXTENSION
value: {{ default $defaults.sidecars.accountBalanceUploader.config.compression ($balanceUploader.config).compression | eq "true" | ternary "pb_sig.gz" "pb_sig" | quote }}
value: {{ default $defaults.sidecars.accountBalanceUploader.config.compression ($balanceUploader.config).compression | ternary "pb_sig.gz" "pb_sig" | quote }}
- name: SIG_REQUIRE
value: {{ default $defaults.sidecars.accountBalanceUploader.config.signature.require (($balanceUploader.config).signature).require | quote }}
- name: SIG_PRIORITIZE
Expand All @@ -147,6 +148,8 @@ spec:
resources:
{{- toYaml . | nindent 10 }}
{{- end }}
{{- end }}
{{- if $recordStream.enabled }}
# Sidecar: {{ $node.name }}-record-stream-uploader
- name: {{ default "record-stream-uploader" $recordStream.nameOverride }}
image: {{ include "fullstack.container.image" (dict "image" $recordStream.image "Chart" $.Chart "defaults" $defaults.sidecars.recordStreamUploader) }}
Expand Down Expand Up @@ -184,7 +187,7 @@ spec:
- name: STREAM_SIG_EXTENSION
value: "rcd_sig"
- name: STREAM_EXTENSION
value: {{ default $defaults.sidecars.recordStreamUploader.config.compression ($recordStream.config).compression | eq "true" | ternary "rcd.gz" "rcd" | quote }}
value: {{ default $defaults.sidecars.recordStreamUploader.config.compression ($recordStream.config).compression | ternary "rcd.gz" "rcd" | quote }}
- name: SIG_EXTENSION
value: "rcd_sig"
- name: RECORD_STREAM_COMPRESSION
Expand All @@ -206,10 +209,12 @@ spec:
envFrom:
- secretRef:
name: uploader-mirror-secrets
{{- with default $defaults.sidecars.recordStreamUploader.resources $recordStream.resources }}
{{- with default $defaults.sidecars.recordStreamUploader.resources $recordStream.resources }}
resources:
{{- toYaml . | nindent 10 }}
{{- toYaml . | nindent 10 }}
{{- end }}
{{- end }}
{{- if $eventStream.enabled }}
# Sidecar: {{ $node.name }}-event-stream-uploader
- name: {{ default "event-stream-uploader" $eventStream.nameOverride }}
image: {{ include "fullstack.container.image" (dict "image" $eventStream.image "Chart" $.Chart "defaults" $defaults.sidecars.eventStreamUploader) }}
Expand Down Expand Up @@ -246,9 +251,9 @@ spec:
- name: STREAM_SIG_EXTENSION
value: "evts_sig"
- name: STREAM_EXTENSION
value: {{ default $defaults.sidecars.eventStreamUploader.config.compression ($eventStream.config).compression | eq "true" | ternary "evts.gz" "evts" | quote }}
value: {{ default $defaults.sidecars.eventStreamUploader.config.compression ($eventStream.config).compression | ternary "evts.gz" "evts" | quote }}
- name: SIG_EXTENSION
value: {{ default $defaults.sidecars.eventStreamUploader.config.compression ($eventStream.config).compression | eq "true" | ternary "evts_sig.gz" "evts_sig" | quote }}
value: {{ default $defaults.sidecars.eventStreamUploader.config.compression ($eventStream.config).compression | ternary "evts_sig.gz" "evts_sig" | quote }}
- name: SIG_REQUIRE
value: {{ default $defaults.sidecars.eventStreamUploader.config.signature.require (($eventStream.config).signature).require | quote }}
- name: SIG_PRIORITIZE
Expand All @@ -268,6 +273,8 @@ spec:
resources:
{{- toYaml . | nindent 10 }}
{{- end }}
{{- end }}
{{- if $backupUploader.enabled }}
# Sidecar: {{ $node.name }}-backup-uploader
- name: {{ default "backup-uploader" $backupUploader.nameOverride }}
image: {{ include "fullstack.container.image" (dict "image" $backupUploader.image "Chart" $.Chart "defaults" $defaults.sidecars.backupUploader) }}
Expand All @@ -288,7 +295,8 @@ spec:
resources:
{{- toYaml . | nindent 10 }}
{{- end }}
{{- if (default $defaults.sidecars.otelCollector.enabled $otelCollector.enabled | eq "true") }}
{{- end }}
{{- if $otelCollector.enabled }}
# Sidecar: {{ $node.name }}-otel-collector
- name: {{ default "otel-collector" $otelCollector.nameOverride }}
image: {{ include "fullstack.container.image" (dict "image" $otelCollector.image "Chart" $.Chart "defaults" $defaults.sidecars.otelCollector) }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{ range $index, $node := ($.Values.hedera.nodes) }}
{{- $envoyProxy := $node.envoyProxy | default dict -}}
{{- $envoyProxy := $node.envoyProxy | default $.Values.defaults.envoyProxy -}}
{{- $defaults := $.Values.defaults.envoyProxy }}
{{- if default $defaults.enabled $envoyProxy.enabled | eq "true" }}
{{- if $envoyProxy.enabled }}
---
apiVersion: apps/v1
kind: Deployment
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{ range $index, $node := ($.Values.hedera.nodes) }}
{{- $haproxy := $node.haproxy | default dict -}}
{{- $haproxy := $node.haproxy | default $.Values.defaults.haproxy -}}
{{- $defaults := $.Values.defaults.haproxy }}
{{- if default $defaults.enabled $haproxy.enabled | eq "true" }}
{{- if $haproxy.enabled }}
---
apiVersion: apps/v1
kind: Deployment
Expand Down
4 changes: 2 additions & 2 deletions charts/fullstack-deployment/templates/rbac/pod-monitor.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if $.Values.tester.deployPodMonitor | eq "true" }}
{{- if $.Values.tester.deployPodMonitor }}
apiVersion: v1
kind: ServiceAccount
metadata:
Expand All @@ -18,4 +18,4 @@ roleRef:
kind: ClusterRole
name: {{ $.Values.tester.clusterRoleName }}
apiGroup: rbac.authorization.k8s.io
{{- end }}
{{- end }}
6 changes: 3 additions & 3 deletions charts/fullstack-deployment/templates/services/envoy-svc.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{ range $index, $node := ($.Values.hedera.nodes) }}
{{- $envoyProxy := $node.envoyProxy | default dict -}}
{{- $envoyProxy := $node.envoyProxy | default $.Values.defaults.envoyProxy -}}
{{- $defaults := $.Values.defaults.envoyProxy }}
{{- if default $defaults.enabled $envoyProxy.enabled | eq "true" }}
{{- if $envoyProxy.enabled }}
---
apiVersion: v1
kind: Service
Expand All @@ -14,7 +14,7 @@ metadata:
fullstack.hedera.com/prometheus-endpoint: active
{{- include "fullstack.testLabels" $ | nindent 4 }}
spec:
{{- if default $defaults.loadBalancerEnabled $envoyProxy.loadBalancerEnabled | eq "true" }}
{{- if $envoyProxy.loadBalancerEnabled }}
type: LoadBalancer
{{- end }}
selector:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{- range $index, $node := ($.Values.hedera.nodes) }}
{{- $haproxy := $node.haproxy | default dict -}}
{{- $haproxy := $node.haproxy | default $.Values.defaults.haproxy -}}
{{- $defaults := $.Values.defaults.haproxy }}
{{- if default $defaults.enabled $haproxy.enabled | eq "true" }}
{{- if $haproxy.enabled }}
---
apiVersion: v1
kind: Service
Expand Down
56 changes: 27 additions & 29 deletions charts/fullstack-deployment/values.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# WARNING: Use double quotes for all values. This is because we need to be careful about booleans.

global:
namespaceOverride: ""
ingressClassName: "hedera-explorer-ingress-class" # override for multiple deployments within the same cluster and make unique per cluster
Expand All @@ -22,14 +20,14 @@ cloud:
telemetry:
prometheus:
svcMonitor:
enabled: "true"
enabled: true

# reduce default termination grace period
terminationGracePeriodSeconds: 10

# helm test container
tester:
deployPodMonitor: "true"
deployPodMonitor: true
clusterRoleName: "pod-monitor-role" # this is a shared cluster role for all namespaces
image:
registry: "ghcr.io"
Expand Down Expand Up @@ -69,7 +67,7 @@ defaults:
pullPolicy: "IfNotPresent"
resources: {}
haproxy:
enabled: "true"
enabled: true
nameOverride: "haproxy"
image:
registry: "docker.io"
Expand All @@ -79,79 +77,79 @@ defaults:
resources: {}
serviceType: "LoadBalancer"
envoyProxy:
enabled: "true"
enabled: true
nameOverride: "envoy-proxy"
image:
registry: "docker.io"
repository: "envoyproxy/envoy"
tag: "v1.21.1"
pullPolicy: "IfNotPresent"
resources: {}
loadBalancerEnabled: "false"
loadBalancerEnabled: false
sidecars:
recordStreamUploader:
enabled: "true"
enabled: true
nameOverride: "record-stream-uploader"
image:
registry: "gcr.io"
repository: "hedera-registry/uploader-mirror"
tag: "1.3.0"
pullPolicy: "IfNotPresent"
config:
debug: "true"
compression: "true"
sidecar: "true"
debug: true
compression: true
sidecar: true
reaper:
enabled: "true"
enabled: true
minKeep: 1
interval: 1
defaultBackoff: 1
signature:
require: "true"
prioritize: "true"
require: true
prioritize: true
resources: {}
eventStreamUploader:
enabled: "true"
enabled: true
nameOverride: "event-stream-uploader"
image:
registry: "gcr.io"
repository: "hedera-registry/uploader-mirror"
tag: "1.3.0"
pullPolicy: "IfNotPresent"
config:
debug: "true"
compression: "true"
debug: true
compression: true
reaper:
enabled: "true"
enabled: true
minKeep: 1
interval: 1
defaultBackoff: 1
signature:
require: "true"
prioritize: "true"
require: true
prioritize: true
resources: {}
accountBalanceUploader:
enabled: "true"
enabled: true
nameOverride: "account-balance-uploader"
image:
registry: gcr.io
repository: hedera-registry/uploader-mirror
tag: "1.3.0" # Defaults to the chart's app version if empty
pullPolicy: "IfNotPresent"
config:
debug: "true"
compression: "true"
debug: true
compression: true
reaper:
enabled: "true"
enabled: true
minKeep: 1
interval: 1
defaultBackoff: 1
signature:
require: "true"
prioritize: "true"
require: true
prioritize: true
resources: {}
backupUploader:
enabled: "true"
enabled: true
nameOverride: "backup-uploader"
image:
registry: "gcr.io"
Expand All @@ -162,7 +160,7 @@ defaults:
backupBucket: "backup"
resources: {}
otelCollector:
enabled: "true"
enabled: true
nameOverride: ""
image:
registry: "docker.io"
Expand All @@ -183,7 +181,7 @@ defaults:
tls:
insecure: true
prometheusRemoteWrite:
enabled: "false"
enabled: false
endpoint: "" # e.g. http://prometheus.<NAMESPACE>.svc:9090/api/v1/write
tls:
insecure: true
Expand Down

0 comments on commit d6567a9

Please sign in to comment.