From fd1321af8947d7fcbc58c8f320adc89f08ed187d Mon Sep 17 00:00:00 2001 From: Marc LeBlanc <7050295+marcleblanc2@users.noreply.github.com> Date: Wed, 25 Nov 2026 14:27:49 -0500 Subject: [PATCH 1/3] ci: build rendered charts with kustomize to catch duplicate YAML keys Helm emits a map key twice when a label or annotation is set at both the global and the component level. Helm and kubectl accept that, but kustomize rejects it, which breaks anyone who runs kustomize over the chart. Add tests/kustomizeRender_*.yaml values files for each chart, shaped like Sourcegraph Cloud and self-hosted deployments, and a workflow that renders each chart with them and builds the output with kustomize. Helm comes from .tool-versions, as on Buildkite. kustomizeRender_labelOverrides.yaml fails on main until the chart deduplicates these keys. Co-authored-by: Amp Amp-Thread-ID: https://ampcode.com/threads/T-01a2140d-bf64-751f-9812-0c8757baf6fd --- .github/workflows/kustomize_render.yml | 24 ++ .../tests/kustomizeRender_selfHosted.yaml | 48 ++++ .../k8s/tests/kustomizeRender_selfHosted.yaml | 50 +++++ .../tests/kustomizeRender_selfHosted.yaml | 58 +++++ .../tests/kustomizeRender_labelOverrides.yaml | 39 ++++ .../tests/kustomizeRender_selfHosted.yaml | 197 ++++++++++++++++ .../kustomizeRender_sourcegraphCloud.yaml | 210 ++++++++++++++++++ scripts/ci/kustomize-render.sh | 28 +++ 8 files changed, 654 insertions(+) create mode 100644 .github/workflows/kustomize_render.yml create mode 100644 charts/sourcegraph-executor/dind/tests/kustomizeRender_selfHosted.yaml create mode 100644 charts/sourcegraph-executor/k8s/tests/kustomizeRender_selfHosted.yaml create mode 100644 charts/sourcegraph-migrator/tests/kustomizeRender_selfHosted.yaml create mode 100644 charts/sourcegraph/tests/kustomizeRender_labelOverrides.yaml create mode 100644 charts/sourcegraph/tests/kustomizeRender_selfHosted.yaml create mode 100644 charts/sourcegraph/tests/kustomizeRender_sourcegraphCloud.yaml create mode 100755 scripts/ci/kustomize-render.sh diff --git a/.github/workflows/kustomize_render.yml b/.github/workflows/kustomize_render.yml new file mode 100644 index 000000000..3539fa107 --- /dev/null +++ b/.github/workflows/kustomize_render.yml @@ -0,0 +1,24 @@ +name: Render charts through kustomize +on: + push: + branches: + - main + - release/** + pull_request: + +jobs: + kustomize-render: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + + # Installs the Helm version in .tool-versions, the same one Buildkite uses. + # kubectl, with its built-in kustomize, comes with the runner image. + - name: Set up Helm + uses: jdx/mise-action@924e7c586e33d7d4bae9c14e26c5d22e2beb6e78 # v5.3.0 + with: + install_args: helm + + - name: Render each chart's tests/kustomizeRender_*.yaml and build it with kustomize + run: scripts/ci/kustomize-render.sh diff --git a/charts/sourcegraph-executor/dind/tests/kustomizeRender_selfHosted.yaml b/charts/sourcegraph-executor/dind/tests/kustomizeRender_selfHosted.yaml new file mode 100644 index 000000000..9c0906a75 --- /dev/null +++ b/charts/sourcegraph-executor/dind/tests/kustomizeRender_selfHosted.yaml @@ -0,0 +1,48 @@ +# Used by CI: the "Render charts through kustomize" GitHub Actions job +# (.github/workflows/kustomize_render.yml) renders this chart with this file +# through scripts/ci/kustomize-render.sh. +# +# Shaped like common self-hosted deployments: several queues, organization +# labels, a private registry, and persistent registry storage. All names and +# endpoints are placeholders. + +sourcegraph: + image: + repository: registry.example.com/sourcegraph + imagePullSecrets: + - name: registry-credentials + labels: + example.com/project: sourcegraph + podLabels: + example.com/project: sourcegraph + podAnnotations: + metrics.example.com/scrape: "true" + nodeSelector: + example.com/dedicated: executors + tolerations: + - key: example.com/dedicated + operator: Exists + effect: NoSchedule + +storageClass: + create: true + name: sourcegraph-executors + +executor: + frontendUrl: https://sourcegraph.example.com + frontendExistingSecret: executor-credentials + queueNames: [batches, codeintel] + labels: + example.com/service: executor + podLabels: + example.com/service: executor + env: + HTTPS_PROXY: + value: http://proxy.example.com:3128 + +privateDockerRegistry: + labels: + example.com/service: executor-registry + podLabels: + example.com/service: executor-registry + storageSize: 50Gi diff --git a/charts/sourcegraph-executor/k8s/tests/kustomizeRender_selfHosted.yaml b/charts/sourcegraph-executor/k8s/tests/kustomizeRender_selfHosted.yaml new file mode 100644 index 000000000..98034ad96 --- /dev/null +++ b/charts/sourcegraph-executor/k8s/tests/kustomizeRender_selfHosted.yaml @@ -0,0 +1,50 @@ +# Used by CI: the "Render charts through kustomize" GitHub Actions job +# (.github/workflows/kustomize_render.yml) renders this chart with this file +# through scripts/ci/kustomize-render.sh. +# +# Shaped like common self-hosted deployments: one queue, organization labels, +# proxy and CA settings, and non-root job pods. All names and endpoints are +# placeholders. + +sourcegraph: + image: + repository: registry.example.com/sourcegraph + imagePullSecrets: + - name: registry-credentials + podLabels: + example.com/project: sourcegraph + podAnnotations: + metrics.example.com/scrape: "true" + +executor: + frontendUrl: https://sourcegraph.example.com + frontendPassword: placeholder-password + queueName: batches + namespace: sourcegraph-executors + labels: + example.com/service: executor + podLabels: + example.com/service: executor + podAnnotations: + metrics.example.com/port: "6060" + resources: + limits: + cpu: "2" + memory: 4Gi + requests: + cpu: "1" + memory: 1Gi + kubernetesJob: + runAsUser: "1000" + runAsGroup: "1000" + fsGroup: "1000" + extraEnv: + - name: HTTPS_PROXY + value: http://proxy.example.com:3128 + - name: NO_PROXY + value: localhost,127.0.0.1,.svc,.cluster.local + containerSecurityContext: + privileged: false + allowPrivilegeEscalation: false + podSecurityContext: + runAsNonRoot: true diff --git a/charts/sourcegraph-migrator/tests/kustomizeRender_selfHosted.yaml b/charts/sourcegraph-migrator/tests/kustomizeRender_selfHosted.yaml new file mode 100644 index 000000000..f36486467 --- /dev/null +++ b/charts/sourcegraph-migrator/tests/kustomizeRender_selfHosted.yaml @@ -0,0 +1,58 @@ +# Used by CI: the "Render charts through kustomize" GitHub Actions job +# (.github/workflows/kustomize_render.yml) renders this chart with this file +# through scripts/ci/kustomize-render.sh. +# +# Shaped like a self-hosted upgrade: a private registry, external database +# credentials, organization labels, and a restricted pod. All names are +# placeholders. + +sourcegraph: + image: + repository: registry.example.com/sourcegraph + useGlobalTagAsDefault: true + imagePullSecrets: + - name: registry-credentials + labels: + example.com/project: sourcegraph + podLabels: + example.com/project: sourcegraph + podAnnotations: + metrics.example.com/scrape: "false" + nodeSelector: + example.com/dedicated: sourcegraph + tolerations: + - key: example.com/dedicated + operator: Exists + effect: NoSchedule + +pgsql: + auth: + existingSecret: pgsql-credentials +codeIntelDB: + auth: + existingSecret: codeintel-db-credentials +codeInsightsDB: + auth: + existingSecret: codeinsights-db-credentials + +migrator: + labels: + example.com/service: migrator + podLabels: + example.com/service: migrator + env: + HTTPS_PROXY: + value: http://proxy.example.com:3128 + podSecurityContext: + runAsNonRoot: true + seccompProfile: + type: RuntimeDefault + extraVolumes: + - name: ca-bundle + configMap: + name: ca-bundle + extraVolumeMounts: + - name: ca-bundle + mountPath: /etc/ssl/certs/ca-certificates.crt + subPath: ca-certificates.crt + readOnly: true diff --git a/charts/sourcegraph/tests/kustomizeRender_labelOverrides.yaml b/charts/sourcegraph/tests/kustomizeRender_labelOverrides.yaml new file mode 100644 index 000000000..f1459f440 --- /dev/null +++ b/charts/sourcegraph/tests/kustomizeRender_labelOverrides.yaml @@ -0,0 +1,39 @@ +# Used by CI: the "Render charts through kustomize" GitHub Actions job +# (.github/workflows/kustomize_render.yml) renders this chart with this file +# through scripts/ci/kustomize-render.sh. +# +# The same label and annotation keys at the global and per-component levels, +# where the per-component value should win. Without deduplication, the chart +# renders the key twice in one map, which kustomize rejects. + +sourcegraph: + labels: + example.com/team: platform + podLabels: + example.com/team: platform + podAnnotations: + metrics.example.com/port: "9090" + +frontend: + labels: + example.com/team: frontend + podLabels: + example.com/team: frontend + podAnnotations: + metrics.example.com/port: "6060" + serviceLabels: + example.com/team: frontend + +gitserver: + labels: + example.com/team: source + podLabels: + example.com/team: source + podAnnotations: + metrics.example.com/port: "6060" + +indexedSearch: + labels: + example.com/team: search + podLabels: + example.com/team: search diff --git a/charts/sourcegraph/tests/kustomizeRender_selfHosted.yaml b/charts/sourcegraph/tests/kustomizeRender_selfHosted.yaml new file mode 100644 index 000000000..07eaeaeb0 --- /dev/null +++ b/charts/sourcegraph/tests/kustomizeRender_selfHosted.yaml @@ -0,0 +1,197 @@ +# Used by CI: the "Render charts through kustomize" GitHub Actions job +# (.github/workflows/kustomize_render.yml) renders this chart with this file +# through scripts/ci/kustomize-render.sh. +# +# Shaped like common self-hosted deployments: a private registry, organization +# labels and annotations at the global level, distinct per-component ones, +# scheduling constraints, restricted security contexts, external services, and +# a CA bundle. All names and endpoints are placeholders. + +sourcegraph: + image: + repository: registry.example.com/sourcegraph + useGlobalTagAsDefault: true + imagePullSecrets: + - name: registry-credentials + labels: + example.com/project: sourcegraph + example.com/environment: production + podLabels: + example.com/project: sourcegraph + example.com/environment: production + example.com/telemetry: enabled + podAnnotations: + metrics.example.com/scrape: "true" + nodeSelector: + example.com/dedicated: sourcegraph + tolerations: + - key: example.com/dedicated + operator: Equal + value: sourcegraph + effect: NoSchedule + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: example.com/capacity-type + operator: NotIn + values: [spot] + priorityClassName: sourcegraph + +storageClass: + create: true + name: sourcegraph + provisioner: ebs.csi.aws.com + type: gp3 + parameters: + encrypted: "true" + reclaimPolicy: Retain + volumeBindingMode: WaitForFirstConsumer + +pgsql: + enabled: false + auth: + existingSecret: pgsql-credentials +codeIntelDB: + enabled: false + auth: + existingSecret: codeintel-db-credentials +codeInsightsDB: + enabled: false + auth: + existingSecret: codeinsights-db-credentials + +redisCache: + enabled: false + connection: + existingSecret: redis-cache-credentials +redisStore: + enabled: false + connection: + existingSecret: redis-store-credentials + +frontend: + labels: + example.com/service: frontend + podLabels: + example.com/service: frontend + podAnnotations: + metrics.example.com/port: "6060" + traffic.sidecar.istio.io/excludeOutboundPorts: "5432,6379" + serviceLabels: + example.com/service: frontend + serviceAnnotations: + example.com/load-balancer: internal + serviceType: NodePort + serviceAccount: + annotations: + eks.amazonaws.com/role-arn: arn:aws:iam::000000000000:role/sourcegraph-frontend + ingress: + host: sourcegraph.example.com + ingressClassName: nginx + tlsSecret: sourcegraph-tls + annotations: + kubernetes.io/ingress.class: null + cert-manager.io/cluster-issuer: example-issuer + nginx.ingress.kubernetes.io/proxy-body-size: 500m + env: + HTTPS_PROXY: + value: http://proxy.example.com:3128 + NO_PROXY: + value: localhost,127.0.0.1,.svc,.cluster.local + containerSecurityContext: + allowPrivilegeEscalation: false + capabilities: + drop: [ALL] + readOnlyRootFilesystem: true + runAsNonRoot: true + runAsUser: 100 + runAsGroup: 101 + seccompProfile: + type: RuntimeDefault + podSecurityContext: + fsGroup: 101 + fsGroupChangePolicy: OnRootMismatch + extraVolumes: + - name: ca-bundle + configMap: + name: ca-bundle + extraVolumeMounts: + - name: ca-bundle + mountPath: /etc/ssl/certs/ca-certificates.crt + subPath: ca-certificates.crt + readOnly: true + extraInitContainers: + - name: example-init + image: registry.example.com/example-init:1.0.0 + command: [sh, -c, "true"] + extraServicePorts: + - name: metrics + port: 6060 + targetPort: 6060 + +gitserver: + labels: + example.com/service: gitserver + podLabels: + example.com/service: gitserver + podAnnotations: + metrics.example.com/port: "6060" + serviceAccount: + create: true + annotations: + eks.amazonaws.com/role-arn: arn:aws:iam::000000000000:role/sourcegraph-gitserver + affinity: + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchLabels: + app: gitserver + topologyKey: kubernetes.io/hostname + +worker: + labels: + example.com/service: worker + podLabels: + example.com/service: worker + env: + PRECISE_CODE_INTEL_UPLOAD_BACKEND: + value: S3 + PRECISE_CODE_INTEL_UPLOAD_BUCKET: + value: example-bucket + +searcher: + podLabels: + example.com/service: searcher + +indexedSearch: + podLabels: + example.com/service: indexed-search + affinity: + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchLabels: + app: indexed-search + topologyKey: kubernetes.io/hostname + +migrator: + env: + HTTPS_PROXY: + value: http://proxy.example.com:3128 + +prometheus: + privileged: false + +cadvisor: + enabled: false + +extraResources: + - apiVersion: networking.k8s.io/v1 + kind: NetworkPolicy + metadata: + name: sourcegraph-default-deny + spec: + podSelector: {} + policyTypes: [Ingress] diff --git a/charts/sourcegraph/tests/kustomizeRender_sourcegraphCloud.yaml b/charts/sourcegraph/tests/kustomizeRender_sourcegraphCloud.yaml new file mode 100644 index 000000000..c2ff205c0 --- /dev/null +++ b/charts/sourcegraph/tests/kustomizeRender_sourcegraphCloud.yaml @@ -0,0 +1,210 @@ +# Used by CI: the "Render charts through kustomize" GitHub Actions job +# (.github/workflows/kustomize_render.yml) renders this chart with this file +# through scripts/ci/kustomize-render.sh. +# +# Shaped like Sourcegraph Cloud: external Postgres and object storage, +# workload identity, a sidecar, per-component pod labels and annotations, and +# extra resources. All names and endpoints are placeholders. + +sourcegraph: + image: + repository: registry.example.com/sourcegraph + useGlobalTagAsDefault: true + nodeSelector: + example.com/node-pool: sourcegraph + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: example.com/node-pool + operator: In + values: [sourcegraph] + +priorityClasses: + - name: sourcegraph-high-priority + value: 1000000 + preemptionPolicy: PreemptLowerPriority + description: High priority for node-level daemons + +storageClass: + create: true + name: sourcegraph + provisioner: pd.csi.storage.gke.io + type: pd-ssd + parameters: + replication-type: regional-pd + volumeBindingMode: WaitForFirstConsumer + reclaimPolicy: Retain + allowedTopologies: + - matchLabelExpressions: + - key: topology.gke.io/zone + values: [zone-a, zone-b] + +pgsql: + enabled: false + auth: + host: "" + user: database-user + database: pgsql +codeIntelDB: + enabled: false + auth: + host: "" + user: database-user + database: codeintel-db +codeInsightsDB: + enabled: false + auth: + host: "" + user: database-user + database: codeinsights-db +blobstore: + enabled: false + +redisCache: + connection: + endpoint: rediss://10.0.0.1:6378 +redisStore: + connection: + endpoint: rediss://10.0.0.2:6379 + podAnnotations: + cluster-autoscaler.kubernetes.io/safe-to-evict: "false" + +frontend: + replicaCount: 2 + podDisruptionBudget: + minAvailable: 1 + podLabels: + app.kubernetes.io/component: frontend + podAnnotations: + prometheus.io/port: "6060" + serviceAnnotations: + cloud.google.com/neg: '{"ingress": true}' + serviceAccount: + annotations: + iam.gke.io/gcp-service-account: frontend@project-id.iam.gserviceaccount.com + ingress: + host: sourcegraph.example.com + annotations: + kubernetes.io/ingress.class: gce + nginx.ingress.kubernetes.io/proxy-body-size: null + kubernetes.io/ingress.global-static-ip-name: static-ip-name + affinity: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - weight: 100 + podAffinityTerm: + labelSelector: + matchLabels: + app: sourcegraph-frontend + topologyKey: kubernetes.io/hostname + env: + EXAMPLE_FEATURE_ENABLED: + value: "true" + EXAMPLE_SECRET: + valueFrom: + secretKeyRef: + name: example-secret + key: EXAMPLE_SECRET + extraContainers: + - name: example-sidecar + image: registry.example.com/example-sidecar:1.0.0 + volumeMounts: + - name: example-sidecar-config + mountPath: /etc/example + extraVolumes: + - name: example-sidecar-config + configMap: + name: example-sidecar-config + +gitserver: + podLabels: + app.kubernetes.io/component: gitserver + podAnnotations: + prometheus.io/port: "6060" + cluster-autoscaler.kubernetes.io/safe-to-evict: "false" + serviceAccount: + create: true + annotations: + iam.gke.io/gcp-service-account: gitserver@project-id.iam.gserviceaccount.com + storageSize: 200Gi + +worker: + podLabels: + app.kubernetes.io/component: worker + podAnnotations: + prometheus.io/port: "6060" + serviceAccount: + create: true + annotations: + iam.gke.io/gcp-service-account: worker@project-id.iam.gserviceaccount.com + +searcher: + replicaCount: 2 + podLabels: + app.kubernetes.io/component: searcher + podDisruptionBudget: + maxUnavailable: 1 + +indexedSearch: + podLabels: + app.kubernetes.io/component: indexed-search + podAnnotations: + prometheus.io/port: "6070" + serviceAccount: + create: true + annotations: + iam.gke.io/gcp-service-account: indexed-search@project-id.iam.gserviceaccount.com + +preciseCodeIntel: + podLabels: + app.kubernetes.io/component: precise-code-intel + serviceAccount: + create: true + +syntacticCodeIntel: + enabled: true + podLabels: + app.kubernetes.io/component: syntactic-code-intel + +syntectServer: + podLabels: + app.kubernetes.io/component: syntax-highlighter + +prometheus: + podAnnotations: + prometheus.io/port: "9090" + +cadvisor: + priorityClassName: sourcegraph-high-priority + tolerations: + - key: example.com/dedicated + operator: Exists + effect: NoSchedule + +openTelemetry: + enabled: true + +extraResources: + - apiVersion: v1 + kind: ConfigMap + metadata: + name: example-sidecar-config + data: + config.yaml: | + enabled: true + - apiVersion: v1 + kind: Service + metadata: + name: sourcegraph-frontend-internal-lb + annotations: + networking.gke.io/load-balancer-type: Internal + spec: + type: LoadBalancer + selector: + app: sourcegraph-frontend + ports: + - name: http + port: 80 + targetPort: 3080 diff --git a/scripts/ci/kustomize-render.sh b/scripts/ci/kustomize-render.sh new file mode 100755 index 000000000..3a0c0ccac --- /dev/null +++ b/scripts/ci/kustomize-render.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +# Render each chart with every tests/kustomizeRender_*.yaml values file, then +# run the output through kustomize. Kustomize rejects YAML that Helm accepts, +# such as a label key repeated in one map, which breaks anyone who runs +# kustomize over the chart, including Sourcegraph Cloud. + +set -eu -o pipefail + +work_directory=$(mktemp -d) +trap 'rm -rf "${work_directory}"' EXIT +printf 'resources:\n- rendered.yaml\n' >"${work_directory}/kustomization.yaml" + +failed=() +for values_file in charts/*/tests/kustomizeRender_*.yaml charts/*/*/tests/kustomizeRender_*.yaml; do + chart_directory="${values_file%/tests/*}" + echo "--- ${values_file}" + if ! helm template test "${chart_directory}" --values "${values_file}" >"${work_directory}/rendered.yaml" || + ! kubectl kustomize "${work_directory}" >/dev/null; then + failed+=("${values_file}") + fi +done + +if [ "${#failed[@]}" -ne 0 ]; then + printf "\nkustomize could not build the chart rendered with:\n" >&2 + printf " %s\n" "${failed[@]}" >&2 + exit 1 +fi From 9a6b7cafda93f8cb1c022be3f124ede8278eae17 Mon Sep 17 00:00:00 2001 From: Marc LeBlanc <7050295+marcleblanc2@users.noreply.github.com> Date: Wed, 25 Nov 2026 15:46:39 -0500 Subject: [PATCH 2/3] ci: render every chart value, and validate renders with kubeconform Add tests/kustomizeRender_allValues*.yaml for each chart. Together they set every value the templates read to a non-default value, with alternate files for either-or choices, such as existing Secrets, ingress host lists, and external services. Label and annotation keys differ at each level, so a duplicate key in these renders is a template bug. kustomize-render.sh now also validates each render with kubeconform -strict, as the Buildkite schema step does for default values, and fails on Go template output such as map[ or in the manifests. On main, these find: - sourcegraph: jaeger.serviceAccount.create fails to render - sourcegraph: openTelemetry.agent.env renders invalid YAML - sourcegraph-executor-dind: privateDockerRegistry.serviceAnnotations renders invalid YAML Amp-Thread-ID: https://ampcode.com/threads/T-01a2140d-bf64-751f-9812-0c8757baf6fd Co-authored-by: Amp --- .github/workflows/kustomize_render.yml | 11 +- .../dind/tests/kustomizeRender_allValues.yaml | 138 ++++ .../kustomizeRender_allValuesAlternate.yaml | 19 + .../k8s/tests/kustomizeRender_allValues.yaml | 132 ++++ .../kustomizeRender_allValuesAlternate.yaml | 22 + .../tests/kustomizeRender_allValues.yaml | 106 +++ .../tests/kustomizeRender_allValues.yaml | 663 ++++++++++++++++++ .../kustomizeRender_allValuesAlternate.yaml | 625 +++++++++++++++++ ...omizeRender_allValuesExternalServices.yaml | 67 ++ scripts/ci/kustomize-render.sh | 29 +- 10 files changed, 1800 insertions(+), 12 deletions(-) create mode 100644 charts/sourcegraph-executor/dind/tests/kustomizeRender_allValues.yaml create mode 100644 charts/sourcegraph-executor/dind/tests/kustomizeRender_allValuesAlternate.yaml create mode 100644 charts/sourcegraph-executor/k8s/tests/kustomizeRender_allValues.yaml create mode 100644 charts/sourcegraph-executor/k8s/tests/kustomizeRender_allValuesAlternate.yaml create mode 100644 charts/sourcegraph-migrator/tests/kustomizeRender_allValues.yaml create mode 100644 charts/sourcegraph/tests/kustomizeRender_allValues.yaml create mode 100644 charts/sourcegraph/tests/kustomizeRender_allValuesAlternate.yaml create mode 100644 charts/sourcegraph/tests/kustomizeRender_allValuesExternalServices.yaml diff --git a/.github/workflows/kustomize_render.yml b/.github/workflows/kustomize_render.yml index 3539fa107..27703a1a8 100644 --- a/.github/workflows/kustomize_render.yml +++ b/.github/workflows/kustomize_render.yml @@ -13,12 +13,13 @@ jobs: - name: Checkout uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - # Installs the Helm version in .tool-versions, the same one Buildkite uses. - # kubectl, with its built-in kustomize, comes with the runner image. - - name: Set up Helm + # Installs the Helm and kubeconform versions in .tool-versions, the same + # ones Buildkite uses. kubectl, with its built-in kustomize, comes with the + # runner image. + - name: Set up Helm and kubeconform uses: jdx/mise-action@924e7c586e33d7d4bae9c14e26c5d22e2beb6e78 # v5.3.0 with: - install_args: helm + install_args: helm kubeconform - - name: Render each chart's tests/kustomizeRender_*.yaml and build it with kustomize + - name: Render each chart's tests/kustomizeRender_*.yaml and check the output run: scripts/ci/kustomize-render.sh diff --git a/charts/sourcegraph-executor/dind/tests/kustomizeRender_allValues.yaml b/charts/sourcegraph-executor/dind/tests/kustomizeRender_allValues.yaml new file mode 100644 index 000000000..68dddb1f6 --- /dev/null +++ b/charts/sourcegraph-executor/dind/tests/kustomizeRender_allValues.yaml @@ -0,0 +1,138 @@ +# Used by CI: the "Render charts through kustomize" GitHub Actions job +# (.github/workflows/kustomize_render.yml) renders this chart with this file +# through scripts/ci/kustomize-render.sh. +# +# Sets every value the templates read to a non-default value, to catch +# templates that break or render invalid manifests when a value is used. +# kustomizeRender_allValuesAlternate.yaml covers the other side of each +# either-or choice. All names and endpoints are placeholders. + +nameOverride: example-executor + +sourcegraph: + image: + defaultTag: 1.2.3 + pullPolicy: Always + repository: registry.example.com/sourcegraph + useGlobalTagAsDefault: true + imagePullSecrets: + - name: registry-credentials + labels: + example.com/project: sourcegraph + podAnnotations: + example.com/pod-annotation: global + podLabels: + example.com/pod-label: global + priorityClassName: example-priority + nodeSelector: + example.com/dedicated: executors + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: example.com/dedicated + operator: In + values: [executors] + tolerations: + - key: example.com/dedicated + operator: Exists + effect: NoSchedule + +storageClass: + create: true + name: example-storage-class + provisioner: pd.csi.storage.gke.io + type: pd-ssd + parameters: + replication-type: regional-pd + +executor: + priorityClassName: example-executor-priority + image: + name: example-executor-image + tag: 4.5.6 + frontendUrl: https://sourcegraph.example.com + frontendExistingSecret: executor-credentials + log: + level: debug + format: condensed + maximumRuntimePerJob: 1h + maximumNumJobs: 4 + replicaCount: 2 + resources: + limits: + cpu: "4" + memory: 8Gi + requests: + cpu: "1" + memory: 2Gi + env: + EXAMPLE_VALUE: + value: example + EXAMPLE_SECRET: + valueFrom: + secretKeyRef: + name: example-secret + key: EXAMPLE_SECRET + storage: + type: ephemeral + size: 100Gi + class: example-storage-class + podSecurityContext: + fsGroup: 101 + runAsNonRoot: false + labels: + example.com/service: executor + podAnnotations: + example.com/pod-annotation-executor: executor + podLabels: + example.com/pod-label-executor: executor + +# One Deployment per queue, each overriding the executor defaults +queues: + - name: batches + queueName: batches + replicaCount: 3 + resources: + requests: + cpu: "2" + memory: 4Gi + env: + EXAMPLE_QUEUE_VALUE: + value: batches + - name: codeintel + queueNames: [codeintel, other] + +dind: + image: + registry: registry.example.com + repository: example-docker + tag: 1.0.0-dind + daemonConfig: + mtu: 1400 + registry-mirrors: + - https://mirror.example.com + gVisor: + enabled: true + daemonConfig: + storage-driver: overlay2 + +privateDockerRegistry: + enabled: true + image: + registry: registry.example.com + repository: example-registry + tag: "3.1" + storageSize: 50Gi + env: + REGISTRY_PROXY_REMOTEURL: + value: https://mirror.example.com + labels: + example.com/service: executor-registry + podAnnotations: + example.com/pod-annotation-registry: registry + podLabels: + example.com/pod-label-registry: registry + serviceAnnotations: + example.com/service-annotation: registry diff --git a/charts/sourcegraph-executor/dind/tests/kustomizeRender_allValuesAlternate.yaml b/charts/sourcegraph-executor/dind/tests/kustomizeRender_allValuesAlternate.yaml new file mode 100644 index 000000000..97a02acfc --- /dev/null +++ b/charts/sourcegraph-executor/dind/tests/kustomizeRender_allValuesAlternate.yaml @@ -0,0 +1,19 @@ +# Used by CI: the "Render charts through kustomize" GitHub Actions job +# (.github/workflows/kustomize_render.yml) renders this chart with this file +# through scripts/ci/kustomize-render.sh. +# +# The other side of each either-or choice in kustomizeRender_allValues.yaml: +# one Deployment for one queue, an inline password, a size-limited emptyDir, +# no gVisor, and no private registry. All names and endpoints are +# placeholders. + +executor: + frontendUrl: https://sourcegraph.example.com + frontendPassword: placeholder-password + queueName: batches + storage: + type: emptyDir + size: 20Gi + +privateDockerRegistry: + enabled: false diff --git a/charts/sourcegraph-executor/k8s/tests/kustomizeRender_allValues.yaml b/charts/sourcegraph-executor/k8s/tests/kustomizeRender_allValues.yaml new file mode 100644 index 000000000..f4e36557d --- /dev/null +++ b/charts/sourcegraph-executor/k8s/tests/kustomizeRender_allValues.yaml @@ -0,0 +1,132 @@ +# Used by CI: the "Render charts through kustomize" GitHub Actions job +# (.github/workflows/kustomize_render.yml) renders this chart with this file +# through scripts/ci/kustomize-render.sh. +# +# Sets every value the templates read to a non-default value, to catch +# templates that break or render invalid manifests when a value is used. +# kustomizeRender_allValuesAlternate.yaml covers the other side of each +# either-or choice. All names and endpoints are placeholders. + +nameOverride: example-executor + +sourcegraph: + image: + defaultTag: 1.2.3 + pullPolicy: Always + repository: registry.example.com/sourcegraph + useGlobalTagAsDefault: true + imagePullSecrets: + - name: registry-credentials + labels: + example.com/project: sourcegraph + podAnnotations: + example.com/pod-annotation: global + podLabels: + example.com/pod-label: global + priorityClassName: example-priority + # Documented, but the executor reads executor.nodeSelector, affinity, and tolerations + nodeSelector: + example.com/dedicated: sourcegraph + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: example.com/dedicated + operator: Exists + tolerations: + - key: example.com/dedicated + operator: Exists + effect: NoSchedule + +executor: + configureRbac: true + priorityClassName: example-executor-priority + image: + name: example-executor-image + tag: 4.5.6 + frontendUrl: https://sourcegraph.example.com + frontendPassword: placeholder-password + queueName: batches + maximumNumJobs: 4 + maximumRuntimePerJob: 1h + log: + level: debug + format: json + trace: "true" + namespace: sourcegraph-executors + kubeconfigPath: /etc/kube/config + labels: + example.com/service: executor + podAnnotations: + example.com/pod-annotation-executor: executor + podLabels: + example.com/pod-label-executor: executor + serviceAnnotations: + example.com/service-annotation: executor + serviceLabels: + example.com/service-label: executor + serviceType: NodePort + resources: + limits: + cpu: "2" + memory: 8Gi + requests: + cpu: "1" + memory: 1Gi + containerSecurityContext: + privileged: false + allowPrivilegeEscalation: false + readOnlyRootFilesystem: true + podSecurityContext: + runAsNonRoot: true + fsGroup: 1000 + kubernetesJob: + deadline: "600" + runAsUser: "1000" + runAsGroup: "1000" + fsGroup: "1000" + resources: + requests: + cpu: 500m + memory: 2Gi + limits: + cpu: "4" + memory: 16Gi + node: + name: example-node + selector: example.com/executors=true + # The template does not quote these values, so their quotes must be escaped, as values.yaml documents + tolerations: '[{\"key\":\"example.com/executors\",\"operator\":\"Equal\",\"value\":\"true\",\"effect\":\"NoSchedule\"}]' + requiredAffinityMatchExpressions: '[{\"key\":\"example.com/executors\",\"operator\":\"In\",\"values\":[\"true\"]}]' + requiredAffinityMatchFields: '[{\"key\":\"metadata.name\",\"operator\":\"In\",\"values\":[\"example-node\"]}]' + pod: + affinity: '[{\"labelSelector\":{\"matchExpressions\":[{\"key\":\"app\",\"operator\":\"In\",\"values\":[\"example\"]}]},\"topologyKey\":\"kubernetes.io/hostname\"}]' + antiAffinity: '[{\"labelSelector\":{\"matchExpressions\":[{\"key\":\"app\",\"operator\":\"In\",\"values\":[\"example\"]}]},\"topologyKey\":\"kubernetes.io/hostname\"}]' + debug: + keepJobs: "true" + keepWorkspaces: "true" + dockerAddHostGateway: "true" + nodeSelector: + example.com/executors: "true" + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: example.com/executors + operator: In + values: ["true"] + tolerations: + - key: example.com/executors + operator: Equal + value: "true" + effect: NoSchedule + extraEnv: + - name: EXAMPLE_VALUE + value: example + - name: EXAMPLE_SECRET + valueFrom: + secretKeyRef: + name: example-secret + key: EXAMPLE_SECRET diff --git a/charts/sourcegraph-executor/k8s/tests/kustomizeRender_allValuesAlternate.yaml b/charts/sourcegraph-executor/k8s/tests/kustomizeRender_allValuesAlternate.yaml new file mode 100644 index 000000000..bfc873de4 --- /dev/null +++ b/charts/sourcegraph-executor/k8s/tests/kustomizeRender_allValuesAlternate.yaml @@ -0,0 +1,22 @@ +# Used by CI: the "Render charts through kustomize" GitHub Actions job +# (.github/workflows/kustomize_render.yml) renders this chart with this file +# through scripts/ci/kustomize-render.sh. +# +# The other side of each either-or choice in kustomizeRender_allValues.yaml: +# several queues, an existing Secret, the individual securityContext values, +# no RBAC, and local development mode. All names are placeholders. + +sourcegraph: + localDevMode: true + +executor: + configureRbac: false + frontendUrl: https://sourcegraph.example.com + frontendExistingSecret: executor-credentials + queueNames: [batches, codeintel] + podSecurityContext: {} + securityContext: + runAsUser: 1000 + runAsGroup: 1000 + fsGroup: 1000 + privileged: false diff --git a/charts/sourcegraph-migrator/tests/kustomizeRender_allValues.yaml b/charts/sourcegraph-migrator/tests/kustomizeRender_allValues.yaml new file mode 100644 index 000000000..5da0a3234 --- /dev/null +++ b/charts/sourcegraph-migrator/tests/kustomizeRender_allValues.yaml @@ -0,0 +1,106 @@ +# Used by CI: the "Render charts through kustomize" GitHub Actions job +# (.github/workflows/kustomize_render.yml) renders this chart with this file +# through scripts/ci/kustomize-render.sh. +# +# Sets every value the templates read to a non-default value, to catch +# templates that break or render invalid manifests when a value is used. All +# names and endpoints are placeholders. + +nameOverride: example-migrator + +sourcegraph: + image: + defaultTag: 1.2.3 + pullPolicy: Always + repository: registry.example.com/sourcegraph + useGlobalTagAsDefault: true + imagePullSecrets: + - name: registry-credentials + labels: + example.com/project: sourcegraph + podAnnotations: + example.com/pod-annotation: global + podLabels: + example.com/pod-label: global + priorityClassName: example-priority + nodeSelector: + example.com/dedicated: sourcegraph + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: example.com/dedicated + operator: In + values: [sourcegraph] + tolerations: + - key: example.com/dedicated + operator: Equal + value: sourcegraph + effect: NoSchedule + +pgsql: + name: example-pgsql + auth: + existingSecret: pgsql-credentials +codeIntelDB: + name: example-codeintel-db + auth: + existingSecret: codeintel-db-credentials +codeInsightsDB: + name: example-codeinsights-db + auth: + existingSecret: codeinsights-db-credentials + +migrator: + name: example-migrator + priorityClassName: example-migrator-priority + image: + name: example-migrator-image + tag: 4.5.6 + args: [up, -db=frontend] + env: + EXAMPLE_VALUE: + value: example + EXAMPLE_SECRET: + valueFrom: + secretKeyRef: + name: example-secret + key: EXAMPLE_SECRET + labels: + example.com/service: migrator + podAnnotations: + example.com/pod-annotation-migrator: migrator + podLabels: + example.com/pod-label-migrator: migrator + resources: + limits: + cpu: "1" + memory: 200M + requests: + cpu: 200m + memory: 100M + containerSecurityContext: + allowPrivilegeEscalation: false + capabilities: + drop: [ALL] + readOnlyRootFilesystem: true + runAsNonRoot: true + runAsUser: 100 + runAsGroup: 101 + podSecurityContext: + fsGroup: 101 + seccompProfile: + type: RuntimeDefault + extraVolumes: + - name: ca-bundle + configMap: + name: ca-bundle + extraVolumeMounts: + - name: ca-bundle + mountPath: /etc/ssl/certs/ca-certificates.crt + subPath: ca-certificates.crt + readOnly: true + extraContainers: + - name: example-sidecar + image: registry.example.com/example-sidecar:1.0.0 diff --git a/charts/sourcegraph/tests/kustomizeRender_allValues.yaml b/charts/sourcegraph/tests/kustomizeRender_allValues.yaml new file mode 100644 index 000000000..c596600b8 --- /dev/null +++ b/charts/sourcegraph/tests/kustomizeRender_allValues.yaml @@ -0,0 +1,663 @@ +# Used by CI: the "Render charts through kustomize" GitHub Actions job +# (.github/workflows/kustomize_render.yml) renders this chart with this file +# through scripts/ci/kustomize-render.sh. +# +# Sets every value the templates read, for every component, to a non-default +# value, to catch templates that break or render invalid manifests when a value +# is used. Label and annotation keys differ at each level, so a duplicate key +# here is a template bug. kustomizeRender_allValuesAlternate.yaml covers the +# other side of each either-or choice, and +# kustomizeRender_allValuesExternalServices.yaml the external services. All +# names and endpoints are placeholders. + +# Every generic per-component value, merged into each component below. Label +# and annotation keys differ from the global ones in sourcegraph. +x-component: &component + enabled: true + image: + tag: 1.2.3-override + repository: registry.example.com/override + defaultTagPrefix: example- + labels: + example.com/component-label: component + podLabels: + example.com/component-pod-label: component + podAnnotations: + example.com/component-pod-annotation: component + serviceLabels: + example.com/component-service-label: component + serviceAnnotations: + example.com/component-service-annotation: component + serviceType: NodePort + extraServicePorts: + - name: example + port: 9999 + targetPort: 9999 + storageLabels: + example.com/component-storage-label: component + storageAnnotations: + example.com/component-storage-annotation: component + storageSize: 123Gi + storageSubPath: example-subpath + volumeName: example-pv + extraSelectorLabels: + example.com/component-selector: component + env: + EXAMPLE_VALUE: + value: example + EXAMPLE_SECRET: + valueFrom: + secretKeyRef: + name: example-secret + key: EXAMPLE_SECRET + resources: + limits: + cpu: "3" + memory: 3Gi + ephemeral-storage: 3Gi + requests: + cpu: 300m + memory: 300Mi + ephemeral-storage: 1Gi + containerSecurityContext: + capabilities: + drop: [ALL] + seccompProfile: + type: RuntimeDefault + podSecurityContext: + fsGroup: 2000 + fsGroupChangePolicy: OnRootMismatch + extraVolumes: + - name: example-extra + emptyDir: {} + extraVolumeMounts: + - name: example-extra + mountPath: /example-extra + extraContainers: + - name: example-sidecar + image: registry.example.com/example-sidecar:1.0.0 + extraInitContainers: + - name: example-init + image: registry.example.com/example-init:1.0.0 + command: [sh, -c, "true"] + serviceAccount: + create: true + annotations: + example.com/service-account-annotation: component + nodeSelector: + example.com/node-pool: component + affinity: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - weight: 100 + podAffinityTerm: + labelSelector: + matchLabels: + example.com/anti-affinity: component + topologyKey: kubernetes.io/hostname + tolerations: + - key: example.com/node-pool + operator: Equal + value: component + effect: NoSchedule + priorityClassName: component-priority + preShutdownPause: 7s + gracefulShutdownTimeout: 20s + terminationGracePeriodSeconds: 40 + podDisruptionBudget: + minAvailable: 1 + +nameOverride: example-sourcegraph +sourcegraph: + image: + defaultTag: 1.2.3 + pullPolicy: Always + repository: registry.example.com/sourcegraph + useGlobalTagAsDefault: true + imagePullSecrets: + - name: registry-credentials + labels: + example.com/global-label: global + podLabels: + example.com/global-pod-label: global + podAnnotations: + example.com/global-pod-annotation: global + serviceLabels: + example.com/global-service-label: global + nodeSelector: + example.com/node-pool: global + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: example.com/node-pool + operator: Exists + tolerations: + - key: example.com/global + operator: Exists + effect: NoSchedule + priorityClassName: global-priority + revisionHistoryLimit: 5 + preShutdownPause: 6s + gracefulShutdownTimeout: 18s + terminationGracePeriodSeconds: 35 + localDevMode: false +storageClass: + create: true + name: example-storage-class + provisioner: pd.csi.storage.gke.io + type: pd-ssd + parameters: + replication-type: regional-pd + allowedTopologies: + - matchLabelExpressions: + - key: topology.gke.io/zone + values: + - zone-a + - zone-b + annotations: + example.com/storage-class: example + allowVolumeExpansion: false + reclaimPolicy: Retain + volumeBindingMode: WaitForFirstConsumer +alpine: + containerSecurityContext: + capabilities: + drop: + - ALL +sgTestConnection: + enabled: true +priorityClasses: +- name: example-priority + value: 1000 + preemptionPolicy: Never + description: Example priority +extraResources: +- apiVersion: v1 + kind: ConfigMap + metadata: + name: example-extra + data: + key: value + +cadvisor: + <<: *component + name: example-cadvisor + serviceAccount: + create: true + name: example-cadvisor + annotations: + example.com/service-account-annotation: component + containerSecurityContext: + capabilities: + drop: + - ALL + privileged: true + +codeInsightsDB: + <<: *component + name: example-code-insights-d-b + serviceAccount: + create: true + name: example-code-insights-d-b + annotations: + example.com/service-account-annotation: component + auth: + host: code-insights-d-b.example.com + port: '6543' + user: example-user + password: placeholder-password + database: example-database + sslmode: require + additionalConfig: 'max_connections = 200 + + ' + postgresExporter: + env: + EXAMPLE_EXPORTER: + value: example + init: + containerSecurityContext: + capabilities: + drop: + - ALL + +codeIntelDB: + <<: *component + name: example-code-intel-d-b + serviceAccount: + create: true + name: example-code-intel-d-b + annotations: + example.com/service-account-annotation: component + auth: + host: code-intel-d-b.example.com + port: '6543' + user: example-user + password: placeholder-password + database: example-database + sslmode: require + additionalConfig: 'max_connections = 200 + + ' + postgresExporter: + env: + EXAMPLE_EXPORTER: + value: example + +frontend: + <<: *component + name: example-frontend + serviceAccount: + create: true + name: example-frontend + annotations: + example.com/service-account-annotation: component + replicaCount: 3 + command: + - /bin/sh + - -c + - exec /usr/local/bin/frontend serve + internalServiceType: NodePort + privileged: true + createRoleBinding: true + ingress: + enabled: true + ingressClassName: example + annotations: + kubernetes.io/ingress.class: null + example.com/ingress-annotation: example + labels: + example.com/ingress-label: example + host: sourcegraph.example.com + tlsSecret: example-tls + +migrator: + <<: *component + serviceAccount: + create: true + name: example-migrator + annotations: + example.com/service-account-annotation: component + command: + - /bin/sh + - -c + - exec /usr/local/bin/migrator up + databaseAuthOverrideEnvVars: false + +gitserver: + <<: *component + name: example-gitserver + serviceAccount: + create: true + name: example-gitserver + annotations: + example.com/service-account-annotation: component + replicaCount: 3 + sshSecret: gitserver-ssh + storageAccessModes: + - ReadWriteOncePod + +grafana: + <<: *component + name: example-grafana + serviceAccount: + create: true + name: example-grafana + annotations: + example.com/service-account-annotation: component + auth: + host: grafana-db.example.com + port: '6543' + user: example-user + password: placeholder-password + database: grafana + sslmode: require + +indexedSearch: + <<: *component + name: example-indexed-search + serviceAccount: + create: true + name: example-indexed-search + annotations: + example.com/service-account-annotation: component + replicaCount: 3 + indexerName: example-indexer + livenessProbe: + failureThreshold: 5 + initialDelaySeconds: 30 + periodSeconds: 30 + timeoutSeconds: 3 + readinessProbe: + failureThreshold: 5 + periodSeconds: 10 + timeoutSeconds: 3 + +indexedSearchIndexer: + <<: *component + serviceAccount: + create: true + name: example-indexed-search-indexer + annotations: + example.com/service-account-annotation: component + +blobstore: + <<: *component + name: example-blobstore + serviceAccount: + create: true + name: example-blobstore + annotations: + example.com/service-account-annotation: component + +openTelemetry: + <<: *component + serviceAccount: + create: true + name: example-open-telemetry + annotations: + example.com/service-account-annotation: component + gateway: + name: example-otel-gateway + args: + - --feature-gates=example + env: + EXAMPLE_OTEL: + value: gateway + extraInitContainers: + - name: otel-gateway-init + image: registry.example.com/example-init:1.0.0 + command: + - sh + - -c + - 'true' + labels: + example.com/otel-gateway-label: gateway + podLabels: + example.com/otel-gateway-pod-label: gateway + podAnnotations: + example.com/otel-gateway-pod-annotation: gateway + resources: + limits: + cpu: '2' + memory: 2Gi + requests: + cpu: 200m + memory: 200Mi + serviceAccount: + create: true + name: example-otel-gateway + annotations: + example.com/sa: gateway + containerSecurityContext: + capabilities: + drop: + - ALL + command: + - /bin/sh + - -c + - exec /bin/otelcol-sourcegraph "$@" + - -- + serviceType: NodePort + serviceLabels: + example.com/otel-gateway-service-label: gateway + serviceAnnotations: + example.com/otel-gateway-service-annotation: gateway + extraServicePorts: + - name: example + port: 9996 + targetPort: 9996 + agent: + name: example-otel-agent + args: + - --feature-gates=example + env: + EXAMPLE_OTEL: + value: agent + extraInitContainers: + - name: otel-agent-init + image: registry.example.com/example-init:1.0.0 + command: + - sh + - -c + - 'true' + labels: + example.com/otel-agent-label: agent + podLabels: + example.com/otel-agent-pod-label: agent + podAnnotations: + example.com/otel-agent-pod-annotation: agent + resources: + limits: + cpu: '2' + memory: 2Gi + requests: + cpu: 200m + memory: 200Mi + serviceAccount: + create: true + name: example-otel-agent + annotations: + example.com/sa: agent + containerSecurityContext: + capabilities: + drop: + - ALL + kind: DaemonSet + hostPorts: + grpcOtlp: 14317 + httpOtlp: 14318 + httpZpages: 15679 + +nodeExporter: + <<: *component + name: example-node-exporter + serviceAccount: + create: true + name: example-node-exporter + annotations: + example.com/service-account-annotation: component + hostPID: true + extraArgs: + - --collector.example + +pgsql: + <<: *component + name: example-pgsql + serviceAccount: + create: true + name: example-pgsql + annotations: + example.com/service-account-annotation: component + auth: + host: pgsql.example.com + port: '6543' + user: example-user + password: placeholder-password + database: example-database + sslmode: require + additionalConfig: 'max_connections = 200 + + ' + postgresExporter: + env: + EXAMPLE_EXPORTER: + value: example + +postgresExporter: + <<: *component + serviceAccount: + create: true + name: example-postgres-exporter + annotations: + example.com/service-account-annotation: component + +syntacticCodeIntel: + <<: *component + name: example-syntactic-code-intel + serviceAccount: + create: true + name: example-syntactic-code-intel + annotations: + example.com/service-account-annotation: component + replicaCount: 3 + storageType: pvc + storageClassName: example-storage-class + containerSecurityContext: + capabilities: + drop: + - ALL + runAsGroup: 202 + +preciseCodeIntel: + <<: *component + name: example-precise-code-intel + serviceAccount: + create: true + name: example-precise-code-intel + annotations: + example.com/service-account-annotation: component + replicaCount: 3 + storageType: pvc + storageClassName: example-storage-class + containerSecurityContext: + capabilities: + drop: + - ALL + runAsGroup: 202 + +prometheus: + <<: *component + name: example-prometheus + serviceAccount: + create: true + name: example-prometheus + annotations: + example.com/service-account-annotation: component + privileged: true + createRoleBinding: true + +redisCache: + <<: *component + name: example-redis-cache + serviceAccount: + create: true + name: example-redis-cache + annotations: + example.com/service-account-annotation: component + config: + enabled: true + additionalConfig: 'timeout 300 + + ' + connection: + endpoint: redis-cache.example.com:6380 + +redisExporter: + <<: *component + serviceAccount: + create: true + name: example-redis-exporter + annotations: + example.com/service-account-annotation: component + +redisStore: + <<: *component + name: example-redis-store + serviceAccount: + create: true + name: example-redis-store + annotations: + example.com/service-account-annotation: component + config: + enabled: true + additionalConfig: 'timeout 300 + + ' + connection: + endpoint: redis-store.example.com:6380 + +searcher: + <<: *component + name: example-searcher + serviceAccount: + create: true + name: example-searcher + annotations: + example.com/service-account-annotation: component + replicaCount: 3 + autoCacheSize: false + +syntectServer: + <<: *component + name: example-syntect-server + serviceAccount: + create: true + name: example-syntect-server + annotations: + example.com/service-account-annotation: component + replicaCount: 3 + +jaeger: + <<: *component + name: example-jaeger + serviceAccount: + create: true + name: example-jaeger + annotations: + example.com/service-account-annotation: component + replicaCount: 3 + args: + - --config=/etc/jaeger/jaeger-config.yaml + - --example-flag + collector: + name: example-jaeger-collector + serviceType: NodePort + serviceLabels: + example.com/jaeger-collector-label: collector + serviceAnnotations: + example.com/jaeger-collector-annotation: collector + extraServicePorts: + - name: example + port: 9998 + targetPort: 9998 + query: + name: example-jaeger-query + serviceType: NodePort + serviceLabels: + example.com/jaeger-query-label: query + serviceAnnotations: + example.com/jaeger-query-annotation: query + extraServicePorts: + - name: example + port: 9997 + targetPort: 9997 + config: + logLevel: debug + maxTraces: 1000 + samplingDefaultProbability: 0.5 + +worker: + <<: *component + name: example-worker + serviceAccount: + create: true + name: example-worker + annotations: + example.com/service-account-annotation: component + replicaCount: 3 + replicas: + - jobs: + - codeintel-upload-janitor + replicaCount: 2 + resources: + requests: + cpu: '1' + memory: 1Gi + - jobs: + - insights-job + blocklist: + - example-job + diff --git a/charts/sourcegraph/tests/kustomizeRender_allValuesAlternate.yaml b/charts/sourcegraph/tests/kustomizeRender_allValuesAlternate.yaml new file mode 100644 index 000000000..77d45d6ff --- /dev/null +++ b/charts/sourcegraph/tests/kustomizeRender_allValuesAlternate.yaml @@ -0,0 +1,625 @@ +# Used by CI: the "Render charts through kustomize" GitHub Actions job +# (.github/workflows/kustomize_render.yml) renders this chart with this file +# through scripts/ci/kustomize-render.sh. +# +# The other side of each either-or choice in kustomizeRender_allValues.yaml: +# local development mode, selector label overrides, +# existing Secrets and ConfigMaps, ingress hosts and TLS lists, no RBAC, an +# existing StorageClass, emptyDir caches, and the otel-agent as a Deployment. +# All names and endpoints are placeholders. + +# Every generic per-component value, merged into each component below. Label +# and annotation keys differ from the global ones in sourcegraph. +x-component: &component + enabled: true + image: + tag: 1.2.3-override + repository: registry.example.com/override + defaultTagPrefix: example- + labels: + example.com/component-label: component + podLabels: + example.com/component-pod-label: component + podAnnotations: + example.com/component-pod-annotation: component + serviceLabels: + example.com/component-service-label: component + serviceAnnotations: + example.com/component-service-annotation: component + serviceType: LoadBalancer + extraServicePorts: + - name: example + port: 9999 + targetPort: 9999 + storageLabels: + example.com/component-storage-label: component + storageAnnotations: + example.com/component-storage-annotation: component + storageSize: 123Gi + storageSubPath: example-subpath + volumeName: example-pv + extraSelectorLabels: + example.com/component-selector: component + env: + EXAMPLE_VALUE: + value: example + EXAMPLE_SECRET: + valueFrom: + secretKeyRef: + name: example-secret + key: EXAMPLE_SECRET + resources: + limits: + cpu: "3" + memory: 3Gi + ephemeral-storage: 3Gi + requests: + cpu: 300m + memory: 300Mi + ephemeral-storage: 1Gi + containerSecurityContext: + capabilities: + drop: [ALL] + seccompProfile: + type: RuntimeDefault + podSecurityContext: + fsGroup: 2000 + fsGroupChangePolicy: OnRootMismatch + extraVolumes: + - name: example-extra + emptyDir: {} + extraVolumeMounts: + - name: example-extra + mountPath: /example-extra + extraContainers: + - name: example-sidecar + image: registry.example.com/example-sidecar:1.0.0 + extraInitContainers: + - name: example-init + image: registry.example.com/example-init:1.0.0 + command: [sh, -c, "true"] + serviceAccount: + create: true + annotations: + example.com/service-account-annotation: component + nodeSelector: + example.com/node-pool: component + affinity: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - weight: 100 + podAffinityTerm: + labelSelector: + matchLabels: + example.com/anti-affinity: component + topologyKey: kubernetes.io/hostname + tolerations: + - key: example.com/node-pool + operator: Equal + value: component + effect: NoSchedule + priorityClassName: component-priority + preShutdownPause: 7s + gracefulShutdownTimeout: 20s + terminationGracePeriodSeconds: 40 + podDisruptionBudget: + maxUnavailable: 1 + +nameOverride: example-sourcegraph +sourcegraph: + image: + defaultTag: 1.2.3 + pullPolicy: Always + repository: registry.example.com/sourcegraph + useGlobalTagAsDefault: true + imagePullSecrets: + - name: registry-credentials + labels: + example.com/global-label: global + podLabels: + example.com/global-pod-label: global + podAnnotations: + example.com/global-pod-annotation: global + serviceLabels: + example.com/global-service-label: global + nodeSelector: + example.com/node-pool: global + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: example.com/node-pool + operator: Exists + tolerations: + - key: example.com/global + operator: Exists + effect: NoSchedule + priorityClassName: global-priority + revisionHistoryLimit: 5 + preShutdownPause: 6s + gracefulShutdownTimeout: 18s + terminationGracePeriodSeconds: 35 + localDevMode: true + selectorLabelsOverride: + example.com/installation: example + example.com/project: sourcegraph +storageClass: + create: false + name: example-existing +alpine: + containerSecurityContext: + capabilities: + drop: + - ALL +sgTestConnection: + enabled: true +priorityClasses: +- name: example-priority + value: 1000 + preemptionPolicy: Never + description: Example priority +extraResources: +- apiVersion: v1 + kind: ConfigMap + metadata: + name: example-extra + data: + key: value + +cadvisor: + <<: *component + name: example-cadvisor + serviceAccount: + create: true + name: example-cadvisor + annotations: + example.com/service-account-annotation: component + containerSecurityContext: + capabilities: + drop: + - ALL + privileged: false + +codeInsightsDB: + <<: *component + name: example-code-insights-d-b + serviceAccount: + create: true + name: example-code-insights-d-b + annotations: + example.com/service-account-annotation: component + auth: + existingSecret: code-insights-d-b-credentials + existingConfig: code-insights-d-b-config + postgresExporter: + env: + EXAMPLE_EXPORTER: + value: example + init: + containerSecurityContext: + capabilities: + drop: + - ALL + +codeIntelDB: + <<: *component + name: example-code-intel-d-b + serviceAccount: + create: true + name: example-code-intel-d-b + annotations: + example.com/service-account-annotation: component + auth: + existingSecret: code-intel-d-b-credentials + existingConfig: code-intel-d-b-config + postgresExporter: + env: + EXAMPLE_EXPORTER: + value: example + +frontend: + <<: *component + name: example-frontend + serviceAccount: + create: true + name: example-frontend + annotations: + example.com/service-account-annotation: component + replicaCount: 3 + command: + - /bin/sh + - -c + - exec /usr/local/bin/frontend serve + internalServiceType: NodePort + privileged: false + createRoleBinding: false + ingress: + enabled: true + ingressClassName: example + annotations: + kubernetes.io/ingress.class: null + example.com/ingress-annotation: example + labels: + example.com/ingress-label: example + hosts: + - host: sourcegraph.example.com + - host: code.example.com + tls: + - hosts: + - sourcegraph.example.com + - code.example.com + secretName: example-tls + +migrator: + <<: *component + serviceAccount: + create: true + name: example-migrator + annotations: + example.com/service-account-annotation: component + command: + - /bin/sh + - -c + - exec /usr/local/bin/migrator up + databaseAuthOverrideEnvVars: true + +gitserver: + <<: *component + name: example-gitserver + serviceAccount: + create: true + name: example-gitserver + annotations: + example.com/service-account-annotation: component + replicaCount: 3 + sshSecret: gitserver-ssh + storageAccessModes: + - ReadWriteOncePod + +grafana: + <<: *component + name: example-grafana + serviceAccount: + create: true + name: example-grafana + annotations: + example.com/service-account-annotation: component + auth: + existingSecret: grafana-credentials + existingConfig: grafana-config + +indexedSearch: + <<: *component + name: example-indexed-search + serviceAccount: + create: true + name: example-indexed-search + annotations: + example.com/service-account-annotation: component + replicaCount: 3 + indexerName: example-indexer + livenessProbe: + failureThreshold: 5 + initialDelaySeconds: 30 + periodSeconds: 30 + timeoutSeconds: 3 + readinessProbe: + failureThreshold: 5 + periodSeconds: 10 + timeoutSeconds: 3 + +indexedSearchIndexer: + <<: *component + serviceAccount: + create: true + name: example-indexed-search-indexer + annotations: + example.com/service-account-annotation: component + +blobstore: + <<: *component + name: example-blobstore + serviceAccount: + create: true + name: example-blobstore + annotations: + example.com/service-account-annotation: component + +openTelemetry: + <<: *component + serviceAccount: + create: true + name: example-open-telemetry + annotations: + example.com/service-account-annotation: component + gateway: + name: example-otel-gateway + args: + - --feature-gates=example + env: + EXAMPLE_OTEL: + value: gateway + extraInitContainers: + - name: otel-gateway-init + image: registry.example.com/example-init:1.0.0 + command: + - sh + - -c + - 'true' + labels: + example.com/otel-gateway-label: gateway + podLabels: + example.com/otel-gateway-pod-label: gateway + podAnnotations: + example.com/otel-gateway-pod-annotation: gateway + resources: + limits: + cpu: '2' + memory: 2Gi + requests: + cpu: 200m + memory: 200Mi + serviceAccount: + create: true + name: example-otel-gateway + annotations: + example.com/sa: gateway + containerSecurityContext: + capabilities: + drop: + - ALL + command: + - /bin/sh + - -c + - exec /bin/otelcol-sourcegraph "$@" + - -- + serviceType: NodePort + serviceLabels: + example.com/otel-gateway-service-label: gateway + serviceAnnotations: + example.com/otel-gateway-service-annotation: gateway + extraServicePorts: + - name: example + port: 9996 + targetPort: 9996 + agent: + name: example-otel-agent + args: + - --feature-gates=example + env: + EXAMPLE_OTEL: + value: agent + extraInitContainers: + - name: otel-agent-init + image: registry.example.com/example-init:1.0.0 + command: + - sh + - -c + - 'true' + labels: + example.com/otel-agent-label: agent + podLabels: + example.com/otel-agent-pod-label: agent + podAnnotations: + example.com/otel-agent-pod-annotation: agent + resources: + limits: + cpu: '2' + memory: 2Gi + requests: + cpu: 200m + memory: 200Mi + serviceAccount: + create: true + name: example-otel-agent + annotations: + example.com/sa: agent + containerSecurityContext: + capabilities: + drop: + - ALL + kind: Deployment + hostPorts: + grpcOtlp: 14317 + httpOtlp: 14318 + httpZpages: 15679 + +nodeExporter: + <<: *component + name: example-node-exporter + serviceAccount: + create: true + name: example-node-exporter + annotations: + example.com/service-account-annotation: component + hostPID: false + extraArgs: + - --collector.example + +pgsql: + <<: *component + name: example-pgsql + serviceAccount: + create: true + name: example-pgsql + annotations: + example.com/service-account-annotation: component + auth: + existingSecret: pgsql-credentials + existingConfig: pgsql-config + postgresExporter: + env: + EXAMPLE_EXPORTER: + value: example + +postgresExporter: + <<: *component + serviceAccount: + create: true + name: example-postgres-exporter + annotations: + example.com/service-account-annotation: component + +syntacticCodeIntel: + <<: *component + name: example-syntactic-code-intel + serviceAccount: + create: true + name: example-syntactic-code-intel + annotations: + example.com/service-account-annotation: component + replicaCount: 3 + storageType: emptyDir + storageClassName: example-storage-class + containerSecurityContext: + capabilities: + drop: + - ALL + runAsGroup: 202 + +preciseCodeIntel: + <<: *component + name: example-precise-code-intel + serviceAccount: + create: true + name: example-precise-code-intel + annotations: + example.com/service-account-annotation: component + replicaCount: 3 + storageType: emptyDir + storageClassName: example-storage-class + containerSecurityContext: + capabilities: + drop: + - ALL + runAsGroup: 202 + +prometheus: + <<: *component + name: example-prometheus + serviceAccount: + create: true + name: example-prometheus + annotations: + example.com/service-account-annotation: component + privileged: false + createRoleBinding: false + existingConfig: prometheus-config + +redisCache: + <<: *component + name: example-redis-cache + serviceAccount: + create: true + name: example-redis-cache + annotations: + example.com/service-account-annotation: component + config: + enabled: true + existingConfig: redis-cache-config + connection: + existingSecret: redis-cache-credentials + +redisExporter: + <<: *component + serviceAccount: + create: true + name: example-redis-exporter + annotations: + example.com/service-account-annotation: component + +redisStore: + <<: *component + name: example-redis-store + serviceAccount: + create: true + name: example-redis-store + annotations: + example.com/service-account-annotation: component + config: + enabled: true + existingConfig: redis-store-config + connection: + existingSecret: redis-store-credentials + +searcher: + <<: *component + name: example-searcher + serviceAccount: + create: true + name: example-searcher + annotations: + example.com/service-account-annotation: component + replicaCount: 3 + autoCacheSize: true + +syntectServer: + <<: *component + name: example-syntect-server + serviceAccount: + create: true + name: example-syntect-server + annotations: + example.com/service-account-annotation: component + replicaCount: 3 + +jaeger: + <<: *component + name: example-jaeger + serviceAccount: + create: true + name: example-jaeger + annotations: + example.com/service-account-annotation: component + replicaCount: 3 + args: + - --config=/etc/jaeger/jaeger-config.yaml + - --example-flag + collector: + name: example-jaeger-collector + serviceType: NodePort + serviceLabels: + example.com/jaeger-collector-label: collector + serviceAnnotations: + example.com/jaeger-collector-annotation: collector + extraServicePorts: + - name: example + port: 9998 + targetPort: 9998 + query: + name: example-jaeger-query + serviceType: NodePort + serviceLabels: + example.com/jaeger-query-label: query + serviceAnnotations: + example.com/jaeger-query-annotation: query + extraServicePorts: + - name: example + port: 9997 + targetPort: 9997 + config: + existingConfigMap: jaeger-config + +worker: + <<: *component + name: example-worker + serviceAccount: + create: true + name: example-worker + annotations: + example.com/service-account-annotation: component + replicaCount: 3 + replicas: + - jobs: + - codeintel-upload-janitor + replicaCount: 2 + resources: + requests: + cpu: '1' + memory: 1Gi + - jobs: + - insights-job + blocklist: + - example-job + diff --git a/charts/sourcegraph/tests/kustomizeRender_allValuesExternalServices.yaml b/charts/sourcegraph/tests/kustomizeRender_allValuesExternalServices.yaml new file mode 100644 index 000000000..042c4751f --- /dev/null +++ b/charts/sourcegraph/tests/kustomizeRender_allValuesExternalServices.yaml @@ -0,0 +1,67 @@ +# Used by CI: the "Render charts through kustomize" GitHub Actions job +# (.github/workflows/kustomize_render.yml) renders this chart with this file +# through scripts/ci/kustomize-render.sh. +# +# External Postgres databases, Redis instances, object storage, and trace +# backend in place of the bundled ones, with no Kubernetes Secrets. All names +# and endpoints are placeholders. + +sourcegraph: + disableKubernetesSecrets: true +pgsql: + enabled: false + auth: + host: pgsql.example.com + port: '5432' + user: example-user + password: placeholder-password + database: example-database + sslmode: verify-full +codeIntelDB: + enabled: false + auth: + host: code-intel-d-b.example.com + port: '5432' + user: example-user + password: placeholder-password + database: example-database + sslmode: verify-full +codeInsightsDB: + enabled: false + auth: + host: code-insights-d-b.example.com + port: '5432' + user: example-user + password: placeholder-password + database: example-database + sslmode: verify-full +redisCache: + enabled: false + connection: + endpoint: rediss://redis-cache.example.com:6380 +redisStore: + enabled: false + connection: + endpoint: rediss://redis-store.example.com:6380 +blobstore: + enabled: false +jaeger: + enabled: false +openTelemetry: + gateway: + config: + traces: + exporters: + otlp: + endpoint: otlp.example.com:4317 + tls: + ca_file: /tls/ca.pem + exportersTlsSecretName: otel-exporter-tls + processors: + batch: + timeout: 5s + probabilistic_sampler: + sampling_percentage: 50 + tracePipelineProcessors: + - probabilistic_sampler + - batch diff --git a/scripts/ci/kustomize-render.sh b/scripts/ci/kustomize-render.sh index 3a0c0ccac..7c97450be 100755 --- a/scripts/ci/kustomize-render.sh +++ b/scripts/ci/kustomize-render.sh @@ -1,28 +1,43 @@ #!/bin/bash # Render each chart with every tests/kustomizeRender_*.yaml values file, then -# run the output through kustomize. Kustomize rejects YAML that Helm accepts, -# such as a label key repeated in one map, which breaks anyone who runs -# kustomize over the chart, including Sourcegraph Cloud. +# check the output three ways: +# - kubeconform validates it against the Kubernetes schemas, which catches +# templates that render a value in the wrong place or with the wrong type +# - grep finds Go template output that never belongs in a manifest, such as a +# map or list printed where a string was expected +# - kustomize builds it, which rejects YAML that Helm accepts, such as a label +# key repeated in one map, and breaks anyone who runs kustomize over the +# chart, including Sourcegraph Cloud set -eu -o pipefail work_directory=$(mktemp -d) trap 'rm -rf "${work_directory}"' EXIT +rendered="${work_directory}/rendered.yaml" printf 'resources:\n- rendered.yaml\n' >"${work_directory}/kustomization.yaml" failed=() for values_file in charts/*/tests/kustomizeRender_*.yaml charts/*/*/tests/kustomizeRender_*.yaml; do chart_directory="${values_file%/tests/*}" echo "--- ${values_file}" - if ! helm template test "${chart_directory}" --values "${values_file}" >"${work_directory}/rendered.yaml" || - ! kubectl kustomize "${work_directory}" >/dev/null; then - failed+=("${values_file}") + if ! helm template test "${chart_directory}" --values "${values_file}" >"${rendered}"; then + failed+=("${values_file}: helm template") + continue + fi + if ! kubeconform -strict -summary -ignore-missing-schemas "${rendered}"; then + failed+=("${values_file}: kubeconform") + fi + if grep -nE 'map\[|%!|' "${rendered}"; then + failed+=("${values_file}: Go template output in the manifests") + fi + if ! kubectl kustomize "${work_directory}" >/dev/null; then + failed+=("${values_file}: kustomize") fi done if [ "${#failed[@]}" -ne 0 ]; then - printf "\nkustomize could not build the chart rendered with:\n" >&2 + printf "\nThese checks failed:\n" >&2 printf " %s\n" "${failed[@]}" >&2 exit 1 fi From c802ece38875c595b62a3bafdfda31a14d58f1d5 Mon Sep 17 00:00:00 2001 From: Marc LeBlanc <7050295+marcleblanc2@users.noreply.github.com> Date: Wed, 25 Nov 2026 16:08:44 -0500 Subject: [PATCH 3/3] ci: skip Checkov's secret check on placeholder values in test values files Checkov's CKV_SECRET_6 flags the placeholder Secret names and passwords in tests/kustomizeRender_*.yaml. They are not secrets, so skip the check on those lines, the way alert 347 on frontendIngress_test.yaml was dismissed as used in tests. Amp-Thread-ID: https://ampcode.com/threads/T-01a2140d-bf64-751f-9812-0c8757baf6fd Co-authored-by: Amp --- .../dind/tests/kustomizeRender_allValues.yaml | 2 +- .../kustomizeRender_allValuesAlternate.yaml | 2 +- .../dind/tests/kustomizeRender_selfHosted.yaml | 2 +- .../k8s/tests/kustomizeRender_allValues.yaml | 2 +- .../kustomizeRender_allValuesAlternate.yaml | 2 +- .../k8s/tests/kustomizeRender_selfHosted.yaml | 2 +- .../tests/kustomizeRender_allValues.yaml | 6 +++--- .../tests/kustomizeRender_selfHosted.yaml | 6 +++--- .../tests/kustomizeRender_allValues.yaml | 12 ++++++------ .../kustomizeRender_allValuesAlternate.yaml | 16 ++++++++-------- ...ustomizeRender_allValuesExternalServices.yaml | 8 ++++---- .../tests/kustomizeRender_selfHosted.yaml | 12 ++++++------ 12 files changed, 36 insertions(+), 36 deletions(-) diff --git a/charts/sourcegraph-executor/dind/tests/kustomizeRender_allValues.yaml b/charts/sourcegraph-executor/dind/tests/kustomizeRender_allValues.yaml index 68dddb1f6..a29e0e4ed 100644 --- a/charts/sourcegraph-executor/dind/tests/kustomizeRender_allValues.yaml +++ b/charts/sourcegraph-executor/dind/tests/kustomizeRender_allValues.yaml @@ -53,7 +53,7 @@ executor: name: example-executor-image tag: 4.5.6 frontendUrl: https://sourcegraph.example.com - frontendExistingSecret: executor-credentials + frontendExistingSecret: executor-credentials # checkov:skip=CKV_SECRET_6: placeholder in test values log: level: debug format: condensed diff --git a/charts/sourcegraph-executor/dind/tests/kustomizeRender_allValuesAlternate.yaml b/charts/sourcegraph-executor/dind/tests/kustomizeRender_allValuesAlternate.yaml index 97a02acfc..3f5221f3b 100644 --- a/charts/sourcegraph-executor/dind/tests/kustomizeRender_allValuesAlternate.yaml +++ b/charts/sourcegraph-executor/dind/tests/kustomizeRender_allValuesAlternate.yaml @@ -9,7 +9,7 @@ executor: frontendUrl: https://sourcegraph.example.com - frontendPassword: placeholder-password + frontendPassword: placeholder-password # checkov:skip=CKV_SECRET_6: placeholder in test values queueName: batches storage: type: emptyDir diff --git a/charts/sourcegraph-executor/dind/tests/kustomizeRender_selfHosted.yaml b/charts/sourcegraph-executor/dind/tests/kustomizeRender_selfHosted.yaml index 9c0906a75..c74d4e292 100644 --- a/charts/sourcegraph-executor/dind/tests/kustomizeRender_selfHosted.yaml +++ b/charts/sourcegraph-executor/dind/tests/kustomizeRender_selfHosted.yaml @@ -30,7 +30,7 @@ storageClass: executor: frontendUrl: https://sourcegraph.example.com - frontendExistingSecret: executor-credentials + frontendExistingSecret: executor-credentials # checkov:skip=CKV_SECRET_6: placeholder in test values queueNames: [batches, codeintel] labels: example.com/service: executor diff --git a/charts/sourcegraph-executor/k8s/tests/kustomizeRender_allValues.yaml b/charts/sourcegraph-executor/k8s/tests/kustomizeRender_allValues.yaml index f4e36557d..8bebae686 100644 --- a/charts/sourcegraph-executor/k8s/tests/kustomizeRender_allValues.yaml +++ b/charts/sourcegraph-executor/k8s/tests/kustomizeRender_allValues.yaml @@ -46,7 +46,7 @@ executor: name: example-executor-image tag: 4.5.6 frontendUrl: https://sourcegraph.example.com - frontendPassword: placeholder-password + frontendPassword: placeholder-password # checkov:skip=CKV_SECRET_6: placeholder in test values queueName: batches maximumNumJobs: 4 maximumRuntimePerJob: 1h diff --git a/charts/sourcegraph-executor/k8s/tests/kustomizeRender_allValuesAlternate.yaml b/charts/sourcegraph-executor/k8s/tests/kustomizeRender_allValuesAlternate.yaml index bfc873de4..7bf647e97 100644 --- a/charts/sourcegraph-executor/k8s/tests/kustomizeRender_allValuesAlternate.yaml +++ b/charts/sourcegraph-executor/k8s/tests/kustomizeRender_allValuesAlternate.yaml @@ -12,7 +12,7 @@ sourcegraph: executor: configureRbac: false frontendUrl: https://sourcegraph.example.com - frontendExistingSecret: executor-credentials + frontendExistingSecret: executor-credentials # checkov:skip=CKV_SECRET_6: placeholder in test values queueNames: [batches, codeintel] podSecurityContext: {} securityContext: diff --git a/charts/sourcegraph-executor/k8s/tests/kustomizeRender_selfHosted.yaml b/charts/sourcegraph-executor/k8s/tests/kustomizeRender_selfHosted.yaml index 98034ad96..71e9454ef 100644 --- a/charts/sourcegraph-executor/k8s/tests/kustomizeRender_selfHosted.yaml +++ b/charts/sourcegraph-executor/k8s/tests/kustomizeRender_selfHosted.yaml @@ -18,7 +18,7 @@ sourcegraph: executor: frontendUrl: https://sourcegraph.example.com - frontendPassword: placeholder-password + frontendPassword: placeholder-password # checkov:skip=CKV_SECRET_6: placeholder in test values queueName: batches namespace: sourcegraph-executors labels: diff --git a/charts/sourcegraph-migrator/tests/kustomizeRender_allValues.yaml b/charts/sourcegraph-migrator/tests/kustomizeRender_allValues.yaml index 5da0a3234..7a8eb9853 100644 --- a/charts/sourcegraph-migrator/tests/kustomizeRender_allValues.yaml +++ b/charts/sourcegraph-migrator/tests/kustomizeRender_allValues.yaml @@ -42,15 +42,15 @@ sourcegraph: pgsql: name: example-pgsql auth: - existingSecret: pgsql-credentials + existingSecret: pgsql-credentials # checkov:skip=CKV_SECRET_6: placeholder in test values codeIntelDB: name: example-codeintel-db auth: - existingSecret: codeintel-db-credentials + existingSecret: codeintel-db-credentials # checkov:skip=CKV_SECRET_6: placeholder in test values codeInsightsDB: name: example-codeinsights-db auth: - existingSecret: codeinsights-db-credentials + existingSecret: codeinsights-db-credentials # checkov:skip=CKV_SECRET_6: placeholder in test values migrator: name: example-migrator diff --git a/charts/sourcegraph-migrator/tests/kustomizeRender_selfHosted.yaml b/charts/sourcegraph-migrator/tests/kustomizeRender_selfHosted.yaml index f36486467..800f48b2e 100644 --- a/charts/sourcegraph-migrator/tests/kustomizeRender_selfHosted.yaml +++ b/charts/sourcegraph-migrator/tests/kustomizeRender_selfHosted.yaml @@ -27,13 +27,13 @@ sourcegraph: pgsql: auth: - existingSecret: pgsql-credentials + existingSecret: pgsql-credentials # checkov:skip=CKV_SECRET_6: placeholder in test values codeIntelDB: auth: - existingSecret: codeintel-db-credentials + existingSecret: codeintel-db-credentials # checkov:skip=CKV_SECRET_6: placeholder in test values codeInsightsDB: auth: - existingSecret: codeinsights-db-credentials + existingSecret: codeinsights-db-credentials # checkov:skip=CKV_SECRET_6: placeholder in test values migrator: labels: diff --git a/charts/sourcegraph/tests/kustomizeRender_allValues.yaml b/charts/sourcegraph/tests/kustomizeRender_allValues.yaml index c596600b8..f22ad3e5a 100644 --- a/charts/sourcegraph/tests/kustomizeRender_allValues.yaml +++ b/charts/sourcegraph/tests/kustomizeRender_allValues.yaml @@ -207,7 +207,7 @@ codeInsightsDB: host: code-insights-d-b.example.com port: '6543' user: example-user - password: placeholder-password + password: placeholder-password # checkov:skip=CKV_SECRET_6: placeholder in test values database: example-database sslmode: require additionalConfig: 'max_connections = 200 @@ -235,7 +235,7 @@ codeIntelDB: host: code-intel-d-b.example.com port: '6543' user: example-user - password: placeholder-password + password: placeholder-password # checkov:skip=CKV_SECRET_6: placeholder in test values database: example-database sslmode: require additionalConfig: 'max_connections = 200 @@ -271,7 +271,7 @@ frontend: labels: example.com/ingress-label: example host: sourcegraph.example.com - tlsSecret: example-tls + tlsSecret: example-tls # checkov:skip=CKV_SECRET_6: placeholder in test values migrator: <<: *component @@ -295,7 +295,7 @@ gitserver: annotations: example.com/service-account-annotation: component replicaCount: 3 - sshSecret: gitserver-ssh + sshSecret: gitserver-ssh # checkov:skip=CKV_SECRET_6: placeholder in test values storageAccessModes: - ReadWriteOncePod @@ -311,7 +311,7 @@ grafana: host: grafana-db.example.com port: '6543' user: example-user - password: placeholder-password + password: placeholder-password # checkov:skip=CKV_SECRET_6: placeholder in test values database: grafana sslmode: require @@ -475,7 +475,7 @@ pgsql: host: pgsql.example.com port: '6543' user: example-user - password: placeholder-password + password: placeholder-password # checkov:skip=CKV_SECRET_6: placeholder in test values database: example-database sslmode: require additionalConfig: 'max_connections = 200 diff --git a/charts/sourcegraph/tests/kustomizeRender_allValuesAlternate.yaml b/charts/sourcegraph/tests/kustomizeRender_allValuesAlternate.yaml index 77d45d6ff..4cbb42a57 100644 --- a/charts/sourcegraph/tests/kustomizeRender_allValuesAlternate.yaml +++ b/charts/sourcegraph/tests/kustomizeRender_allValuesAlternate.yaml @@ -190,7 +190,7 @@ codeInsightsDB: annotations: example.com/service-account-annotation: component auth: - existingSecret: code-insights-d-b-credentials + existingSecret: code-insights-d-b-credentials # checkov:skip=CKV_SECRET_6: placeholder in test values existingConfig: code-insights-d-b-config postgresExporter: env: @@ -211,7 +211,7 @@ codeIntelDB: annotations: example.com/service-account-annotation: component auth: - existingSecret: code-intel-d-b-credentials + existingSecret: code-intel-d-b-credentials # checkov:skip=CKV_SECRET_6: placeholder in test values existingConfig: code-intel-d-b-config postgresExporter: env: @@ -249,7 +249,7 @@ frontend: - hosts: - sourcegraph.example.com - code.example.com - secretName: example-tls + secretName: example-tls # checkov:skip=CKV_SECRET_6: placeholder in test values migrator: <<: *component @@ -273,7 +273,7 @@ gitserver: annotations: example.com/service-account-annotation: component replicaCount: 3 - sshSecret: gitserver-ssh + sshSecret: gitserver-ssh # checkov:skip=CKV_SECRET_6: placeholder in test values storageAccessModes: - ReadWriteOncePod @@ -286,7 +286,7 @@ grafana: annotations: example.com/service-account-annotation: component auth: - existingSecret: grafana-credentials + existingSecret: grafana-credentials # checkov:skip=CKV_SECRET_6: placeholder in test values existingConfig: grafana-config indexedSearch: @@ -446,7 +446,7 @@ pgsql: annotations: example.com/service-account-annotation: component auth: - existingSecret: pgsql-credentials + existingSecret: pgsql-credentials # checkov:skip=CKV_SECRET_6: placeholder in test values existingConfig: pgsql-config postgresExporter: env: @@ -519,7 +519,7 @@ redisCache: enabled: true existingConfig: redis-cache-config connection: - existingSecret: redis-cache-credentials + existingSecret: redis-cache-credentials # checkov:skip=CKV_SECRET_6: placeholder in test values redisExporter: <<: *component @@ -541,7 +541,7 @@ redisStore: enabled: true existingConfig: redis-store-config connection: - existingSecret: redis-store-credentials + existingSecret: redis-store-credentials # checkov:skip=CKV_SECRET_6: placeholder in test values searcher: <<: *component diff --git a/charts/sourcegraph/tests/kustomizeRender_allValuesExternalServices.yaml b/charts/sourcegraph/tests/kustomizeRender_allValuesExternalServices.yaml index 042c4751f..68b3c62d0 100644 --- a/charts/sourcegraph/tests/kustomizeRender_allValuesExternalServices.yaml +++ b/charts/sourcegraph/tests/kustomizeRender_allValuesExternalServices.yaml @@ -14,7 +14,7 @@ pgsql: host: pgsql.example.com port: '5432' user: example-user - password: placeholder-password + password: placeholder-password # checkov:skip=CKV_SECRET_6: placeholder in test values database: example-database sslmode: verify-full codeIntelDB: @@ -23,7 +23,7 @@ codeIntelDB: host: code-intel-d-b.example.com port: '5432' user: example-user - password: placeholder-password + password: placeholder-password # checkov:skip=CKV_SECRET_6: placeholder in test values database: example-database sslmode: verify-full codeInsightsDB: @@ -32,7 +32,7 @@ codeInsightsDB: host: code-insights-d-b.example.com port: '5432' user: example-user - password: placeholder-password + password: placeholder-password # checkov:skip=CKV_SECRET_6: placeholder in test values database: example-database sslmode: verify-full redisCache: @@ -56,7 +56,7 @@ openTelemetry: endpoint: otlp.example.com:4317 tls: ca_file: /tls/ca.pem - exportersTlsSecretName: otel-exporter-tls + exportersTlsSecretName: otel-exporter-tls # checkov:skip=CKV_SECRET_6: placeholder in test values processors: batch: timeout: 5s diff --git a/charts/sourcegraph/tests/kustomizeRender_selfHosted.yaml b/charts/sourcegraph/tests/kustomizeRender_selfHosted.yaml index 07eaeaeb0..0ef5939f4 100644 --- a/charts/sourcegraph/tests/kustomizeRender_selfHosted.yaml +++ b/charts/sourcegraph/tests/kustomizeRender_selfHosted.yaml @@ -52,24 +52,24 @@ storageClass: pgsql: enabled: false auth: - existingSecret: pgsql-credentials + existingSecret: pgsql-credentials # checkov:skip=CKV_SECRET_6: placeholder in test values codeIntelDB: enabled: false auth: - existingSecret: codeintel-db-credentials + existingSecret: codeintel-db-credentials # checkov:skip=CKV_SECRET_6: placeholder in test values codeInsightsDB: enabled: false auth: - existingSecret: codeinsights-db-credentials + existingSecret: codeinsights-db-credentials # checkov:skip=CKV_SECRET_6: placeholder in test values redisCache: enabled: false connection: - existingSecret: redis-cache-credentials + existingSecret: redis-cache-credentials # checkov:skip=CKV_SECRET_6: placeholder in test values redisStore: enabled: false connection: - existingSecret: redis-store-credentials + existingSecret: redis-store-credentials # checkov:skip=CKV_SECRET_6: placeholder in test values frontend: labels: @@ -90,7 +90,7 @@ frontend: ingress: host: sourcegraph.example.com ingressClassName: nginx - tlsSecret: sourcegraph-tls + tlsSecret: sourcegraph-tls # checkov:skip=CKV_SECRET_6: placeholder in test values annotations: kubernetes.io/ingress.class: null cert-manager.io/cluster-issuer: example-issuer