feat: update vaultwarden to 1.37.1

This commit is contained in:
cătălin 2026-07-30 10:01:53 +02:00
commit 5d4d910715
No known key found for this signature in database
7 changed files with 140 additions and 35 deletions

View file

@ -11,8 +11,8 @@ spec:
server: https://kubernetes.default.svc server: https://kubernetes.default.svc
sources: sources:
- repoURL: git.roboces.dev/catalin/fukuops - repoURL: git.roboces.dev/catalin/fukuops
chart: vaultwarden/vaultwarden chart: vaultwarden
targetRevision: 0.1.0 targetRevision: 0.1.1
helm: helm:
valuesObject: valuesObject:
conf: conf:

View file

@ -3,4 +3,4 @@ name: miniflux
description: A Helm chart for Miniflux RSS reader description: A Helm chart for Miniflux RSS reader
type: application type: application
version: 0.1.0 version: 0.1.0
appVersion: "2.2.18" appVersion: 2.2.18

View file

@ -3,4 +3,4 @@ name: vaultwarden
description: A Helm chart for Vaultwarden password manager description: A Helm chart for Vaultwarden password manager
type: application type: application
version: 0.1.0 version: 0.1.0
appVersion: "1.37.0" appVersion: 1.37.1

View file

@ -1,21 +0,0 @@
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ include "vaultwarden.fullname" . }}-data
labels:
{{- include "vaultwarden.labels" . | nindent 4 }}
spec:
accessModes:
- {{ .Values.persistence.accessMode }}
{{- if .Values.persistence.storageClass }}
{{- if eq "-" .Values.persistence.storageClass }}
storageClassName: ""
{{- else }}
storageClassName: "{{ .Values.persistence.storageClass }}"
{{- end }}
{{- end }}
resources:
requests:
storage: {{ .Values.persistence.size }}
{{- end }}

View file

@ -1,18 +1,17 @@
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: StatefulSet
metadata: metadata:
name: {{ include "vaultwarden.fullname" . }} name: {{ include "vaultwarden.fullname" . }}
labels: labels:
{{- include "vaultwarden.labels" . | nindent 4 }} {{- include "vaultwarden.labels" . | nindent 4 }}
spec: spec:
serviceName: {{ include "vaultwarden.fullname" . }}-headless
{{- if not .Values.autoscaling.enabled }} {{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }} replicas: {{ .Values.replicaCount }}
{{- end }} {{- end }}
selector: selector:
matchLabels: matchLabels:
{{- include "vaultwarden.selectorLabels" . | nindent 6 }} {{- include "vaultwarden.selectorLabels" . | nindent 6 }}
strategy:
type: Recreate
template: template:
metadata: metadata:
{{- with .Values.podAnnotations }} {{- with .Values.podAnnotations }}
@ -32,7 +31,7 @@ spec:
- name: {{ .Chart.Name }} - name: {{ .Chart.Name }}
securityContext: securityContext:
{{- toYaml .Values.securityContext | nindent 12 }} {{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default (printf "%s-alpine" .Chart.AppVersion) }}"
imagePullPolicy: {{ .Values.image.pullPolicy }} imagePullPolicy: {{ .Values.image.pullPolicy }}
envFrom: envFrom:
- secretRef: - secretRef:
@ -69,15 +68,12 @@ spec:
volumeMounts: volumeMounts:
- name: data - name: data
mountPath: /data mountPath: /data
{{- if .Values.persistence.existingClaim }}
volumes: volumes:
- name: data - name: data
{{- if .Values.persistence.existingClaim }}
persistentVolumeClaim: persistentVolumeClaim:
claimName: {{ .Values.persistence.existingClaim }} claimName: {{ .Values.persistence.existingClaim }}
{{- else }} {{- end }}
persistentVolumeClaim:
claimName: {{ include "vaultwarden.fullname" . }}-data
{{- end }}
{{- with .Values.nodeSelector }} {{- with .Values.nodeSelector }}
nodeSelector: nodeSelector:
{{- toYaml . | nindent 8 }} {{- toYaml . | nindent 8 }}
@ -92,3 +88,21 @@ spec:
{{- end }} {{- end }}
restartPolicy: Always restartPolicy: Always
automountServiceAccountToken: false automountServiceAccountToken: false
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
volumeClaimTemplates:
- metadata:
name: data
spec:
accessModes:
- {{ .Values.persistence.accessMode }}
{{- if .Values.persistence.storageClass }}
{{- if eq "-" .Values.persistence.storageClass }}
storageClassName: ""
{{- else }}
storageClassName: {{ .Values.persistence.storageClass | quote }}
{{- end }}
{{- end }}
resources:
requests:
storage: {{ .Values.persistence.size }}
{{- end }}

