diff --git a/charts/static-site/Chart.lock b/charts/static-site/Chart.lock index a4854e6..93acb9e 100644 --- a/charts/static-site/Chart.lock +++ b/charts/static-site/Chart.lock @@ -1,6 +1,6 @@ dependencies: - name: common - repository: file://../common + repository: file://charts/common version: 0.7.0 -digest: sha256:a97ffdc0ab67ba57b6fb03ab3f98bbbc488f0630f2160b75e937c27d19a2fa08 -generated: "2024-09-09T08:36:50.241133151Z" +digest: sha256:add56ef2d982ba863c26d56ce67dbdab941634dc81301cea01221a22ccce8bc4 +generated: "2026-08-12T09:57:03.192194304+02:00" diff --git a/charts/static-site/Chart.yaml b/charts/static-site/Chart.yaml index 7c91056..a651b26 100644 --- a/charts/static-site/Chart.yaml +++ b/charts/static-site/Chart.yaml @@ -14,9 +14,16 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.73.0 +version: 0.73.1 + +home: https://www.ethswarm.org +icon: https://docs.ethswarm.org/img/swarm-logo-2.svg + +maintainers: + - name: darkobas + email: devops@ethswarm.org dependencies: - name: common version: 0.7.0 - repository: file://../common + repository: file://charts/common diff --git a/charts/static-site/PROVENANCE.md b/charts/static-site/PROVENANCE.md index d7841f4..a43ecc1 100644 --- a/charts/static-site/PROVENANCE.md +++ b/charts/static-site/PROVENANCE.md @@ -11,3 +11,21 @@ to keep existing deployments installable. - Upstream licence: Apache-2.0 (see `LICENSE` in this directory) - Templates are unmodified; `helm template` output is byte-for-byte identical to the original `static-site-0.73.0.tgz` artifact. + +## Local versions + +Templates and values remain upstream `v0.73.0` verbatim. The chart version is +bumped locally only when repackaging metadata changes, because `chart-testing` +requires a version bump for any modified chart. + +- `0.73.0` - initial vendoring. +- `0.73.1` - declare the vendored `common` subchart as + `repository: file://charts/common` and ship it unpacked rather than as a + tarball. Upstream's `file://../common` assumed onechart's monorepo layout and + broke `helm dependency update`, which failed the Release workflow for the + whole repository. Also strips two trailing-whitespace occurrences from + `values.yaml` that `chart-testing`'s yamllint rejects. No template changes + and no semantic values changes; rendered output is unchanged apart from the + `helm.sh/chart` version label. Adds the `maintainers`, `home` and `icon` + metadata that `chart-testing` requires and that the other charts in this + repository already carry; upstream shipped none. diff --git a/charts/static-site/charts/common-0.7.0.tgz b/charts/static-site/charts/common-0.7.0.tgz deleted file mode 100644 index d39ef9c..0000000 Binary files a/charts/static-site/charts/common-0.7.0.tgz and /dev/null differ diff --git a/charts/static-site/charts/common/.helmignore b/charts/static-site/charts/common/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/charts/static-site/charts/common/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/charts/static-site/charts/common/Chart.yaml b/charts/static-site/charts/common/Chart.yaml new file mode 100644 index 0000000..8215328 --- /dev/null +++ b/charts/static-site/charts/common/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v2 +description: A Helm chart for Kubernetes +name: common +type: library +version: 0.7.0 diff --git a/charts/static-site/charts/common/templates/_configmap.yaml b/charts/static-site/charts/common/templates/_configmap.yaml new file mode 100644 index 0000000..6b06160 --- /dev/null +++ b/charts/static-site/charts/common/templates/_configmap.yaml @@ -0,0 +1,16 @@ +{{- define "common.configmap.tpl" -}} +{{- if .Values.vars }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "common.robustName" .Release.Name }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "helm-chart.labels" . | nindent 4 }} +data: +{{- range $key, $val := .Values.vars }} + {{ $key }}: {{ $val | quote }} +{{- end }} +{{- end }} +{{- end -}} diff --git a/charts/static-site/charts/common/templates/_container.yaml b/charts/static-site/charts/common/templates/_container.yaml new file mode 100644 index 0000000..f0649f4 --- /dev/null +++ b/charts/static-site/charts/common/templates/_container.yaml @@ -0,0 +1,54 @@ +{{- define "common.container.tpl" -}} +name: {{ template "robustName" .Release.Name }} +securityContext: + {{- toYaml .Values.securityContext | nindent 2 }} +image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" +imagePullPolicy: {{ .Values.image.pullPolicy }} +{{- if .Values.command }} +command: + - {{ .Values.shell }} + - -c + - {{ .Values.command | quote }} +{{- end }} +ports: + {{- if not .Values.ports }} + - name: http + containerPort: {{ .Values.containerPort }} + protocol: TCP + {{- else }} + {{- range .Values.ports }} + - name: {{ .name }} + containerPort: {{ .containerPort }} + protocol: TCP + {{- end }} + {{- end }} +{{- if .Values.probe.enabled }} +readinessProbe: + httpGet: + path: {{ .Values.probe.path }} + port: {{ .Values.containerPort }} + scheme: HTTP + {{- with .Values.probe.settings }} + {{- toYaml . | nindent 2 }} + {{- end }} +{{- end }} +{{- if .Values.livenessProbe.enabled }} +livenessProbe: + httpGet: + path: {{ .Values.livenessProbe.path }} + port: {{ .Values.containerPort }} + scheme: HTTP + {{- with .Values.livenessProbe.settings }} + {{- toYaml . | nindent 2 }} + {{- end }} +{{- end }} +{{- if not .Values.resources.ignore }} +resources: + {{- if .Values.resources.ignoreLimits }} + requests: + {{- toYaml .Values.resources.requests | nindent 4 }} + {{- else }} + {{- toYaml .Values.resources | nindent 2 }} + {{- end }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/static-site/charts/common/templates/_customFileConfigmap.yaml b/charts/static-site/charts/common/templates/_customFileConfigmap.yaml new file mode 100644 index 0000000..2ca2369 --- /dev/null +++ b/charts/static-site/charts/common/templates/_customFileConfigmap.yaml @@ -0,0 +1,16 @@ +{{- define "common.customFileConfigmap.tpl" -}} +{{- range .Values.volumes }} + {{- if .fileName }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "common.robustName" (printf "%s-%s" $.Release.Name .name) }} + namespace: {{ $.Release.Namespace }} +data: + {{ .fileName }}: | + {{- .fileContent | nindent 4 }} + + {{- end }} +{{- end }} +{{- end -}} diff --git a/charts/static-site/charts/common/templates/_envFromRef.yaml b/charts/static-site/charts/common/templates/_envFromRef.yaml new file mode 100644 index 0000000..e8543cb --- /dev/null +++ b/charts/static-site/charts/common/templates/_envFromRef.yaml @@ -0,0 +1,31 @@ +{{- define "common.envFromRef.tpl" -}} +{{- if or (or (or (or (or (.Values.vars) (.Values.secretEnabled)) .Values.sealedSecrets) .Values.secretName) .Values.existingConfigMaps) .Values.existingSecrets -}} +envFrom: +{{- if .Values.vars }} + - configMapRef: + name: {{ template "common.robustName" .Release.Name }} +{{- end }} +{{- range .Values.existingSecrets }} + - secretRef: + name: {{ .name }} + optional: {{ .optional | default false }} +{{- end }} +{{- range .Values.existingConfigMaps }} + - configMapRef: + name: {{ .name }} + optional: {{ .optional | default false }} +{{- end }} +{{- if .Values.secretEnabled }} + - secretRef: + name: {{ include "common.robustName" $.Release.Name }} +{{- end }} +{{- if .Values.secretName }} + - secretRef: + name: {{ .Values.secretName }} +{{- end }} +{{- if .Values.sealedSecrets }} + - secretRef: + name: {{ template "common.robustName" .Release.Name }} +{{- end }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/static-site/charts/common/templates/_fileSecret.yaml b/charts/static-site/charts/common/templates/_fileSecret.yaml new file mode 100644 index 0000000..b53db34 --- /dev/null +++ b/charts/static-site/charts/common/templates/_fileSecret.yaml @@ -0,0 +1,15 @@ +{{- define "common.fileSecret.tpl" -}} +{{- range .Values.fileSecrets }} +--- +kind: Secret +apiVersion: v1 +type: Opaque +metadata: + name: {{ printf "%s-%s" $.Release.Name .name }} + namespace: {{ $.Release.Namespace }} +data: +{{- range $key, $val := .secrets }} + {{ $key }}: {{ $val | b64enc }} +{{- end }} +{{- end }} +{{- end -}} diff --git a/charts/static-site/charts/common/templates/_helpers.tpl b/charts/static-site/charts/common/templates/_helpers.tpl new file mode 100644 index 0000000..24ea469 --- /dev/null +++ b/charts/static-site/charts/common/templates/_helpers.tpl @@ -0,0 +1,10 @@ +{{/* vim: set filetype=mustache: */}} + +{{/* +Create robustName that can be used as Kubernetes resource name, and as subdomain as well +\w – Latin letters, digits, underscore '_' . +\W – all but \w . +*/}} +{{- define "common.robustName" -}} +{{ regexReplaceAll "\\W+" . "-" | replace "_" "-" | lower | trunc 63 | trimSuffix "-" }} +{{- end }} diff --git a/charts/static-site/charts/common/templates/_podSpec.yaml b/charts/static-site/charts/common/templates/_podSpec.yaml new file mode 100644 index 0000000..f7620d5 --- /dev/null +++ b/charts/static-site/charts/common/templates/_podSpec.yaml @@ -0,0 +1,83 @@ +{{- define "common.podSpec.tpl" -}} +{{- with .Values.imagePullSecrets }} +imagePullSecrets: + {{- range . }} + - name: {{ . }} + {{- end }} +{{- end }} +securityContext: + {{- toYaml .Values.podSecurityContext | nindent 2 }} +{{- if .Values.serviceAccount }} +serviceAccountName: {{ .Values.serviceAccount }} +{{- end }} +initContainers: + {{- range .Values.initContainers }} + - name: {{ .name }} + image: "{{ .image }}:{{ .tag }}" + imagePullPolicy: {{ .imagePullPolicy | default "IfNotPresent" }} + {{- include "common.envFromRef.tpl" $ | nindent 4 }} + {{- if .command }} + command: + - {{ $.Values.shell }} + - -c + - {{ .command | quote}} + {{- end }} + volumeMounts: + {{- range $.Values.volumes }} + {{- if (or (hasPrefix "shared-" .name) (hasPrefix "init-" .name))}} + - mountPath: {{ .path }} + name: {{ .name }} + {{- end }} + {{- end }} + {{- if .securityContext }} + securityContext: + {{- toYaml .securityContext | nindent 6 }} + {{- end}} + {{- end }} +containers: + {{- $containerTpl := include "common.container.tpl" . | fromYaml }} + {{- $container := mergeOverwrite $containerTpl .Values.container }} + - {{ toYaml $container | nindent 4 }} + {{- include "common.envFromRef.tpl" . | nindent 4 }} + {{- include "common.volumeMountsRef.tpl" . | nindent 4 }} + {{- if .Values.sidecar }} + - name: {{ template "robustName" .Release.Name }}-sidecar + securityContext: + {{- toYaml .Values.securityContext | nindent 6 }} + image: {{ .Values.sidecar.repository }}:{{ .Values.sidecar.tag }} + {{- if .Values.sidecar.command }} + command: + - {{ .Values.sidecar.shell }} + - -c + - {{ .Values.sidecar.command | quote }} + {{- end }} + {{- include "common.envFromRef.tpl" . | nindent 4 }} + {{- include "common.volumeMountsRef.tpl" . | nindent 4 }} + {{- end }} +{{- include "common.volumesRef.tpl" . }} +{{- with .Values.nodeSelector }} +nodeSelector: + {{- toYaml . | nindent 2 }} +{{- end }} +{{- if or .Values.spreadAcrossNodes .Values.affinity }} +affinity: + {{- if .Values.spreadAcrossNodes }} + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: "app.kubernetes.io/instance" + operator: In + values: + - {{ template "robustName" .Release.Name }} + topologyKey: "kubernetes.io/hostname" + {{- end }} + {{- if .Values.affinity }} + {{- toYaml .Values.affinity | nindent 2 }} + {{- end }} +{{- end }} +{{- with .Values.tolerations }} +tolerations: + {{- toYaml . | nindent 2 }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/static-site/charts/common/templates/_pvc.yaml b/charts/static-site/charts/common/templates/_pvc.yaml new file mode 100644 index 0000000..f1965ae --- /dev/null +++ b/charts/static-site/charts/common/templates/_pvc.yaml @@ -0,0 +1,26 @@ +{{- define "common.pvc.tpl" -}} +{{- range .Values.volumes }} +{{- if not (or .existingClaim .hostPath .fileName .emptyDir .existingConfigMap) }} +{{- $robustName := include "common.robustName" $.Release.Name }} +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ printf "%s-%s" $robustName .name }} + namespace: {{ $.Release.Namespace }} + {{- if .pvcAnnotations }} + annotations: + {{- toYaml .pvcAnnotations | nindent 4 }} + {{- end }} +spec: + accessModes: + - {{ .accessMode | default "ReadWriteOnce" }} + {{- if .storageClass }} + storageClassName: {{ .storageClass }} + {{- end }} + resources: + requests: + storage: {{ .size | default "1Gi" }} +{{- end }} +{{- end }} +{{- end -}} \ No newline at end of file diff --git a/charts/static-site/charts/common/templates/_sealedFileSecret.yaml b/charts/static-site/charts/common/templates/_sealedFileSecret.yaml new file mode 100644 index 0000000..b47ebe6 --- /dev/null +++ b/charts/static-site/charts/common/templates/_sealedFileSecret.yaml @@ -0,0 +1,26 @@ +{{- define "common.sealedFileSecret.tpl" -}} +{{- range .Values.sealedFileSecrets }} +{{- $robustName := include "common.robustName" $.Release.Name }} +--- +apiVersion: bitnami.com/v1alpha1 +kind: SealedSecret +metadata: + name: {{ printf "%s-%s" $robustName .name }} + namespace: {{ $.Release.Namespace }} + annotations: + sealedsecrets.bitnami.com/cluster-wide: "true" +spec: + encryptedData: + {{- range $f := .filesToMount }} + {{ $f.name }}: |- + {{- $f.source | nindent 6 }} + {{- /* + {{- $.Files.Get $f.sourcePath | nindent 6 }} + */}} + {{- end }} + template: + metadata: + name: {{ printf "%s-%s" $.Release.Name .name }} + namespace: {{ $.Release.Namespace }} +{{- end }} +{{- end -}} diff --git a/charts/static-site/charts/common/templates/_sealedSecret.yaml b/charts/static-site/charts/common/templates/_sealedSecret.yaml new file mode 100644 index 0000000..7bec2ee --- /dev/null +++ b/charts/static-site/charts/common/templates/_sealedSecret.yaml @@ -0,0 +1,22 @@ +{{- define "common.sealedSecret.tpl" -}} + {{- if .Values.sealedSecrets }} +apiVersion: bitnami.com/v1alpha1 +kind: SealedSecret +metadata: + name: {{ template "common.robustName" .Release.Name }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "helm-chart.labels" . | nindent 4 }} + annotations: + sealedsecrets.bitnami.com/cluster-wide: "true" +spec: + encryptedData: + {{- range $key, $val := .Values.sealedSecrets }} + {{ $key }}: {{ $val | quote }} + {{- end }} + template: + metadata: + name: {{ template "common.robustName" .Release.Name }} + namespace: {{ .Release.Namespace }} +{{- end }} +{{- end -}} diff --git a/charts/static-site/charts/common/templates/_volumeMountsRef.yaml b/charts/static-site/charts/common/templates/_volumeMountsRef.yaml new file mode 100644 index 0000000..4439369 --- /dev/null +++ b/charts/static-site/charts/common/templates/_volumeMountsRef.yaml @@ -0,0 +1,39 @@ +{{- define "common.volumeMountsRef.tpl" -}} +{{- if or (or (or (.Values.volumes) (.Values.sealedFileSecrets)) .Values.fileSecrets) .Values.existingFileSecrets -}} +volumeMounts: +{{- range .Values.volumes }} +{{- if not (hasPrefix "init-" .name) }} + - name: {{ .name }} + mountPath: {{ .path }} + {{- if .subPath }} + subPath: {{ .subPath }} + {{- end }} +{{- end }} +{{- end }} +{{- range .Values.sealedFileSecrets }} + - name: {{ .name }} + mountPath: {{ .path }} + {{- if .subPath}} + subPath: {{ .subPath }} + {{- end }} + readOnly: true +{{- end }} +{{- range .Values.fileSecrets }} + - name: {{ .name }} + mountPath: {{ .path }} + {{- if .subPath}} + subPath: {{ .subPath }} + {{- end }} + readOnly: true +{{- end }} +{{- range .Values.existingFileSecrets }} + - name: {{ .name }} + mountPath: {{ .path }} + {{- if .subPath}} + subPath: {{ .subPath }} + {{- end }} + readOnly: true +{{- end }} +{{- end }} +{{- end }} + diff --git a/charts/static-site/charts/common/templates/_volumesRef.yaml b/charts/static-site/charts/common/templates/_volumesRef.yaml new file mode 100644 index 0000000..37a580a --- /dev/null +++ b/charts/static-site/charts/common/templates/_volumesRef.yaml @@ -0,0 +1,48 @@ +{{- define "common.volumesRef.tpl" }} +{{- if or (or (or (.Values.volumes) (.Values.sealedFileSecrets)) .Values.fileSecrets) .Values.existingFileSecrets }} +volumes: + {{- range .Values.volumes }} + - name: {{ .name }} + {{- if .emptyDir }} + emptyDir: {} + {{- else if .existingConfigMap }} + configMap: + name: {{ .existingConfigMap }} + {{- else if .existingSecret }} + secret: + secretName: {{ .existingSecret }} + {{- else if .fileName }} + configMap: + name: {{ template "common.robustName" (printf "%s-%s" $.Release.Name .name) }} + {{- else if .hostPath }} + hostPath: + path: {{ .hostPath.path }} + {{- if .hostPath.type }} + type: {{ .hostPath.type }} + {{- end }} + {{- else }} + persistentVolumeClaim: + {{- if .existingClaim }} + claimName: {{ .existingClaim }} + {{ else }} + claimName: {{ printf "%s-%s" $.Release.Name .name }} + {{- end }} + {{- end }} +{{- end }} + {{- range .Values.sealedFileSecrets }} + - name: {{ .name }} + secret: + secretName: {{ printf "%s-%s" $.Release.Name .name }} + {{- end }} + {{- range .Values.fileSecrets }} + - name: {{ .name }} + secret: + secretName: {{ printf "%s-%s" $.Release.Name .name }} + {{- end }} + {{- range .Values.existingFileSecrets }} + - name: {{ .name }} + secret: + secretName: {{ .name }} + {{- end }} +{{- end }} +{{- end }} diff --git a/charts/static-site/ci/ct-values.yaml b/charts/static-site/ci/ct-values.yaml new file mode 100644 index 0000000..f1b6b67 --- /dev/null +++ b/charts/static-site/ci/ct-values.yaml @@ -0,0 +1,20 @@ +# Values used by chart-testing for the install test. +# +# The chart's defaults clone gimlet-io/reactjs-test-app and run a full +# `npm install && npm run build`. That needs the npm registry, takes minutes, +# and the upstream demo repo belongs to an org that was archived in 2025 - so +# `ct install` against the defaults crash-loops the init container and can +# never go green. +# +# Clone this repository instead (always reachable from the runner) and emit a +# trivial asset. Exercises the same code path the chart actually ships: +# git clone -> build script -> copy builtAssets into /usr/share/nginx/html. +# +# buildImage stays at the chart's default node:latest - it already has git and +# sh, and the CI runner demonstrably pulls it, so this introduces no new image +# dependency. +gitCloneUrl: https://github.com/ethersphere/helm.git +buildImage: node:latest +buildScript: | + mkdir -p build && printf 'ok\n' > build/index.html +builtAssets: build/ diff --git a/charts/static-site/values.yaml b/charts/static-site/values.yaml index 3c75229..9dec2fa 100644 --- a/charts/static-site/values.yaml +++ b/charts/static-site/values.yaml @@ -18,7 +18,7 @@ podAnnotations: {} podSecurityContext: {} # fsGroup: 2000 -securityContext: +securityContext: # capabilities: # drop: # - ALL @@ -38,7 +38,7 @@ service: # cert-manager.io/cluster-issuer: letsencrypt-staging -resources: +resources: requests: cpu: 200m memory: 200Mi