From 32cd99b3b452eef4a69e598a8a4ff32af04a7c58 Mon Sep 17 00:00:00 2001 From: Lenin Mehedy Date: Mon, 18 Sep 2023 09:55:17 +1000 Subject: [PATCH 1/7] feat: use parameterized namespace Signed-off-by: Lenin Mehedy --- charts/hedera-network/Chart.lock | 12 +++++++++--- charts/hedera-network/templates/_helpers.tpl | 7 +++++++ .../templates/configmaps/envoy-cm.yaml | 1 + .../templates/configmaps/haproxy-cm.yaml | 1 + .../templates/configmaps/otel-collector-cm.yaml | 1 + .../hedera-network/templates/configmaps/test-cm.yaml | 1 + .../templates/gateway-api/envoy-grpc-web-routes.yaml | 2 +- .../templates/gateway-api/gateway.yaml | 4 ++-- .../templates/gateway-api/haproxy-grpc-routes.yaml | 2 +- .../gateway-api/network-node-grpc-routes.yaml | 2 +- .../templates/network-node-statefulset.yaml | 1 + .../templates/proxy/envoy-deployment.yaml | 1 + .../templates/proxy/haproxy-deployment.yaml | 1 + .../templates/rbac/pod-monitor-role.yaml | 6 +++--- .../templates/rbac/service-accounts.yaml | 2 +- .../templates/secrets/backup-uploder-secrets.yaml | 1 + .../templates/secrets/otel-collector-secrets.yaml | 1 + .../templates/secrets/uploder-mirror-secrets.yaml | 1 + .../hedera-network/templates/services/envoy-svc.yaml | 1 + .../templates/services/haproxy-svc.yaml | 1 + .../templates/services/network-node-svc.yaml | 1 + .../templates/telemetry/prometheus-svc-monitor.yaml | 1 + charts/hedera-network/values.yaml | 8 +++++++- 23 files changed, 46 insertions(+), 13 deletions(-) diff --git a/charts/hedera-network/Chart.lock b/charts/hedera-network/Chart.lock index 9c3170e8b..21ec42f86 100644 --- a/charts/hedera-network/Chart.lock +++ b/charts/hedera-network/Chart.lock @@ -1,6 +1,12 @@ dependencies: +- name: hedera-explorer + repository: "" + version: 0.2.0 +- name: hedera-mirror + repository: https://hashgraph.github.io/hedera-mirror-node/charts + version: 0.86.0 - name: tenant repository: https://operator.min.io/ - version: 5.0.6 -digest: sha256:d1145f65bba0cb295b33e94b0fdc79d80bf06d22cf2606061d0c1462800d3ae7 -generated: "2023-08-09T09:52:59.515466+10:00" + version: 5.0.7 +digest: sha256:cf355b295abceb5814ef57d3e146ec9d4e8db7365a700079d683bd5f766ad374 +generated: "2023-09-16T13:47:19.087992+10:00" diff --git a/charts/hedera-network/templates/_helpers.tpl b/charts/hedera-network/templates/_helpers.tpl index 95494f175..d5fd0714b 100644 --- a/charts/hedera-network/templates/_helpers.tpl +++ b/charts/hedera-network/templates/_helpers.tpl @@ -1,3 +1,10 @@ +{{/* +Namespace +*/}} +{{- define "fullstack.namespace" -}} +{{- default .Release.Namespace .Values.global.namespaceOverride -}} +{{- end -}} + {{- define "fullstack.hedera.security.context" -}} runAsUser: 2000 runAsGroup: 2000 diff --git a/charts/hedera-network/templates/configmaps/envoy-cm.yaml b/charts/hedera-network/templates/configmaps/envoy-cm.yaml index e5609768e..952d30c15 100644 --- a/charts/hedera-network/templates/configmaps/envoy-cm.yaml +++ b/charts/hedera-network/templates/configmaps/envoy-cm.yaml @@ -5,6 +5,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: envoy-proxy-cm-{{ $node.name }} + namespace: {{ include "fullstack.namespace" $ }} data: envoy.yaml: | {{- tpl ($.Files.Get "config-files/envoy.yaml") (dict "nodeConfig" $node "Template" $.Template) | nindent 4 }} diff --git a/charts/hedera-network/templates/configmaps/haproxy-cm.yaml b/charts/hedera-network/templates/configmaps/haproxy-cm.yaml index 220611295..8b4fd914e 100644 --- a/charts/hedera-network/templates/configmaps/haproxy-cm.yaml +++ b/charts/hedera-network/templates/configmaps/haproxy-cm.yaml @@ -5,6 +5,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: haproxy-cm-{{ $node.name }} + namespace: {{ include "fullstack.namespace" $ }} data: haproxy.cfg: | {{- tpl ($.Files.Get "config-files/haproxy.cfg") (dict "nodeConfig" $node "Template" $.Template) | nindent 4 }} diff --git a/charts/hedera-network/templates/configmaps/otel-collector-cm.yaml b/charts/hedera-network/templates/configmaps/otel-collector-cm.yaml index a56e7c42a..823a78c54 100644 --- a/charts/hedera-network/templates/configmaps/otel-collector-cm.yaml +++ b/charts/hedera-network/templates/configmaps/otel-collector-cm.yaml @@ -2,6 +2,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: otel-collector-cm + namespace: {{ include "fullstack.namespace" $ }} data: config.yaml: | {{- tpl (.Files.Get "config-files/otel-collector-config.yaml") ( dict "otelDefaults" $.Values.defaults.sidecars.otelCollector "Template" $.Template ) | nindent 4 }} diff --git a/charts/hedera-network/templates/configmaps/test-cm.yaml b/charts/hedera-network/templates/configmaps/test-cm.yaml index 8a8f26d31..0685da229 100644 --- a/charts/hedera-network/templates/configmaps/test-cm.yaml +++ b/charts/hedera-network/templates/configmaps/test-cm.yaml @@ -2,6 +2,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: test-cm + namespace: {{ include "fullstack.namespace" $ }} data: {{- $total_nodes := len $.Values.hedera.nodes -}} {{- range $path, $_ := .Files.Glob "tests/*.*" }} diff --git a/charts/hedera-network/templates/gateway-api/envoy-grpc-web-routes.yaml b/charts/hedera-network/templates/gateway-api/envoy-grpc-web-routes.yaml index 844ba5c71..ae73ca026 100644 --- a/charts/hedera-network/templates/gateway-api/envoy-grpc-web-routes.yaml +++ b/charts/hedera-network/templates/gateway-api/envoy-grpc-web-routes.yaml @@ -7,7 +7,7 @@ apiVersion: gateway.networking.k8s.io/v1beta1 kind: HTTPRoute metadata: name: envoy-grpc-web-route-{{ $node.name }} - namespace: default + namespace: {{ include "fullstack.namespace" $ }} labels: fullstack.hedera.com/type: http-route spec: diff --git a/charts/hedera-network/templates/gateway-api/gateway.yaml b/charts/hedera-network/templates/gateway-api/gateway.yaml index b8225d4ab..0e739d429 100644 --- a/charts/hedera-network/templates/gateway-api/gateway.yaml +++ b/charts/hedera-network/templates/gateway-api/gateway.yaml @@ -3,7 +3,7 @@ apiVersion: gateway.networking.k8s.io/v1beta1 kind: GatewayClass metadata: name: {{ $.Values.gatewayApi.gatewayClass.name }} - namespace: default + namespace: {{ include "fullstack.namespace" $ }} labels: fullstack.hedera.com/type: gateway-class spec: @@ -15,7 +15,7 @@ apiVersion: gateway.networking.k8s.io/v1beta1 kind: Gateway metadata: name: {{ $.Values.gatewayApi.gateway.name }} - namespace: default + namespace: {{ include "fullstack.namespace" $ }} labels: fullstack.hedera.com/type: gateway spec: diff --git a/charts/hedera-network/templates/gateway-api/haproxy-grpc-routes.yaml b/charts/hedera-network/templates/gateway-api/haproxy-grpc-routes.yaml index 59ec2fc56..186ef5b0c 100644 --- a/charts/hedera-network/templates/gateway-api/haproxy-grpc-routes.yaml +++ b/charts/hedera-network/templates/gateway-api/haproxy-grpc-routes.yaml @@ -7,7 +7,7 @@ apiVersion: gateway.networking.k8s.io/v1alpha2 kind: TCPRoute metadata: name: haproxy-grpc-route-{{ $node.name }} - namespace: default + namespace: {{ include "fullstack.namespace" $ }} labels: fullstack.hedera.com/type: tcp-route fullstack.hedera.com/nodeName: {{ $node.name }} diff --git a/charts/hedera-network/templates/gateway-api/network-node-grpc-routes.yaml b/charts/hedera-network/templates/gateway-api/network-node-grpc-routes.yaml index de55cdc2e..79a82ece8 100644 --- a/charts/hedera-network/templates/gateway-api/network-node-grpc-routes.yaml +++ b/charts/hedera-network/templates/gateway-api/network-node-grpc-routes.yaml @@ -7,7 +7,7 @@ apiVersion: gateway.networking.k8s.io/v1alpha2 kind: TCPRoute metadata: name: node-grpc-route-{{ $node.name }} - namespace: default + namespace: {{ include "fullstack.namespace" $ }} labels: fullstack.hedera.com/type: tcp-route fullstack.hedera.com/nodeName: {{ $node.name }} diff --git a/charts/hedera-network/templates/network-node-statefulset.yaml b/charts/hedera-network/templates/network-node-statefulset.yaml index 2f9491197..df2238957 100644 --- a/charts/hedera-network/templates/network-node-statefulset.yaml +++ b/charts/hedera-network/templates/network-node-statefulset.yaml @@ -14,6 +14,7 @@ apiVersion: apps/v1 kind: StatefulSet metadata: name: network-{{ $node.name }} + namespace: {{ include "fullstack.namespace" $ }} labels: app: network-{{ $node.name }} spec: diff --git a/charts/hedera-network/templates/proxy/envoy-deployment.yaml b/charts/hedera-network/templates/proxy/envoy-deployment.yaml index 707306262..66d6bb324 100644 --- a/charts/hedera-network/templates/proxy/envoy-deployment.yaml +++ b/charts/hedera-network/templates/proxy/envoy-deployment.yaml @@ -7,6 +7,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: envoy-proxy-{{ $node.name }} + namespace: {{ include "fullstack.namespace" $ }} spec: replicas: 1 selector: diff --git a/charts/hedera-network/templates/proxy/haproxy-deployment.yaml b/charts/hedera-network/templates/proxy/haproxy-deployment.yaml index 5361b6cb0..8577f6f4b 100644 --- a/charts/hedera-network/templates/proxy/haproxy-deployment.yaml +++ b/charts/hedera-network/templates/proxy/haproxy-deployment.yaml @@ -7,6 +7,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: haproxy-{{ $node.name }} + namespace: {{ include "fullstack.namespace" $ }} spec: replicas: 1 selector: diff --git a/charts/hedera-network/templates/rbac/pod-monitor-role.yaml b/charts/hedera-network/templates/rbac/pod-monitor-role.yaml index 50a14d627..255d54991 100644 --- a/charts/hedera-network/templates/rbac/pod-monitor-role.yaml +++ b/charts/hedera-network/templates/rbac/pod-monitor-role.yaml @@ -2,7 +2,7 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: pod-monitoring-role - namespace: {{ .Values.namespace }} + namespace: {{ include "fullstack.namespace" $ }} rules: - apiGroups: [ "" ] resources: @@ -31,11 +31,11 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: pod-monitoring-role-binding - namespace: {{ .Values.namespace }} + namespace: {{ include "fullstack.namespace" $ }} subjects: - kind: ServiceAccount name: pod-monitor - namespace: {{ .Values.namespace }} + namespace: {{ include "fullstack.namespace" $ }} roleRef: kind: ClusterRole name: pod-monitoring-role diff --git a/charts/hedera-network/templates/rbac/service-accounts.yaml b/charts/hedera-network/templates/rbac/service-accounts.yaml index 72c028175..084cdb4fa 100644 --- a/charts/hedera-network/templates/rbac/service-accounts.yaml +++ b/charts/hedera-network/templates/rbac/service-accounts.yaml @@ -2,4 +2,4 @@ apiVersion: v1 kind: ServiceAccount metadata: name: pod-monitor - namespace: {{ .Values.namespace }} + namespace: {{ include "fullstack.namespace" $ }} diff --git a/charts/hedera-network/templates/secrets/backup-uploder-secrets.yaml b/charts/hedera-network/templates/secrets/backup-uploder-secrets.yaml index ceaabd821..f9721e59c 100644 --- a/charts/hedera-network/templates/secrets/backup-uploder-secrets.yaml +++ b/charts/hedera-network/templates/secrets/backup-uploder-secrets.yaml @@ -2,6 +2,7 @@ apiVersion: v1 kind: Secret metadata: name: backup-uploader-secrets + namespace: {{ include "fullstack.namespace" $ }} type: Opaque data: S3_ACCESS_KEY: "" diff --git a/charts/hedera-network/templates/secrets/otel-collector-secrets.yaml b/charts/hedera-network/templates/secrets/otel-collector-secrets.yaml index 23f9b4c21..aed2583b7 100644 --- a/charts/hedera-network/templates/secrets/otel-collector-secrets.yaml +++ b/charts/hedera-network/templates/secrets/otel-collector-secrets.yaml @@ -2,6 +2,7 @@ apiVersion: v1 kind: Secret metadata: name: otel-collector-secrets + namespace: {{ include "fullstack.namespace" $ }} type: Opaque data: S3_ACCESS_KEY: "" diff --git a/charts/hedera-network/templates/secrets/uploder-mirror-secrets.yaml b/charts/hedera-network/templates/secrets/uploder-mirror-secrets.yaml index 80c7b6266..8878b5744 100644 --- a/charts/hedera-network/templates/secrets/uploder-mirror-secrets.yaml +++ b/charts/hedera-network/templates/secrets/uploder-mirror-secrets.yaml @@ -7,6 +7,7 @@ apiVersion: v1 kind: Secret metadata: name: minio-secrets + namespace: {{ include "fullstack.namespace" $ }} type: Opaque data: config.env: {{ $minio_config_env | b64enc }} diff --git a/charts/hedera-network/templates/services/envoy-svc.yaml b/charts/hedera-network/templates/services/envoy-svc.yaml index 8533c1a7c..13a38f66b 100644 --- a/charts/hedera-network/templates/services/envoy-svc.yaml +++ b/charts/hedera-network/templates/services/envoy-svc.yaml @@ -7,6 +7,7 @@ apiVersion: v1 kind: Service metadata: name: envoy-proxy-{{ $node.name }}-svc + namespace: {{ include "fullstack.namespace" $ }} labels: fullstack.hedera.com/type: envoy-proxy-svc fullstack.hedera.com/node-name: {{ $node.name }} diff --git a/charts/hedera-network/templates/services/haproxy-svc.yaml b/charts/hedera-network/templates/services/haproxy-svc.yaml index 16e04abd5..4b44cfc5a 100644 --- a/charts/hedera-network/templates/services/haproxy-svc.yaml +++ b/charts/hedera-network/templates/services/haproxy-svc.yaml @@ -7,6 +7,7 @@ apiVersion: v1 kind: Service metadata: name: haproxy-{{ $node.name }}-svc + namespace: {{ include "fullstack.namespace" $ }} labels: fullstack.hedera.com/type: haproxy-svc fullstack.hedera.com/node-name: {{ $node.name }} diff --git a/charts/hedera-network/templates/services/network-node-svc.yaml b/charts/hedera-network/templates/services/network-node-svc.yaml index 8b425ae0b..d14c56351 100644 --- a/charts/hedera-network/templates/services/network-node-svc.yaml +++ b/charts/hedera-network/templates/services/network-node-svc.yaml @@ -4,6 +4,7 @@ apiVersion: v1 kind: Service metadata: name: network-{{ $nodeConfig.name }}-svc + namespace: {{ include "fullstack.namespace" $ }} labels: fullstack.hedera.com/type: network-node-svc fullstack.hedera.com/node-name: {{ $nodeConfig.name }} diff --git a/charts/hedera-network/templates/telemetry/prometheus-svc-monitor.yaml b/charts/hedera-network/templates/telemetry/prometheus-svc-monitor.yaml index ff4ba05e0..4bd355799 100644 --- a/charts/hedera-network/templates/telemetry/prometheus-svc-monitor.yaml +++ b/charts/hedera-network/templates/telemetry/prometheus-svc-monitor.yaml @@ -3,6 +3,7 @@ apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: name: network-node-monitor + namespace: {{ include "fullstack.namespace" $ }} labels: fullstack.hedera.com/type: network-node-svc-monitor spec: diff --git a/charts/hedera-network/values.yaml b/charts/hedera-network/values.yaml index 489ed4913..dbae2680c 100644 --- a/charts/hedera-network/values.yaml +++ b/charts/hedera-network/values.yaml @@ -1,5 +1,8 @@ # WARNING: Use double quotes for all values. This is because we need to be careful about booleans. +global: + namespaceOverride: "" + # cloud configuration cloud: minio: @@ -62,7 +65,6 @@ gatewayApi: route: hostname: "{{ .node.name }}.fst.local" -namespace: default # default settings for a single node # This default configurations can be overridden for each node in the hedera.nodes section. @@ -223,6 +225,8 @@ minio-server: requestAutoCert: false hedera-mirror-node: + global: + namespaceOverride: "{{ tpl (.Values.global.namespaceOverride | toString) }}" # importer is a component of the hedera mirror node # config for subchart hedera-mirror/importer importer: @@ -249,6 +253,8 @@ hedera-mirror-node: # for s3 configuration of mirror node look at uploader-mirror-secrets.yaml hedera-explorer: + global: + namespaceOverride: "{{ tpl (.Values.global.namespaceOverride | toString) }}" # The hedera explorer UI /api url will proxy all request to mirror node # # Without this we would need to expose the mirror node rest API publicly and specify its public url in the network config below From 60d2da3620423f78f59c864e938ea360b6a492fd Mon Sep 17 00:00:00 2001 From: Lenin Mehedy Date: Mon, 18 Sep 2023 14:13:40 +1000 Subject: [PATCH 2/7] fix: update setup scripts to use env variables for CLUSTER_NAME, NAMESPACE and HELM_RELEASE_NAME Signed-off-by: Lenin Mehedy --- charts/hedera-network/values.yaml | 2 +- dev/Makefile | 15 ++--- dev/scripts/docker.sh | 15 ++--- dev/scripts/env.sh | 62 +++++++++++++++++++ dev/scripts/gateway.sh | 7 +-- dev/scripts/main.sh | 58 +++++++++++------ dev/scripts/telemetry.sh | 57 ++++++++++------- dev/scripts/template.env | 4 ++ dev/telemetry/prometheus/prometheus-rbac.yaml | 13 ---- 9 files changed, 156 insertions(+), 77 deletions(-) create mode 100644 dev/scripts/env.sh diff --git a/charts/hedera-network/values.yaml b/charts/hedera-network/values.yaml index dbae2680c..a54169b2a 100644 --- a/charts/hedera-network/values.yaml +++ b/charts/hedera-network/values.yaml @@ -199,7 +199,7 @@ defaults: insecure: true prometheusRemoteWrite: enable: "false" - endpoint: "http://prometheus.default.svc:9090/api/v1/write" + endpoint: "" # e.g. http://prometheus..svc:9090/api/v1/write tls: insecure: true diff --git a/dev/Makefile b/dev/Makefile index 61c51ab24..e6f5a839a 100644 --- a/dev/Makefile +++ b/dev/Makefile @@ -23,7 +23,6 @@ SHELLOPTS:=$(if $(SHELLOPTS),$(SHELLOPTS):)pipefail:errexit ci-test # Setup variables -CLUSTER_NAME ?="fst" SCRIPTS_DIR=$(PWD)/scripts CHART_DIR=$(PWD)/../charts/hedera-network SCRIPT_NAME=direct-install.sh @@ -38,17 +37,15 @@ DOCKER_SCRIPT="docker.sh" .PHONY: setup setup: - rm -f "${TMP_DIR}/"*.* - cp "${SCRIPTS_DIR}/template.env" "${TMP_DIR}/.env" + source "${SCRIPTS_DIR}/main.sh" && setup .PHONY: setup-cluster setup-cluster: - echo "Cluster name: ${CLUSTER_NAME}" && \ - source "${SCRIPTS_DIR}/main.sh" && setup_cluster "${CLUSTER_NAME}" + source "${SCRIPTS_DIR}/main.sh" && setup_cluster .PHONY: destroy-cluster destroy-cluster: - kind delete cluster -n fst + source "${SCRIPTS_DIR}/main.sh" && destroy_cluster .PHONY: install-chart install-chart: @@ -155,12 +152,8 @@ destroy-gateway-api: source "${SCRIPTS_DIR}/${GATEWAY_API_SCRIPT}" && destroy_envoy_gateway_api ######################################### Telemetry ################################# -.PHONY: fetch-prometheus-operator-bundle -fetch-prometheus-operator-bundle: - source "${SCRIPTS_DIR}/${TELEMETRY_SCRIPT}" && fetch-prometheus-operator-bundle - .PHONY: deploy-prometheus-operator -deploy-prometheus-operator: fetch-prometheus-operator-bundle +deploy-prometheus-operator: source "${SCRIPTS_DIR}/${TELEMETRY_SCRIPT}" && deploy-prometheus-operator .PHONY: destroy-prometheus-operator diff --git a/dev/scripts/docker.sh b/dev/scripts/docker.sh index d4db8d3d6..1f69ee151 100644 --- a/dev/scripts/docker.sh +++ b/dev/scripts/docker.sh @@ -1,20 +1,17 @@ #!/usr/bin/env bash -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" -readonly SCRIPT_DIR -readonly DOCKERFILE_DIR="${SCRIPT_DIR}/../../docker" -readonly LOCAL_DOCKER_REGISTRY="docker.fst.local" # same as in dev/ci/ci-values.yaml -readonly LOCAL_DOCKER_IMAGE_TAG="local" +CUR_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" +source "${CUR_DIR}/env.sh" +setup_kubectl_context + readonly KUBECTL_BATS_IMAGE="${LOCAL_DOCKER_REGISTRY}/kubectl-bats:${LOCAL_DOCKER_IMAGE_TAG}" function build_kubectl_bats() { - local cluster_name=$1 - local cluster_name=$1 - [[ -z "${cluster_name}" ]] && echo "ERROR: Cluster name is required" && return 1 + [[ -z "${CLUSTER_NAME}" ]] && echo "ERROR: [build_kubectl_bats] Cluster name is required" && return 1 echo "" echo "Building kubectl-bats image" echo "-----------------------------------------------------------------------------------------------------" cd "${DOCKERFILE_DIR}/kubectl-bats" && docker build -t "${KUBECTL_BATS_IMAGE}" . - kind load docker-image ${KUBECTL_BATS_IMAGE} -n "${cluster_name}" + kind load docker-image "${KUBECTL_BATS_IMAGE}" -n "${CLUSTER_NAME}" } \ No newline at end of file diff --git a/dev/scripts/env.sh b/dev/scripts/env.sh new file mode 100644 index 000000000..44bf31948 --- /dev/null +++ b/dev/scripts/env.sh @@ -0,0 +1,62 @@ +#!/usr/bin/env bash + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" + +readonly SCRIPT_DIR +readonly TMP_DIR="${SCRIPT_DIR}/../temp" +readonly CHART_DIR="${SCRIPT_DIR}/../../charts/hedera-network" + + +# telemetry related env variables +readonly GATEWAY_API_DIR="${SCRIPT_DIR}/../gateway-api" +readonly TELEMETRY_DIR="${SCRIPT_DIR}/../telemetry" +readonly PROMETHEUS_DIR="${TELEMETRY_DIR}/prometheus" +readonly PROMETHEUS_VERSION=v0.67.1 +readonly PROMETHEUS_OPERATOR_YAML="${PROMETHEUS_DIR}/prometheus-operator.yaml" +readonly PROMETHEUS_YAML="${PROMETHEUS_DIR}/prometheus.yaml" +readonly PROMETHEUS_RBAC_YAML="${PROMETHEUS_DIR}/prometheus-rbac.yaml" +readonly PROMETHEUS_EXAMPLE_APP_YAML="${PROMETHEUS_DIR}/example-app.yaml" + +# docker build related env variables +readonly DOCKERFILE_DIR="${SCRIPT_DIR}/../../docker" +readonly LOCAL_DOCKER_REGISTRY="docker.fst.local" # same as in dev/ci/ci-values.yaml +readonly LOCAL_DOCKER_IMAGE_TAG="local" + +function setup_temp_dir() { + if [ ! -f "${TMP_DIR}/.env" ]; then \ + echo "Creating .env file from template.env" + cp "${SCRIPT_DIR}/template.env" "${TMP_DIR}/.env" + echo "File list in ${TMP_DIR}" + ls -la "${TMP_DIR}" + fi +} + +function load_env_file() { + if [ -f "${TMP_DIR}/.env" ]; then \ + set -a + # shellcheck source=./../temp/.env + source "${TMP_DIR}/.env" + set +a + fi +} + +function setup_kubectl_context() { + load_env_file + [[ -z "${CLUSTER_NAME}" ]] && echo "ERROR: Cluster name is required" && return 1 + [[ -z "${NAMESPACE}" ]] && echo "ERROR: Namespace name is required" && return 1 + + echo "List of namespaces:" + kubectl get ns + + echo "Setting kubectl context..." + kubectl config use-context "kind-${CLUSTER_NAME}" + kubectl config set-context --current --namespace="${NAMESPACE}" + kubectl config get-contexts +} + +function setup() { + setup_temp_dir + load_env_file +} + +setup diff --git a/dev/scripts/gateway.sh b/dev/scripts/gateway.sh index 60690cd33..7004dbfb6 100644 --- a/dev/scripts/gateway.sh +++ b/dev/scripts/gateway.sh @@ -1,10 +1,9 @@ #!/usr/bin/env bash -GATEWAY_API_VERSION="${GATEWAY_API_VERSION:-v0.7.1}" +CUR_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" +source "${CUR_DIR}/env.sh" -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" -readonly GATEWAY_API_DIR="${SCRIPT_DIR}/../gateway-api" -readonly SCRIPT_DIR +GATEWAY_API_VERSION="${GATEWAY_API_VERSION:-v0.7.1}" function deploy_haproxy_ingress() { deploy_gateway_api_crd diff --git a/dev/scripts/main.sh b/dev/scripts/main.sh index 6763680c2..3baaa6a8d 100644 --- a/dev/scripts/main.sh +++ b/dev/scripts/main.sh @@ -1,28 +1,38 @@ #!/usr/bin/env bash -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" -readonly SCRIPT_DIR -CHART_DIR="${SCRIPT_DIR}/../../charts/hedera-network" +CUR_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" +source "${CUR_DIR}/env.sh" function setup_cluster() { - local cluster_name=$1 - [[ -z "${cluster_name}" ]] && echo "ERROR: Cluster name is required" && return 1 + [[ -z "${CLUSTER_NAME}" ]] && echo "ERROR: [setup_cluster] Cluster name is required" && return 1 + [[ -z "${NAMESPACE}" ]] && echo "ERROR: [setup_cluster] Namespace name is required" && return 1 - local count=$(kind get clusters -q | grep -c -sw "${cluster_name}") + echo "Cluster name: ${CLUSTER_NAME}" + local count=$(kind get clusters -q | grep -c -sw "${CLUSTER_NAME}") if [[ $count -eq 0 ]]; then - echo "Cluster '${cluster_name}' not found" - kind create cluster -n "${cluster_name}" + echo "Cluster '${CLUSTER_NAME}' not found" + kind create cluster -n "${CLUSTER_NAME}" + kubectl create ns "${NAMESPACE}" else - echo "Cluster '${cluster_name}' found" + echo "Cluster '${CLUSTER_NAME}' found" fi - kubectl config use-context "kind-${cluster_name}" - kubectl config set-context --current --namespace=default - kubectl config get-contexts + setup_kubectl_context +} + +function destroy_cluster() { + [[ -z "${CLUSTER_NAME}" ]] && echo "ERROR: [destroy_cluster] Cluster name is required" && return 1 + [[ -z "${NAMESPACE}" ]] && echo "ERROR: [destroy_cluster] Namespace name is required" && return 1 + + kind delete cluster -n "${CLUSTER_NAME}" || true + kubectl delete ns "${NAMESPACE}" || true } function install_chart() { local node_setup_script=$1 + [[ -z "${node_setup_script}" ]] && echo "ERROR: [install_chart] Node setup script name is required" && return 1 + + setup_kubectl_context echo "" echo "Installing helm chart... " @@ -37,30 +47,42 @@ function install_chart() { } function uninstall_chart() { + [[ -z "${HELM_RELEASE_NAME}" ]] && echo "ERROR: [uninstall_chart] Helm release name is required" && return 1 + echo "" echo "Uninstalling helm chart... " echo "-----------------------------------------------------------------------------------------------------" - helm uninstall fst + helm uninstall "${HELM_RELEASE_NAME}" sleep 10 } function nmt_install() { + [[ -z "${HELM_RELEASE_NAME}" ]] && echo "ERROR: [nmt_install] Helm release name is required" && return 1 + [[ -z "${NAMESPACE}" ]] && echo "ERROR: [nmt_install] Namespace name is required" && return 1 + if [[ -z "${CHART_VALUES_FILES}" ]]; then - helm install fst "${CHART_DIR}" --set defaults.root.image.repository=hashgraph/full-stack-testing/ubi8-init-dind + helm install "${HELM_RELEASE_NAME}" -n "${NAMESPACE}" "${CHART_DIR}" --set defaults.root.image.repository=hashgraph/full-stack-testing/ubi8-init-dind else - helm install fst "${CHART_DIR}" -f "${CHART_DIR}/values.yaml" --values "${CHART_VALUES_FILES}" --set defaults.root.image.repository=hashgraph/full-stack-testing/ubi8-init-dind + helm install "${HELM_RELEASE_NAME}" -n "${NAMESPACE}" "${CHART_DIR}" -f "${CHART_DIR}/values.yaml" --values "${CHART_VALUES_FILES}" --set defaults.root.image.repository=hashgraph/full-stack-testing/ubi8-init-dind fi } function direct_install() { + [[ -z "${HELM_RELEASE_NAME}" ]] && echo "ERROR: [direct_install] Helm release name is required" && return 1 + [[ -z "${NAMESPACE}" ]] && echo "ERROR: [direct_install] Namespace name is required" && return 1 + if [[ -z "${CHART_VALUES_FILES}" ]]; then - helm install fst "${CHART_DIR}" + helm install "${HELM_RELEASE_NAME}" -n "${NAMESPACE}" "${CHART_DIR}" else - helm install fst "${CHART_DIR}" -f "${CHART_DIR}/values.yaml" --values "${CHART_VALUES_FILES}" + helm install "${HELM_RELEASE_NAME}" -n "${NAMESPACE}" "${CHART_DIR}" -f "${CHART_DIR}/values.yaml" --values "${CHART_VALUES_FILES}" fi } function run_helm_chart_tests() { + [[ -z "${HELM_RELEASE_NAME}" ]] && echo "ERROR: [run_helm_chart_tests] Helm release name is required" && return 1 + + setup_kubectl_context + local test_name=$1 # pod name in the tests/test-deployment.yaml file [[ -z "${test_name}" ]] && echo "ERROR: test name is required" && return 1 @@ -68,7 +90,7 @@ function run_helm_chart_tests() { echo "Running helm chart tests (first run takes ~2m)... " echo "-----------------------------------------------------------------------------------------------------" - helm test fst --filter name="${test_name}" + helm test "${HELM_RELEASE_NAME}" --filter name="${test_name}" local test_status=$(kubectl get pod "${test_name}" -o jsonpath='{.status.phase}' | xargs) echo "Helm test status: ${test_status}" diff --git a/dev/scripts/telemetry.sh b/dev/scripts/telemetry.sh index 5e41e1d7c..15a258300 100644 --- a/dev/scripts/telemetry.sh +++ b/dev/scripts/telemetry.sh @@ -1,17 +1,10 @@ #!/usr/bin/env bash - -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" -readonly SCRIPT_DIR -readonly TELEMETRY_DIR="${SCRIPT_DIR}/../telemetry" -readonly PROMETHEUS_DIR="${TELEMETRY_DIR}/prometheus" +CUR_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" +source "${CUR_DIR}/env.sh" +setup_kubectl_context # Run the below command to retrieve the latest version # curl -s "https://api.github.com/repos/prometheus-operator/prometheus-operator/releases/latest" | jq -cr .tag_name -readonly PROMETHEUS_VERSION=v0.67.1 -readonly PROMETHEUS_OPERATOR_YAML="${PROMETHEUS_DIR}/prometheus-operator.yaml" -readonly PROMETHEUS_YAML="${PROMETHEUS_DIR}/prometheus.yaml" -readonly PROMETHEUS_RBAC_YAML="${PROMETHEUS_DIR}/prometheus-rbac.yaml" -readonly PROMETHEUS_EXAMPLE_APP_YAML="${PROMETHEUS_DIR}/example-app.yaml" function fetch-prometheus-operator-bundle() { if [[ ! -f "${PROMETHEUS_OPERATOR_YAML}" ]]; then \ @@ -28,6 +21,8 @@ function fetch-prometheus-operator-bundle() { } function deploy-prometheus-operator() { + fetch-prometheus-operator-bundle + echo "" echo "Deploying prometheus operator" echo "PROMETHEUS_OPERATOR_YAML: ${PROMETHEUS_OPERATOR_YAML}" @@ -59,10 +54,29 @@ function deploy-prometheus() { echo "PROMETHEUS_YAML: ${PROMETHEUS_YAML}" echo "-----------------------------------------------------------------------------------------------------" kubectl create -f "${PROMETHEUS_RBAC_YAML}" + + # create ClusterRole binding with the correct namespace + # NOTE: take care of indentation in the yaml if it needs to be updated + echo " + apiVersion: rbac.authorization.k8s.io/v1 + kind: ClusterRoleBinding + metadata: + name: prometheus + roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: prometheus + subjects: + - kind: ServiceAccount + name: prometheus + namespace: ${NAMESPACE}" | kubectl create -f - + sleep 10 + kubectl create -f "${PROMETHEUS_YAML}" + echo "Waiting for prometheus to be active (timeout 300s)..." - kubectl wait --for=condition=Ready pods -l app.kubernetes.io/name=prometheus -n default --timeout 300s + kubectl wait --for=condition=Ready pods -l app.kubernetes.io/name=prometheus --timeout 300s -n "${NAMESPACE}" } function destroy-prometheus() { @@ -71,8 +85,9 @@ function destroy-prometheus() { echo "PROMETHEUS_RBAC_YAML: ${PROMETHEUS_RBAC_YAML}" echo "PROMETHEUS_YAML: ${PROMETHEUS_YAML}" echo "-----------------------------------------------------------------------------------------------------" - kubectl delete -f "${PROMETHEUS_YAML}" - kubectl delete -f "${PROMETHEUS_RBAC_YAML}" + kubectl delete -f "${PROMETHEUS_YAML}" || true + kubectl delete -f "${PROMETHEUS_RBAC_YAML}" || true + kubectl delete clusterrolebindings prometheus || true sleep 5 } @@ -83,7 +98,7 @@ function deploy-prometheus-example-app() { echo "-----------------------------------------------------------------------------------------------------" kubectl create -f "${PROMETHEUS_EXAMPLE_APP_YAML}" echo "Waiting for prometheus example app to be active (timeout 300s)..." - kubectl wait --for=condition=Ready pods -l app=prometheus-example-app -n default --timeout 300s + kubectl wait --for=condition=Ready pods -l app=prometheus-example-app --timeout 300s } function destroy-prometheus-example-app() { @@ -97,13 +112,13 @@ function destroy-prometheus-example-app() { } function expose_prometheus() { - export POD_NAME=$(kubectl get pods --namespace default -l "app.kubernetes.io/name=prometheus,app.kubernetes.io/instance=prometheus" -o jsonpath="{.items[0].metadata.name}") - kubectl --namespace default port-forward $POD_NAME 9090 & + export POD_NAME=$(kubectl get pods -l "app.kubernetes.io/name=prometheus,app.kubernetes.io/instance=prometheus" -o jsonpath="{.items[0].metadata.name}") + kubectl port-forward "${POD_NAME}" 9090 & echo "Prometheus is exposed from ${POD_NAME} to port 9090" } function unexpose_prometheus() { - export POD_NAME=$(kubectl get pods --namespace default -l "app.kubernetes.io/name=prometheus,app.kubernetes.io/instance=prometheus" -o jsonpath="{.items[0].metadata.name}") + export POD_NAME=$(kubectl get pods -l "app.kubernetes.io/name=prometheus,app.kubernetes.io/instance=prometheus" -o jsonpath="{.items[0].metadata.name}") export PID=$(ps aux | grep "port-forward ${POD_NAME}" | sed -n 2p | awk '{ print $2 }') [[ -z "${PID}" ]] && echo "No Prometheus port-forward PID is found" && return 0 @@ -139,13 +154,13 @@ function destroy_grafana_tempo() { } function expose_grafana() { - export POD_NAME=$(kubectl get pods --namespace default -l "app.kubernetes.io/name=grafana,app.kubernetes.io/instance=grafana" -o jsonpath="{.items[0].metadata.name}") - kubectl --namespace default port-forward $POD_NAME 3000 & + export POD_NAME=$(kubectl get pods -l "app.kubernetes.io/name=grafana,app.kubernetes.io/instance=grafana" -o jsonpath="{.items[0].metadata.name}") + kubectl port-forward $POD_NAME 3000 & echo "Grafana is exposed from ${POD_NAME} to port 3000" } function unexpose_grafana() { - export POD_NAME=$(kubectl get pods --namespace default -l "app.kubernetes.io/name=grafana,app.kubernetes.io/instance=grafana" -o jsonpath="{.items[0].metadata.name}") + export POD_NAME=$(kubectl get pods -l "app.kubernetes.io/name=grafana,app.kubernetes.io/instance=grafana" -o jsonpath="{.items[0].metadata.name}") export PID=$(ps aux | grep "port-forward ${POD_NAME}" | sed -n 2p | awk '{ print $2 }') [[ -z "${PID}" ]] && echo "No Grafana port-forward PID is found" && return 0 @@ -163,7 +178,7 @@ function deploy_tracing_example_app() { echo "-----------------------------------------------------------------------------------------------------" kubectl create -f "${TELEMETRY_DIR}/grafana/example-tracing-app.yaml" echo "Waiting for tracing example app to be active (timeout 300s)..." - kubectl wait --for=condition=Ready pods -l app=xk6-tracing -n default --timeout 300s + kubectl wait --for=condition=Ready pods -l app=xk6-tracing --timeout 300s } function destroy_tracing_example_app() { diff --git a/dev/scripts/template.env b/dev/scripts/template.env index ef8be8b0e..48e863b67 100644 --- a/dev/scripts/template.env +++ b/dev/scripts/template.env @@ -1,3 +1,7 @@ +USER=${USER:-changeme}" +CLUSTER_NAME="fst" +NAMESPACE="fst-${USER}" +HELM_RELEASE_NAME="fst" NMT_VERSION=v2.0.0-alpha.0 PLATFORM_VERSION=v0.39.1 diff --git a/dev/telemetry/prometheus/prometheus-rbac.yaml b/dev/telemetry/prometheus/prometheus-rbac.yaml index 235ee390c..532dd0051 100644 --- a/dev/telemetry/prometheus/prometheus-rbac.yaml +++ b/dev/telemetry/prometheus/prometheus-rbac.yaml @@ -27,16 +27,3 @@ rules: verbs: ["get", "list", "watch"] - nonResourceURLs: ["/metrics"] verbs: ["get"] ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: prometheus -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: prometheus -subjects: - - kind: ServiceAccount - name: prometheus - namespace: default From 3ea236039dde15fa52f24827f2f42ba638da521d Mon Sep 17 00:00:00 2001 From: Lenin Mehedy Date: Mon, 18 Sep 2023 14:43:12 +1000 Subject: [PATCH 3/7] ci: debug ci-test Signed-off-by: Lenin Mehedy --- dev/scripts/env.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dev/scripts/env.sh b/dev/scripts/env.sh index 44bf31948..3d1be7dda 100644 --- a/dev/scripts/env.sh +++ b/dev/scripts/env.sh @@ -29,6 +29,8 @@ function setup_temp_dir() { echo "File list in ${TMP_DIR}" ls -la "${TMP_DIR}" fi + + cat "${TMP_DIR}/.env" } function load_env_file() { From 2b9c3bcb5bb0e4469539447e894f480854764bc9 Mon Sep 17 00:00:00 2001 From: Lenin Mehedy Date: Mon, 18 Sep 2023 14:43:47 +1000 Subject: [PATCH 4/7] fix: add missing quote Signed-off-by: Lenin Mehedy --- dev/scripts/template.env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/scripts/template.env b/dev/scripts/template.env index 48e863b67..b25b0b7f0 100644 --- a/dev/scripts/template.env +++ b/dev/scripts/template.env @@ -1,4 +1,4 @@ -USER=${USER:-changeme}" +USER="${USER:-changeme}" CLUSTER_NAME="fst" NAMESPACE="fst-${USER}" HELM_RELEASE_NAME="fst" From b042f6512eee9747076e2e611f182320df560095 Mon Sep 17 00:00:00 2001 From: Lenin Mehedy Date: Mon, 18 Sep 2023 14:56:20 +1000 Subject: [PATCH 5/7] fix: create namespace if it is not created yet Signed-off-by: Lenin Mehedy --- dev/scripts/env.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dev/scripts/env.sh b/dev/scripts/env.sh index 3d1be7dda..81838d7d4 100644 --- a/dev/scripts/env.sh +++ b/dev/scripts/env.sh @@ -29,8 +29,6 @@ function setup_temp_dir() { echo "File list in ${TMP_DIR}" ls -la "${TMP_DIR}" fi - - cat "${TMP_DIR}/.env" } function load_env_file() { @@ -47,6 +45,11 @@ function setup_kubectl_context() { [[ -z "${CLUSTER_NAME}" ]] && echo "ERROR: Cluster name is required" && return 1 [[ -z "${NAMESPACE}" ]] && echo "ERROR: Namespace name is required" && return 1 + kubectl get ns "${NAMESPACE}" &>/dev/null + if [[ $? -ne 0 ]]; then + kubectl create ns "${NAMESPACE}" + fi + echo "List of namespaces:" kubectl get ns From d8ce3ad3c396485b6ea1453de56e158c306802a0 Mon Sep 17 00:00:00 2001 From: Lenin Mehedy Date: Mon, 18 Sep 2023 15:04:13 +1000 Subject: [PATCH 6/7] fix: incorporate PR review comments Signed-off-by: Lenin Mehedy --- charts/hedera-network/templates/_helpers.tpl | 7 ------- charts/hedera-network/templates/configmaps/envoy-cm.yaml | 2 +- charts/hedera-network/templates/configmaps/haproxy-cm.yaml | 2 +- .../templates/configmaps/otel-collector-cm.yaml | 2 +- charts/hedera-network/templates/configmaps/test-cm.yaml | 2 +- .../templates/gateway-api/envoy-grpc-web-routes.yaml | 2 +- charts/hedera-network/templates/gateway-api/gateway.yaml | 4 ++-- .../templates/gateway-api/haproxy-grpc-routes.yaml | 2 +- .../templates/gateway-api/network-node-grpc-routes.yaml | 2 +- .../hedera-network/templates/network-node-statefulset.yaml | 2 +- .../hedera-network/templates/proxy/envoy-deployment.yaml | 2 +- .../hedera-network/templates/proxy/haproxy-deployment.yaml | 2 +- charts/hedera-network/templates/rbac/pod-monitor-role.yaml | 6 +++--- charts/hedera-network/templates/rbac/service-accounts.yaml | 2 +- .../templates/secrets/backup-uploder-secrets.yaml | 2 +- .../templates/secrets/otel-collector-secrets.yaml | 2 +- .../templates/secrets/uploder-mirror-secrets.yaml | 2 +- charts/hedera-network/templates/services/envoy-svc.yaml | 2 +- charts/hedera-network/templates/services/haproxy-svc.yaml | 2 +- .../templates/services/network-node-svc.yaml | 2 +- .../templates/telemetry/prometheus-svc-monitor.yaml | 2 +- 21 files changed, 23 insertions(+), 30 deletions(-) diff --git a/charts/hedera-network/templates/_helpers.tpl b/charts/hedera-network/templates/_helpers.tpl index d5fd0714b..95494f175 100644 --- a/charts/hedera-network/templates/_helpers.tpl +++ b/charts/hedera-network/templates/_helpers.tpl @@ -1,10 +1,3 @@ -{{/* -Namespace -*/}} -{{- define "fullstack.namespace" -}} -{{- default .Release.Namespace .Values.global.namespaceOverride -}} -{{- end -}} - {{- define "fullstack.hedera.security.context" -}} runAsUser: 2000 runAsGroup: 2000 diff --git a/charts/hedera-network/templates/configmaps/envoy-cm.yaml b/charts/hedera-network/templates/configmaps/envoy-cm.yaml index 952d30c15..c9ccc7cd3 100644 --- a/charts/hedera-network/templates/configmaps/envoy-cm.yaml +++ b/charts/hedera-network/templates/configmaps/envoy-cm.yaml @@ -5,7 +5,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: envoy-proxy-cm-{{ $node.name }} - namespace: {{ include "fullstack.namespace" $ }} + namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }} data: envoy.yaml: | {{- tpl ($.Files.Get "config-files/envoy.yaml") (dict "nodeConfig" $node "Template" $.Template) | nindent 4 }} diff --git a/charts/hedera-network/templates/configmaps/haproxy-cm.yaml b/charts/hedera-network/templates/configmaps/haproxy-cm.yaml index 8b4fd914e..ecd39ebc9 100644 --- a/charts/hedera-network/templates/configmaps/haproxy-cm.yaml +++ b/charts/hedera-network/templates/configmaps/haproxy-cm.yaml @@ -5,7 +5,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: haproxy-cm-{{ $node.name }} - namespace: {{ include "fullstack.namespace" $ }} + namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }} data: haproxy.cfg: | {{- tpl ($.Files.Get "config-files/haproxy.cfg") (dict "nodeConfig" $node "Template" $.Template) | nindent 4 }} diff --git a/charts/hedera-network/templates/configmaps/otel-collector-cm.yaml b/charts/hedera-network/templates/configmaps/otel-collector-cm.yaml index 823a78c54..6a1e634d2 100644 --- a/charts/hedera-network/templates/configmaps/otel-collector-cm.yaml +++ b/charts/hedera-network/templates/configmaps/otel-collector-cm.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: otel-collector-cm - namespace: {{ include "fullstack.namespace" $ }} + namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }} data: config.yaml: | {{- tpl (.Files.Get "config-files/otel-collector-config.yaml") ( dict "otelDefaults" $.Values.defaults.sidecars.otelCollector "Template" $.Template ) | nindent 4 }} diff --git a/charts/hedera-network/templates/configmaps/test-cm.yaml b/charts/hedera-network/templates/configmaps/test-cm.yaml index 0685da229..67e8d9f73 100644 --- a/charts/hedera-network/templates/configmaps/test-cm.yaml +++ b/charts/hedera-network/templates/configmaps/test-cm.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: test-cm - namespace: {{ include "fullstack.namespace" $ }} + namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }} data: {{- $total_nodes := len $.Values.hedera.nodes -}} {{- range $path, $_ := .Files.Glob "tests/*.*" }} diff --git a/charts/hedera-network/templates/gateway-api/envoy-grpc-web-routes.yaml b/charts/hedera-network/templates/gateway-api/envoy-grpc-web-routes.yaml index ae73ca026..750d2eef4 100644 --- a/charts/hedera-network/templates/gateway-api/envoy-grpc-web-routes.yaml +++ b/charts/hedera-network/templates/gateway-api/envoy-grpc-web-routes.yaml @@ -7,7 +7,7 @@ apiVersion: gateway.networking.k8s.io/v1beta1 kind: HTTPRoute metadata: name: envoy-grpc-web-route-{{ $node.name }} - namespace: {{ include "fullstack.namespace" $ }} + namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }} labels: fullstack.hedera.com/type: http-route spec: diff --git a/charts/hedera-network/templates/gateway-api/gateway.yaml b/charts/hedera-network/templates/gateway-api/gateway.yaml index 0e739d429..378b297e2 100644 --- a/charts/hedera-network/templates/gateway-api/gateway.yaml +++ b/charts/hedera-network/templates/gateway-api/gateway.yaml @@ -3,7 +3,7 @@ apiVersion: gateway.networking.k8s.io/v1beta1 kind: GatewayClass metadata: name: {{ $.Values.gatewayApi.gatewayClass.name }} - namespace: {{ include "fullstack.namespace" $ }} + namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }} labels: fullstack.hedera.com/type: gateway-class spec: @@ -15,7 +15,7 @@ apiVersion: gateway.networking.k8s.io/v1beta1 kind: Gateway metadata: name: {{ $.Values.gatewayApi.gateway.name }} - namespace: {{ include "fullstack.namespace" $ }} + namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }} labels: fullstack.hedera.com/type: gateway spec: diff --git a/charts/hedera-network/templates/gateway-api/haproxy-grpc-routes.yaml b/charts/hedera-network/templates/gateway-api/haproxy-grpc-routes.yaml index 186ef5b0c..7e3800011 100644 --- a/charts/hedera-network/templates/gateway-api/haproxy-grpc-routes.yaml +++ b/charts/hedera-network/templates/gateway-api/haproxy-grpc-routes.yaml @@ -7,7 +7,7 @@ apiVersion: gateway.networking.k8s.io/v1alpha2 kind: TCPRoute metadata: name: haproxy-grpc-route-{{ $node.name }} - namespace: {{ include "fullstack.namespace" $ }} + namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }} labels: fullstack.hedera.com/type: tcp-route fullstack.hedera.com/nodeName: {{ $node.name }} diff --git a/charts/hedera-network/templates/gateway-api/network-node-grpc-routes.yaml b/charts/hedera-network/templates/gateway-api/network-node-grpc-routes.yaml index 79a82ece8..aae30d6d6 100644 --- a/charts/hedera-network/templates/gateway-api/network-node-grpc-routes.yaml +++ b/charts/hedera-network/templates/gateway-api/network-node-grpc-routes.yaml @@ -7,7 +7,7 @@ apiVersion: gateway.networking.k8s.io/v1alpha2 kind: TCPRoute metadata: name: node-grpc-route-{{ $node.name }} - namespace: {{ include "fullstack.namespace" $ }} + namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }} labels: fullstack.hedera.com/type: tcp-route fullstack.hedera.com/nodeName: {{ $node.name }} diff --git a/charts/hedera-network/templates/network-node-statefulset.yaml b/charts/hedera-network/templates/network-node-statefulset.yaml index df2238957..1d45ddcb3 100644 --- a/charts/hedera-network/templates/network-node-statefulset.yaml +++ b/charts/hedera-network/templates/network-node-statefulset.yaml @@ -14,7 +14,7 @@ apiVersion: apps/v1 kind: StatefulSet metadata: name: network-{{ $node.name }} - namespace: {{ include "fullstack.namespace" $ }} + namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }} labels: app: network-{{ $node.name }} spec: diff --git a/charts/hedera-network/templates/proxy/envoy-deployment.yaml b/charts/hedera-network/templates/proxy/envoy-deployment.yaml index 66d6bb324..38d6b6259 100644 --- a/charts/hedera-network/templates/proxy/envoy-deployment.yaml +++ b/charts/hedera-network/templates/proxy/envoy-deployment.yaml @@ -7,7 +7,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: envoy-proxy-{{ $node.name }} - namespace: {{ include "fullstack.namespace" $ }} + namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }} spec: replicas: 1 selector: diff --git a/charts/hedera-network/templates/proxy/haproxy-deployment.yaml b/charts/hedera-network/templates/proxy/haproxy-deployment.yaml index 8577f6f4b..1ba018ec0 100644 --- a/charts/hedera-network/templates/proxy/haproxy-deployment.yaml +++ b/charts/hedera-network/templates/proxy/haproxy-deployment.yaml @@ -7,7 +7,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: haproxy-{{ $node.name }} - namespace: {{ include "fullstack.namespace" $ }} + namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }} spec: replicas: 1 selector: diff --git a/charts/hedera-network/templates/rbac/pod-monitor-role.yaml b/charts/hedera-network/templates/rbac/pod-monitor-role.yaml index 255d54991..ca71a23ca 100644 --- a/charts/hedera-network/templates/rbac/pod-monitor-role.yaml +++ b/charts/hedera-network/templates/rbac/pod-monitor-role.yaml @@ -2,7 +2,7 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: pod-monitoring-role - namespace: {{ include "fullstack.namespace" $ }} + namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }} rules: - apiGroups: [ "" ] resources: @@ -31,11 +31,11 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: pod-monitoring-role-binding - namespace: {{ include "fullstack.namespace" $ }} + namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }} subjects: - kind: ServiceAccount name: pod-monitor - namespace: {{ include "fullstack.namespace" $ }} + namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }} roleRef: kind: ClusterRole name: pod-monitoring-role diff --git a/charts/hedera-network/templates/rbac/service-accounts.yaml b/charts/hedera-network/templates/rbac/service-accounts.yaml index 084cdb4fa..1e8e41c88 100644 --- a/charts/hedera-network/templates/rbac/service-accounts.yaml +++ b/charts/hedera-network/templates/rbac/service-accounts.yaml @@ -2,4 +2,4 @@ apiVersion: v1 kind: ServiceAccount metadata: name: pod-monitor - namespace: {{ include "fullstack.namespace" $ }} + namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }} diff --git a/charts/hedera-network/templates/secrets/backup-uploder-secrets.yaml b/charts/hedera-network/templates/secrets/backup-uploder-secrets.yaml index f9721e59c..54e8670c0 100644 --- a/charts/hedera-network/templates/secrets/backup-uploder-secrets.yaml +++ b/charts/hedera-network/templates/secrets/backup-uploder-secrets.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: Secret metadata: name: backup-uploader-secrets - namespace: {{ include "fullstack.namespace" $ }} + namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }} type: Opaque data: S3_ACCESS_KEY: "" diff --git a/charts/hedera-network/templates/secrets/otel-collector-secrets.yaml b/charts/hedera-network/templates/secrets/otel-collector-secrets.yaml index aed2583b7..bb3d2b91b 100644 --- a/charts/hedera-network/templates/secrets/otel-collector-secrets.yaml +++ b/charts/hedera-network/templates/secrets/otel-collector-secrets.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: Secret metadata: name: otel-collector-secrets - namespace: {{ include "fullstack.namespace" $ }} + namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }} type: Opaque data: S3_ACCESS_KEY: "" diff --git a/charts/hedera-network/templates/secrets/uploder-mirror-secrets.yaml b/charts/hedera-network/templates/secrets/uploder-mirror-secrets.yaml index 8878b5744..2aa0834f3 100644 --- a/charts/hedera-network/templates/secrets/uploder-mirror-secrets.yaml +++ b/charts/hedera-network/templates/secrets/uploder-mirror-secrets.yaml @@ -7,7 +7,7 @@ apiVersion: v1 kind: Secret metadata: name: minio-secrets - namespace: {{ include "fullstack.namespace" $ }} + namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }} type: Opaque data: config.env: {{ $minio_config_env | b64enc }} diff --git a/charts/hedera-network/templates/services/envoy-svc.yaml b/charts/hedera-network/templates/services/envoy-svc.yaml index 13a38f66b..91e9680a7 100644 --- a/charts/hedera-network/templates/services/envoy-svc.yaml +++ b/charts/hedera-network/templates/services/envoy-svc.yaml @@ -7,7 +7,7 @@ apiVersion: v1 kind: Service metadata: name: envoy-proxy-{{ $node.name }}-svc - namespace: {{ include "fullstack.namespace" $ }} + namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }} labels: fullstack.hedera.com/type: envoy-proxy-svc fullstack.hedera.com/node-name: {{ $node.name }} diff --git a/charts/hedera-network/templates/services/haproxy-svc.yaml b/charts/hedera-network/templates/services/haproxy-svc.yaml index 4b44cfc5a..b610d2793 100644 --- a/charts/hedera-network/templates/services/haproxy-svc.yaml +++ b/charts/hedera-network/templates/services/haproxy-svc.yaml @@ -7,7 +7,7 @@ apiVersion: v1 kind: Service metadata: name: haproxy-{{ $node.name }}-svc - namespace: {{ include "fullstack.namespace" $ }} + namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }} labels: fullstack.hedera.com/type: haproxy-svc fullstack.hedera.com/node-name: {{ $node.name }} diff --git a/charts/hedera-network/templates/services/network-node-svc.yaml b/charts/hedera-network/templates/services/network-node-svc.yaml index d14c56351..f16218dc1 100644 --- a/charts/hedera-network/templates/services/network-node-svc.yaml +++ b/charts/hedera-network/templates/services/network-node-svc.yaml @@ -4,7 +4,7 @@ apiVersion: v1 kind: Service metadata: name: network-{{ $nodeConfig.name }}-svc - namespace: {{ include "fullstack.namespace" $ }} + namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }} labels: fullstack.hedera.com/type: network-node-svc fullstack.hedera.com/node-name: {{ $nodeConfig.name }} diff --git a/charts/hedera-network/templates/telemetry/prometheus-svc-monitor.yaml b/charts/hedera-network/templates/telemetry/prometheus-svc-monitor.yaml index 4bd355799..8e044a463 100644 --- a/charts/hedera-network/templates/telemetry/prometheus-svc-monitor.yaml +++ b/charts/hedera-network/templates/telemetry/prometheus-svc-monitor.yaml @@ -3,7 +3,7 @@ apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: name: network-node-monitor - namespace: {{ include "fullstack.namespace" $ }} + namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }} labels: fullstack.hedera.com/type: network-node-svc-monitor spec: From ca141d7b8d329058faa74063c3e3fefefe23a8c6 Mon Sep 17 00:00:00 2001 From: Lenin Mehedy Date: Mon, 18 Sep 2023 15:06:34 +1000 Subject: [PATCH 7/7] fix: variable scope in templates Signed-off-by: Lenin Mehedy --- charts/hedera-network/templates/configmaps/envoy-cm.yaml | 2 +- charts/hedera-network/templates/configmaps/haproxy-cm.yaml | 2 +- .../templates/configmaps/otel-collector-cm.yaml | 2 +- charts/hedera-network/templates/configmaps/test-cm.yaml | 2 +- .../templates/gateway-api/envoy-grpc-web-routes.yaml | 2 +- charts/hedera-network/templates/gateway-api/gateway.yaml | 4 ++-- .../templates/gateway-api/haproxy-grpc-routes.yaml | 2 +- .../templates/gateway-api/network-node-grpc-routes.yaml | 2 +- .../hedera-network/templates/network-node-statefulset.yaml | 2 +- charts/hedera-network/templates/proxy/envoy-deployment.yaml | 2 +- .../hedera-network/templates/proxy/haproxy-deployment.yaml | 2 +- charts/hedera-network/templates/rbac/pod-monitor-role.yaml | 6 +++--- charts/hedera-network/templates/rbac/service-accounts.yaml | 2 +- .../templates/secrets/backup-uploder-secrets.yaml | 2 +- .../templates/secrets/otel-collector-secrets.yaml | 2 +- .../templates/secrets/uploder-mirror-secrets.yaml | 2 +- charts/hedera-network/templates/services/envoy-svc.yaml | 2 +- charts/hedera-network/templates/services/haproxy-svc.yaml | 2 +- .../hedera-network/templates/services/network-node-svc.yaml | 2 +- .../templates/telemetry/prometheus-svc-monitor.yaml | 2 +- 20 files changed, 23 insertions(+), 23 deletions(-) diff --git a/charts/hedera-network/templates/configmaps/envoy-cm.yaml b/charts/hedera-network/templates/configmaps/envoy-cm.yaml index c9ccc7cd3..e584f4579 100644 --- a/charts/hedera-network/templates/configmaps/envoy-cm.yaml +++ b/charts/hedera-network/templates/configmaps/envoy-cm.yaml @@ -5,7 +5,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: envoy-proxy-cm-{{ $node.name }} - namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }} + namespace: {{ default $.Release.Namespace $.Values.global.namespaceOverride }} data: envoy.yaml: | {{- tpl ($.Files.Get "config-files/envoy.yaml") (dict "nodeConfig" $node "Template" $.Template) | nindent 4 }} diff --git a/charts/hedera-network/templates/configmaps/haproxy-cm.yaml b/charts/hedera-network/templates/configmaps/haproxy-cm.yaml index ecd39ebc9..3b63a756d 100644 --- a/charts/hedera-network/templates/configmaps/haproxy-cm.yaml +++ b/charts/hedera-network/templates/configmaps/haproxy-cm.yaml @@ -5,7 +5,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: haproxy-cm-{{ $node.name }} - namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }} + namespace: {{ default $.Release.Namespace $.Values.global.namespaceOverride }} data: haproxy.cfg: | {{- tpl ($.Files.Get "config-files/haproxy.cfg") (dict "nodeConfig" $node "Template" $.Template) | nindent 4 }} diff --git a/charts/hedera-network/templates/configmaps/otel-collector-cm.yaml b/charts/hedera-network/templates/configmaps/otel-collector-cm.yaml index 6a1e634d2..726c9bc81 100644 --- a/charts/hedera-network/templates/configmaps/otel-collector-cm.yaml +++ b/charts/hedera-network/templates/configmaps/otel-collector-cm.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: otel-collector-cm - namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }} + namespace: {{ default $.Release.Namespace $.Values.global.namespaceOverride }} data: config.yaml: | {{- tpl (.Files.Get "config-files/otel-collector-config.yaml") ( dict "otelDefaults" $.Values.defaults.sidecars.otelCollector "Template" $.Template ) | nindent 4 }} diff --git a/charts/hedera-network/templates/configmaps/test-cm.yaml b/charts/hedera-network/templates/configmaps/test-cm.yaml index 67e8d9f73..3c004543b 100644 --- a/charts/hedera-network/templates/configmaps/test-cm.yaml +++ b/charts/hedera-network/templates/configmaps/test-cm.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: test-cm - namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }} + namespace: {{ default $.Release.Namespace $.Values.global.namespaceOverride }} data: {{- $total_nodes := len $.Values.hedera.nodes -}} {{- range $path, $_ := .Files.Glob "tests/*.*" }} diff --git a/charts/hedera-network/templates/gateway-api/envoy-grpc-web-routes.yaml b/charts/hedera-network/templates/gateway-api/envoy-grpc-web-routes.yaml index 750d2eef4..7485037f8 100644 --- a/charts/hedera-network/templates/gateway-api/envoy-grpc-web-routes.yaml +++ b/charts/hedera-network/templates/gateway-api/envoy-grpc-web-routes.yaml @@ -7,7 +7,7 @@ apiVersion: gateway.networking.k8s.io/v1beta1 kind: HTTPRoute metadata: name: envoy-grpc-web-route-{{ $node.name }} - namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }} + namespace: {{ default $.Release.Namespace $.Values.global.namespaceOverride }} labels: fullstack.hedera.com/type: http-route spec: diff --git a/charts/hedera-network/templates/gateway-api/gateway.yaml b/charts/hedera-network/templates/gateway-api/gateway.yaml index 378b297e2..a041c1cac 100644 --- a/charts/hedera-network/templates/gateway-api/gateway.yaml +++ b/charts/hedera-network/templates/gateway-api/gateway.yaml @@ -3,7 +3,7 @@ apiVersion: gateway.networking.k8s.io/v1beta1 kind: GatewayClass metadata: name: {{ $.Values.gatewayApi.gatewayClass.name }} - namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }} + namespace: {{ default $.Release.Namespace $.Values.global.namespaceOverride }} labels: fullstack.hedera.com/type: gateway-class spec: @@ -15,7 +15,7 @@ apiVersion: gateway.networking.k8s.io/v1beta1 kind: Gateway metadata: name: {{ $.Values.gatewayApi.gateway.name }} - namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }} + namespace: {{ default $.Release.Namespace $.Values.global.namespaceOverride }} labels: fullstack.hedera.com/type: gateway spec: diff --git a/charts/hedera-network/templates/gateway-api/haproxy-grpc-routes.yaml b/charts/hedera-network/templates/gateway-api/haproxy-grpc-routes.yaml index 7e3800011..ae775bbf5 100644 --- a/charts/hedera-network/templates/gateway-api/haproxy-grpc-routes.yaml +++ b/charts/hedera-network/templates/gateway-api/haproxy-grpc-routes.yaml @@ -7,7 +7,7 @@ apiVersion: gateway.networking.k8s.io/v1alpha2 kind: TCPRoute metadata: name: haproxy-grpc-route-{{ $node.name }} - namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }} + namespace: {{ default $.Release.Namespace $.Values.global.namespaceOverride }} labels: fullstack.hedera.com/type: tcp-route fullstack.hedera.com/nodeName: {{ $node.name }} diff --git a/charts/hedera-network/templates/gateway-api/network-node-grpc-routes.yaml b/charts/hedera-network/templates/gateway-api/network-node-grpc-routes.yaml index aae30d6d6..214997dc2 100644 --- a/charts/hedera-network/templates/gateway-api/network-node-grpc-routes.yaml +++ b/charts/hedera-network/templates/gateway-api/network-node-grpc-routes.yaml @@ -7,7 +7,7 @@ apiVersion: gateway.networking.k8s.io/v1alpha2 kind: TCPRoute metadata: name: node-grpc-route-{{ $node.name }} - namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }} + namespace: {{ default $.Release.Namespace $.Values.global.namespaceOverride }} labels: fullstack.hedera.com/type: tcp-route fullstack.hedera.com/nodeName: {{ $node.name }} diff --git a/charts/hedera-network/templates/network-node-statefulset.yaml b/charts/hedera-network/templates/network-node-statefulset.yaml index 1d45ddcb3..50f00ef4d 100644 --- a/charts/hedera-network/templates/network-node-statefulset.yaml +++ b/charts/hedera-network/templates/network-node-statefulset.yaml @@ -14,7 +14,7 @@ apiVersion: apps/v1 kind: StatefulSet metadata: name: network-{{ $node.name }} - namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }} + namespace: {{ default $.Release.Namespace $.Values.global.namespaceOverride }} labels: app: network-{{ $node.name }} spec: diff --git a/charts/hedera-network/templates/proxy/envoy-deployment.yaml b/charts/hedera-network/templates/proxy/envoy-deployment.yaml index 38d6b6259..022ef4272 100644 --- a/charts/hedera-network/templates/proxy/envoy-deployment.yaml +++ b/charts/hedera-network/templates/proxy/envoy-deployment.yaml @@ -7,7 +7,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: envoy-proxy-{{ $node.name }} - namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }} + namespace: {{ default $.Release.Namespace $.Values.global.namespaceOverride }} spec: replicas: 1 selector: diff --git a/charts/hedera-network/templates/proxy/haproxy-deployment.yaml b/charts/hedera-network/templates/proxy/haproxy-deployment.yaml index 1ba018ec0..a4edf92c4 100644 --- a/charts/hedera-network/templates/proxy/haproxy-deployment.yaml +++ b/charts/hedera-network/templates/proxy/haproxy-deployment.yaml @@ -7,7 +7,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: haproxy-{{ $node.name }} - namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }} + namespace: {{ default $.Release.Namespace $.Values.global.namespaceOverride }} spec: replicas: 1 selector: diff --git a/charts/hedera-network/templates/rbac/pod-monitor-role.yaml b/charts/hedera-network/templates/rbac/pod-monitor-role.yaml index ca71a23ca..dd8ccbd8e 100644 --- a/charts/hedera-network/templates/rbac/pod-monitor-role.yaml +++ b/charts/hedera-network/templates/rbac/pod-monitor-role.yaml @@ -2,7 +2,7 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: pod-monitoring-role - namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }} + namespace: {{ default $.Release.Namespace $.Values.global.namespaceOverride }} rules: - apiGroups: [ "" ] resources: @@ -31,11 +31,11 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: pod-monitoring-role-binding - namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }} + namespace: {{ default $.Release.Namespace $.Values.global.namespaceOverride }} subjects: - kind: ServiceAccount name: pod-monitor - namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }} + namespace: {{ default $.Release.Namespace $.Values.global.namespaceOverride }} roleRef: kind: ClusterRole name: pod-monitoring-role diff --git a/charts/hedera-network/templates/rbac/service-accounts.yaml b/charts/hedera-network/templates/rbac/service-accounts.yaml index 1e8e41c88..0e4b26311 100644 --- a/charts/hedera-network/templates/rbac/service-accounts.yaml +++ b/charts/hedera-network/templates/rbac/service-accounts.yaml @@ -2,4 +2,4 @@ apiVersion: v1 kind: ServiceAccount metadata: name: pod-monitor - namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }} + namespace: {{ default $.Release.Namespace $.Values.global.namespaceOverride }} diff --git a/charts/hedera-network/templates/secrets/backup-uploder-secrets.yaml b/charts/hedera-network/templates/secrets/backup-uploder-secrets.yaml index 54e8670c0..04f14dae7 100644 --- a/charts/hedera-network/templates/secrets/backup-uploder-secrets.yaml +++ b/charts/hedera-network/templates/secrets/backup-uploder-secrets.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: Secret metadata: name: backup-uploader-secrets - namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }} + namespace: {{ default $.Release.Namespace $.Values.global.namespaceOverride }} type: Opaque data: S3_ACCESS_KEY: "" diff --git a/charts/hedera-network/templates/secrets/otel-collector-secrets.yaml b/charts/hedera-network/templates/secrets/otel-collector-secrets.yaml index bb3d2b91b..13e65c2f2 100644 --- a/charts/hedera-network/templates/secrets/otel-collector-secrets.yaml +++ b/charts/hedera-network/templates/secrets/otel-collector-secrets.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: Secret metadata: name: otel-collector-secrets - namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }} + namespace: {{ default $.Release.Namespace $.Values.global.namespaceOverride }} type: Opaque data: S3_ACCESS_KEY: "" diff --git a/charts/hedera-network/templates/secrets/uploder-mirror-secrets.yaml b/charts/hedera-network/templates/secrets/uploder-mirror-secrets.yaml index 2aa0834f3..cc6c11371 100644 --- a/charts/hedera-network/templates/secrets/uploder-mirror-secrets.yaml +++ b/charts/hedera-network/templates/secrets/uploder-mirror-secrets.yaml @@ -7,7 +7,7 @@ apiVersion: v1 kind: Secret metadata: name: minio-secrets - namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }} + namespace: {{ default $.Release.Namespace $.Values.global.namespaceOverride }} type: Opaque data: config.env: {{ $minio_config_env | b64enc }} diff --git a/charts/hedera-network/templates/services/envoy-svc.yaml b/charts/hedera-network/templates/services/envoy-svc.yaml index 91e9680a7..082103dda 100644 --- a/charts/hedera-network/templates/services/envoy-svc.yaml +++ b/charts/hedera-network/templates/services/envoy-svc.yaml @@ -7,7 +7,7 @@ apiVersion: v1 kind: Service metadata: name: envoy-proxy-{{ $node.name }}-svc - namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }} + namespace: {{ default $.Release.Namespace $.Values.global.namespaceOverride }} labels: fullstack.hedera.com/type: envoy-proxy-svc fullstack.hedera.com/node-name: {{ $node.name }} diff --git a/charts/hedera-network/templates/services/haproxy-svc.yaml b/charts/hedera-network/templates/services/haproxy-svc.yaml index b610d2793..248083a6b 100644 --- a/charts/hedera-network/templates/services/haproxy-svc.yaml +++ b/charts/hedera-network/templates/services/haproxy-svc.yaml @@ -7,7 +7,7 @@ apiVersion: v1 kind: Service metadata: name: haproxy-{{ $node.name }}-svc - namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }} + namespace: {{ default $.Release.Namespace $.Values.global.namespaceOverride }} labels: fullstack.hedera.com/type: haproxy-svc fullstack.hedera.com/node-name: {{ $node.name }} diff --git a/charts/hedera-network/templates/services/network-node-svc.yaml b/charts/hedera-network/templates/services/network-node-svc.yaml index f16218dc1..4fa908d2f 100644 --- a/charts/hedera-network/templates/services/network-node-svc.yaml +++ b/charts/hedera-network/templates/services/network-node-svc.yaml @@ -4,7 +4,7 @@ apiVersion: v1 kind: Service metadata: name: network-{{ $nodeConfig.name }}-svc - namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }} + namespace: {{ default $.Release.Namespace $.Values.global.namespaceOverride }} labels: fullstack.hedera.com/type: network-node-svc fullstack.hedera.com/node-name: {{ $nodeConfig.name }} diff --git a/charts/hedera-network/templates/telemetry/prometheus-svc-monitor.yaml b/charts/hedera-network/templates/telemetry/prometheus-svc-monitor.yaml index 8e044a463..f990545ea 100644 --- a/charts/hedera-network/templates/telemetry/prometheus-svc-monitor.yaml +++ b/charts/hedera-network/templates/telemetry/prometheus-svc-monitor.yaml @@ -3,7 +3,7 @@ apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: name: network-node-monitor - namespace: {{ default .Release.Namespace .Values.global.namespaceOverride }} + namespace: {{ default $.Release.Namespace $.Values.global.namespaceOverride }} labels: fullstack.hedera.com/type: network-node-svc-monitor spec: