From 1f409fab0afa0a5aecb606d4e028af6588a874cb Mon Sep 17 00:00:00 2001 From: Tiago Castro Date: Mon, 8 Apr 2024 22:47:37 +0100 Subject: [PATCH 1/4] fix(jaeger): update and use the jaeger bundled CRD It seems otherwise there's a race condition in which CRD gets installed depending on the helm version. We don't actually need to use our own CRD for jaeger anymore, so let's instead if the bundled one from jaeger-operator. Updates jaeger-operator. Note that as of now cert-manager is a required dependency for jaeger. Signed-off-by: Tiago Castro --- chart/Chart.yaml | 2 +- chart/README.md | 4 +- chart/charts/crds/README.md | 3 -- chart/charts/crds/templates/jaeger.yaml | 50 ------------------------- chart/charts/crds/values.yaml | 11 ------ chart/values.yaml | 10 ++--- 6 files changed, 5 insertions(+), 75 deletions(-) delete mode 100644 chart/charts/crds/templates/jaeger.yaml diff --git a/chart/Chart.yaml b/chart/Chart.yaml index 711058ae3..4f7f90e6f 100644 --- a/chart/Chart.yaml +++ b/chart/Chart.yaml @@ -32,7 +32,7 @@ dependencies: repository: https://charts.bitnami.com/bitnami version: 8.6.0 - name: jaeger-operator - version: 2.25.0 + version: 2.50.1 repository: https://jaegertracing.github.io/helm-charts condition: base.jaeger.enabled - name: loki-stack diff --git a/chart/README.md b/chart/README.md index c094093ea..85ac80249 100644 --- a/chart/README.md +++ b/chart/README.md @@ -57,7 +57,7 @@ This removes all the Kubernetes components associated with the chart and deletes | | crds | 0.0.0 | | https://charts.bitnami.com/bitnami | etcd | 8.6.0 | | https://grafana.github.io/helm-charts | loki-stack | 2.9.11 | -| https://jaegertracing.github.io/helm-charts | jaeger-operator | 2.25.0 | +| https://jaegertracing.github.io/helm-charts | jaeger-operator | 2.50.1 | | https://nats-io.github.io/k8s/helm/charts/ | nats | 0.19.14 | | https://openebs.github.io/dynamic-localpv-provisioner | localpv-provisioner | 4.0.0 | @@ -101,14 +101,12 @@ This removes all the Kubernetes components associated with the chart and deletes | base.​cache_poll_period | Cache timeout for core agent & diskpool deployment | `"30s"` | | base.​default_req_timeout | Request timeout for rest & core agents | `"5s"` | | base.​imagePullSecrets.​enabled | Enable imagePullSecrets for pulling our container images | `false` | -| base.​jaeger.​enabled | Enable jaeger tracing | `false` | | base.​logging.​color | Enable ansi color code for Pod StdOut/StdErr | `true` | | base.​logging.​format | Valid values for format are pretty, json and compact | `"pretty"` | | base.​logging.​silenceLevel | Silence specific module components | `nil` | | base.​metrics.​enabled | Enable the metrics exporter | `true` | | crds.​csi.​volumeSnapshots.​enabled | Install Volume Snapshot CRDs | `true` | | crds.​enabled | Disables the installation of all CRDs if set to false | `true` | -| crds.​jaeger.​enabled | Install Jaeger CRDs | `true` | | csi.​controller.​logLevel | Log level for the csi controller | `"info"` | | csi.​controller.​preventVolumeModeConversion | Prevent modifying the volume mode when creating a PVC from an existing VolumeSnapshot | `true` | | csi.​controller.​priorityClassName | Set PriorityClass, overrides global | `""` | diff --git a/chart/charts/crds/README.md b/chart/charts/crds/README.md index 8a704da86..7b8aca397 100644 --- a/chart/charts/crds/README.md +++ b/chart/charts/crds/README.md @@ -9,7 +9,4 @@ A Helm chart that collects CustomResourceDefinitions (CRDs) from Mayastor. | csi.​volumeSnapshots.​annotations | Annotations to be added to all CRDs |
{

}
| | csi.​volumeSnapshots.​enabled | Install Volume Snapshot CRDs | `true` | | csi.​volumeSnapshots.​keep | Keep CRDs on chart uninstall | `true` | -| jaeger.​annotations | Annotations to be added to all CRDs |
{

}
| -| jaeger.​enabled | Install Jaeger CRDs | `true` | -| jaeger.​keep | Keep CRDs on chart uninstall | `true` | diff --git a/chart/charts/crds/templates/jaeger.yaml b/chart/charts/crds/templates/jaeger.yaml deleted file mode 100644 index 68d025f6c..000000000 --- a/chart/charts/crds/templates/jaeger.yaml +++ /dev/null @@ -1,50 +0,0 @@ -{{- if .Values.jaeger.enabled -}} -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: jaegers.jaegertracing.io - {{- if or (.Values.jaeger.keep) (.Values.jaeger.annotations) }} - annotations: - {{- include "crds.extraAnnotations" .Values.jaeger | nindent 4 }} - {{- end }} - labels: - app: jaeger-operator -spec: - group: jaegertracing.io - names: - kind: Jaeger - listKind: JaegerList - plural: jaegers - singular: jaeger - scope: Namespaced - versions: - - name: v1 - schema: - openAPIV3Schema: - x-kubernetes-preserve-unknown-fields: true - type: object - additionalPrinterColumns: - - description: Jaeger instance's status - jsonPath: .status.phase - name: Status - type: string - - description: Jaeger Version - jsonPath: .status.version - name: Version - type: string - - description: Jaeger deployment strategy - jsonPath: .spec.strategy - name: Strategy - type: string - - description: Jaeger storage type - jsonPath: .spec.storage.type - name: Storage - type: string - - jsonPath: .metadata.creationTimestamp - name: Age - type: date - served: true - storage: true - subresources: - status: {} -{{- end -}} diff --git a/chart/charts/crds/values.yaml b/chart/charts/crds/values.yaml index fdda41f28..d3bb538dd 100644 --- a/chart/charts/crds/values.yaml +++ b/chart/charts/crds/values.yaml @@ -1,13 +1,3 @@ -jaeger: - # -- Install Jaeger CRDs - enabled: true - # -- Keep CRDs on chart uninstall - keep: true - # -- Annotations to be added to all CRDs - annotations: {} - # Example for Argo CD to prevent CRDs from being recycled - # argocd.argoproj.io/sync-options: Prune=false - csi: volumeSnapshots: # -- Install Volume Snapshot CRDs @@ -18,4 +8,3 @@ csi: annotations: {} # Example for Argo CD to prevent CRDs from being recycled # argocd.argoproj.io/sync-options: Prune=false - diff --git a/chart/values.yaml b/chart/values.yaml index 9231bdca2..72b7f5fce 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -1,9 +1,6 @@ crds: # -- Disables the installation of all CRDs if set to false enabled: true - jaeger: - # -- Install Jaeger CRDs - enabled: true csi: volumeSnapshots: # -- Install Volume Snapshot CRDs @@ -103,7 +100,9 @@ base: enabled: true jaeger: - # -- Enable jaeger tracing + # Enable jaeger tracing (for development only). + # Since version 1.31 the Jaeger Operator uses webhooks to validate Jaeger custom resources (CRs). + # This requires an installed version of the cert-manager. enabled: false initContainer: true agent: @@ -143,9 +142,6 @@ operators: jaeger-operator: # Name of jaeger operator name: "{{ .Release.Name }}" - crd: - # Install jaeger CRDs - install: false jaeger: # Install jaeger-operator create: false From 81e36f3835b7d5b4dfd5cb69256ac45d38874483 Mon Sep 17 00:00:00 2001 From: Tiago Castro Date: Wed, 10 Apr 2024 10:02:30 +0100 Subject: [PATCH 2/4] ci(release/script): avoid unbound var access Ensure helm dep var is set before we use it (cleanup). Rename it to capitals to make clear its global. Signed-off-by: Tiago Castro --- scripts/release.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/scripts/release.sh b/scripts/release.sh index 9e6f909ab..fb767d257 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -8,7 +8,7 @@ CI=${CI-} set -euo pipefail -trap 'cleanup_and_exit "$?"' EXIT + # Test if the image already exists in dockerhub dockerhub_tag_exists() { curl --silent -f -lSL https://hub.docker.com/v2/repositories/$1/tags/$2 1>/dev/null 2>&1 @@ -34,7 +34,7 @@ cleanup_and_exit() { local -r status=${1} # Remove helm subcharts, if `helm dependency update` was run. - if [ "$_helm_dependencies_updated" = "true" ]; then + if [ "$HELM_DEPS_UPDATED" = "true" ]; then echo "Cleaning up helm chart dependencies..." for dep_chart in "$CHART_DIR"/charts/*; do if [ "$dep_chart" = "$CHART_DIR/charts/crds" ]; then @@ -99,6 +99,9 @@ DEFAULT_BINARIES="kubectl-plugin" BUILD_BINARIES= BIN_TARGET_PLAT="linux-musl" BINARY_OUT_LINK="." +# This variable will be used to flag if the helm chart dependencies have been +# been updated. +HELM_DEPS_UPDATED="false" # Check if all needed tools are installed curl --version >/dev/null @@ -192,6 +195,8 @@ while [ "$#" -gt 0 ]; do esac done +trap 'cleanup_and_exit "$?"' EXIT + cd $SCRIPTDIR/.. if [ -z "$IMAGES" ]; then @@ -243,9 +248,6 @@ if [ -n "$BUILD_BINARIES" ]; then done fi -# This variable will be used to flag if the helm chart dependencies have been -# been updated. -_helm_dependencies_updated="false" for name in $IMAGES; do image_basename=$($NIX_EVAL -f . images.$BUILD_TYPE.$name.imageName | xargs) image=$image_basename @@ -257,7 +259,7 @@ for name in $IMAGES; do fi fi - if [ "$_helm_dependencies_updated" = "false" ]; then + if [ "$HELM_DEPS_UPDATED" = "false" ]; then for helm_chart_user in ${IMAGES_THAT_REQUIRE_HELM_CHART[@]}; do if [ "$name" = "$helm_chart_user" ]; then echo "Updating helm chart dependencies..." @@ -276,7 +278,7 @@ for name in $IMAGES; do done # Set flag to true - _helm_dependencies_updated="true" + HELM_DEPS_UPDATED="true" break fi done From 8ac538b5e93d2bad34d9285b8c9a3b2077feb86b Mon Sep 17 00:00:00 2001 From: Tiago Castro Date: Wed, 10 Apr 2024 10:25:47 +0100 Subject: [PATCH 3/4] ci: printenv before image build test Signed-off-by: Tiago Castro --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index f29a09d6b..501746a14 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -178,6 +178,7 @@ pipeline { } agent { label 'nixos-mayastor' } steps { + sh 'printenv' sh './scripts/nix/git-submodule-init.sh --force' sh './scripts/release.sh --skip-publish --debug --build-bins' } From 6bf41bf253822d17f915b88c18b274097aa990b4 Mon Sep 17 00:00:00 2001 From: Tiago Castro Date: Wed, 10 Apr 2024 13:30:22 +0100 Subject: [PATCH 4/4] fix(helm): unbound helm var access Signed-off-by: Tiago Castro --- chart/templates/_helpers.tpl | 4 ++-- chart/templates/mayastor/csi/csi-node-daemonset.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/chart/templates/_helpers.tpl b/chart/templates/_helpers.tpl index 536f96a50..53884eb31 100644 --- a/chart/templates/_helpers.tpl +++ b/chart/templates/_helpers.tpl @@ -66,7 +66,7 @@ Usage: {{ include "csi_node_init_containers" . }} */}} {{- define "csi_node_init_containers" -}} - {{- if .Values.csi.node.initContainers.enabled }} + {{- if (.Values.csi.node.initContainers).enabled }} {{- include "render" (dict "value" .Values.csi.node.initContainers.containers "context" $) | nindent 8 }} {{- end }} {{- end -}} @@ -250,4 +250,4 @@ Usage: {{ $param | quote }}: {{ $val | quote }} {{- end -}} {{- end -}} -{{- end -}} \ No newline at end of file +{{- end -}} diff --git a/chart/templates/mayastor/csi/csi-node-daemonset.yaml b/chart/templates/mayastor/csi/csi-node-daemonset.yaml index 74a398eef..681d3b324 100644 --- a/chart/templates/mayastor/csi/csi-node-daemonset.yaml +++ b/chart/templates/mayastor/csi/csi-node-daemonset.yaml @@ -77,7 +77,7 @@ spec: fieldPath: status.podIP - name: RUST_BACKTRACE value: "1" - {{- if .Values.csi.node.mkfs_args.xfs }} + {{- if (.Values.csi.node.mkfs_args).xfs }} - name: MKFS_XFS_ARGS value: {{ .Values.csi.node.mkfs_args.xfs | quote }} {{- end }}