View file

@ -4,7 +4,7 @@ replicaCount: 1
image: image:
repository: vaultwarden/server repository: vaultwarden/server
pullpolicy: Always pullpolicy: Always
tag: "1.37.1-alpine" tag: ""
imagePullSecrets: [] imagePullSecrets: []
podAnnotations: {} podAnnotations: {}

112
scripts/hbd.sh Executable file
View file

@ -0,0 +1,112 @@
#!/usr/bin/env bash
set -euo pipefail
USAGE="Usage: $0 <chart-name> [version] [--oci-register <registry>]"
function usage() {
echo "$USAGE"
exit 1
}
function next_patch_version() {
local chart="$1"
local ver
ver=$(yq '.version' "$chart/Chart.yaml")
if [[ -z "$ver" || "$ver" == "null" ]]; then
echo "Error: Could not find version in $chart/Chart.yaml" >&2
exit 1
fi
IFS='.' read -r major minor patch <<< "$ver"
echo "$major.$minor.$((patch + 1))"
}
function build_and_push() {
local chart_name="$1"
local version="$2"
local oci_registry="${3:-oci://git.roboces.dev/catalin/fukuops}"
local chart_path="k8s/charts/$chart_name"
if [[ ! -d "$chart_path" ]]; then
echo "Error: Chart '$chart_name' not found at $chart_path" >&2
exit 1
fi
if [[ ! -f "$chart_path/Chart.yaml" ]]; then
echo "Error: Chart.yaml not found in $chart_path" >&2
exit 1
fi
echo "Building and pushing $chart_name version $version to $oci_registry"
local current_version
current_version=$(yq -r '.version' "$chart_path/Chart.yaml")
yq -y -i ".version = \"$version\"" "$chart_path/Chart.yaml"
mkdir -p /tmp/helm-pkg/
helm package "$chart_path" -d /tmp/helm-pkg/
helm push "/tmp/helm-pkg/${chart_name}-${version}.tgz" "$oci_registry"
yq -y -i ".version = \"$current_version\"" "$chart_path/Chart.yaml"
echo "Successfully pushed $chart_name-$version to $oci_registry"
}
function main() {
if [[ $# -lt 1 ]]; then
usage
fi
local chart_name=""
local version=""
local oci_registry="oci://git.roboces.dev/catalin/fukuops"
while [[ $# -gt 0 ]]; do
case "$1" in
--oci-register)
if [[ -z "${2:-}" ]] || [[ "$2" == -* ]]; then
echo "Error: --oci-register requires a registry argument" >&2
exit 1
fi
oci_registry="$2"
shift 2
;;
-h|--help)
echo "$USAGE"
echo ""
echo "Options:"
echo " --oci-register <registry> Override default OCI registry (default: oci://git.roboces.dev/catalin/fukuops)"
exit 0
;;
-*)
echo "Error: Unknown option: $1" >&2
usage
;;
*)
if [[ -z "$chart_name" ]]; then
chart_name="$1"
elif [[ -z "$version" ]]; then
version="$1"
else
echo "Error: Too many arguments" >&2
usage
fi
shift
;;
esac
done
if [[ -z "$chart_name" ]]; then
echo "Error: Chart name is required" >&2
usage
fi
if [[ -z "$version" ]]; then
version=$(next_patch_version "k8s/charts/$chart_name")
echo "No version provided, calculated next patch version: $version"
fi
build_and_push "$chart_name" "$version" "$oci_registry"
}
main "$@"