Merge 451ddf8410247323d687fdc35ea12310a86295e0 into ee420fbf2946e9f79977615cee5e29192d7da478

This commit is contained in:
Rojin Ebrahimi 2026-02-13 23:26:05 +03:30 committed by GitHub
commit 62aa84c1b3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 561 additions and 1 deletions

View File

@ -16,7 +16,7 @@ A simple admin web UI for [Garage](https://garagehq.deuxfleurs.fr/), a self-host
## Installation
The Garage Web UI is available as a single executable binary and docker image. You can install it using the command line or with Docker Compose.
The Garage Web UI is available as a single executable binary and docker image. You can install it using the command line, Docker Compose, or Kubernetes.
### Docker CLI
@ -57,6 +57,26 @@ services:
S3_ENDPOINT_URL: "http://garage:3900"
```
### Kubernetes (Helm)
You can deploy the Web UI to a Kubernetes cluster using the provided Helm chart found in `deploy/helm`.
1. **Clone the repository:**
```sh
$ git clone [https://github.com/khairul169/garage-webui.git](https://github.com/khairul169/garage-webui.git)
$ cd garage-webui
```
2. **Customize configuration:**
Edit `deploy/helm/values.yaml` to match your environment. You will likely need to update `API_BASE_URL` and `S3_ENDPOINT_URL` to point to your internal Garage services.
3. **Install the chart:**
```sh
$ helm install garage-webui ./deploy/helm --namespace garage --create-namespace
```
### Without Docker
Get the latest binary from the [release page](https://github.com/khairul169/garage-webui/releases/latest) according to your OS architecture. For example:

23
deploy/helm/.helmignore Normal file
View File

@ -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/

6
deploy/helm/Chart.yaml Normal file
View File

@ -0,0 +1,6 @@
apiVersion: v2
name: garage-webui
description: A Helm chart for Garage Web UI
type: application
version: 1.1.0
appVersion: "1.1.0"

View File

@ -0,0 +1,92 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "garage-webui.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "garage-webui.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "garage-webui.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels
*/}}
{{- define "garage-webui.labels" -}}
helm.sh/chart: {{ include "garage-webui.chart" . }}
{{ include "garage-webui.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{/*
Selector labels
*/}}
{{- define "garage-webui.selectorLabels" -}}
app.kubernetes.io/name: {{ include "garage-webui.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{/*
Create the name of the service account to use
*/}}
{{- define "garage-webui.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "garage-webui.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
{{/*
Return the secret name, with validation when enabled.
*/}}
{{- define "garage-webui.secretName" -}}
{{- if and .Values.secretRefs .Values.secretRefs.enabled }}
{{- if not .Values.secretRefs.name }}
{{- fail "secretRefs.name must be set when secretRefs.enabled=true" }}
{{- end }}
{{- end }}
{{- if .Values.secretRefs }}{{ .Values.secretRefs.name | default "" }}{{ end }}
{{- end }}
{{/*
Generate env variables based on secretRefs.keys.
*/}}
{{- define "garage-webui.secretEnv" -}}
{{- if and .Values.secretRefs .Values.secretRefs.enabled .Values.secretRefs.keys }}
{{- $secretName := include "garage-webui.secretName" . }}
{{- range $envName, $keyName := .Values.secretRefs.keys }}
{{- if $keyName }}
- name: {{ $envName }}
valueFrom:
secretKeyRef:
name: {{ $secretName }}
key: {{ $keyName }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}

View File

@ -0,0 +1,99 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "garage-webui.fullname" . }}
labels:
{{- include "garage-webui.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "garage-webui.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "garage-webui.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "garage-webui.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: 3909
protocol: TCP
env:
- name: API_BASE_URL
value: {{ .Values.garageConfig.adminApiUrl | quote }}
- name: S3_ENDPOINT_URL
value: {{ .Values.garageConfig.s3Endpoint | quote }}
- name: S3_REGION
value: {{ .Values.garageConfig.region | quote }}
{{- include "garage-webui.secretEnv" . | nindent 12 }}
{{- if not (and .Values.secretRefs (and .Values.secretRefs.enabled (index .Values.secretRefs.keys "AUTH_USER_PASS"))) }}
- name: AUTH_USER_PASS
value: {{ .Values.auth.userPassHash | quote }}
{{- end }}
{{- if not (and .Values.secretRefs (and .Values.secretRefs.enabled (index .Values.secretRefs.keys "API_ADMIN_KEY"))) }}
- name: API_ADMIN_KEY
value: {{ .Values.garageConfig.adminApiKey | quote }}
{{- end }}
livenessProbe:
httpGet:
path: /
port: http
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
readinessProbe:
httpGet:
path: /
port: http
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
volumeMounts:
{{- if .Values.config.enabled }}
- name: config
mountPath: /etc/garage.toml
subPath: garage.toml
readOnly: true
{{- end }}
{{- with .Values.volumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
{{- if .Values.config.enabled }}
- name: config
configMap:
name: {{ .Values.config.name }}
{{- end }}
{{- with .Values.volumes }}
{{- toYaml . | nindent 8 }}
{{- end }}

View File

@ -0,0 +1,34 @@
{{- if .Values.autoscaling.enabled }}
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "garage-webui.fullname" . }}
annotations:
argocd.argoproj.io/sync-wave: "4"
labels:
{{- include "garage-webui.labels" . | nindent 4 }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "garage-webui.fullname" . }}
minReplicas: {{ .Values.autoscaling.minReplicas }}
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
metrics:
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}

View File

@ -0,0 +1,47 @@
{{- if .Values.httproute.enabled -}}
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: {{ include "garage-webui.fullname" . }}
labels:
{{- include "garage-webui.labels" . | nindent 4 }}
{{- with .Values.httproute.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
parentRefs:
{{- range .Values.httproute.parentRefs }}
- name: {{ .name }}
namespace: {{ .namespace | default $.Release.Namespace }}
{{- if .sectionName }}
sectionName: {{ .sectionName }}
{{- end }}
{{- end }}
{{- if .Values.httproute.hostnames }}
hostnames:
{{- toYaml .Values.httproute.hostnames | nindent 4 }}
{{- end }}
rules:
{{- if .Values.httproute.rules }}
{{- range .Values.httproute.rules }}
- matches:
{{- toYaml .matches | nindent 6 }}
backendRefs:
{{- if .backendRefs }}
{{- toYaml .backendRefs | nindent 8 }}
{{- else }}
- name: {{ include "garage-webui.fullname" $ }}
port: {{ $.Values.service.port }}
{{- end }}
{{- end }}
{{- else }}
- matches:
- path:
type: PathPrefix
value: /
backendRefs:
- name: {{ include "garage-webui.fullname" . }}
port: {{ .Values.service.port }}
{{- end }}
{{- end }}

View File

@ -0,0 +1,43 @@
{{- if .Values.ingress.enabled -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "garage-webui.fullname" . }}
labels:
{{- include "garage-webui.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- with .Values.ingress.className }}
ingressClassName: {{ . }}
{{- end }}
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ .host | quote }}
http:
paths:
{{- range .paths }}
- path: {{ .path }}
{{- with .pathType }}
pathType: {{ . }}
{{- end }}
backend:
service:
name: {{ $.Values.service.name }}
port:
number: {{ $.Values.service.port }}
{{- end }}
{{- end }}
{{- end }}

View File

@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "garage-webui.fullname" . }}
labels:
{{- include "garage-webui.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: {{ .Values.service.targetPort }}
protocol: TCP
name: {{ include "garage-webui.fullname" $ }}
selector:
{{- include "garage-webui.selectorLabels" . | nindent 4 }}

View File

@ -0,0 +1,13 @@
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "garage-webui.serviceAccountName" . }}
labels:
{{- include "garage-webui.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
automountServiceAccountToken: {{ .Values.serviceAccount.automount }}
{{- end }}

168
deploy/helm/values.yaml Normal file
View File

@ -0,0 +1,168 @@
# Default values for Garage Web UI.
# This is a YAML-formatted file.
# This will set the replicaset count more information can be found here: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/
replicaCount: 1
# This sets the container image more information can be found here: https://kubernetes.io/docs/concepts/containers/images/
image:
repository: khairul169/garage-webui
pullPolicy: IfNotPresent
tag: "1.1.0"
# This is for the secrets for pulling an image from a private repository more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
imagePullSecrets: []
# This is to override the chart name.
nameOverride: ""
fullnameOverride: "garage-webui"
# This section builds out the service account more information can be found here: https://kubernetes.io/docs/concepts/security/service-accounts/
serviceAccount:
# Specifies whether a service account should be created
create: true
# Automatically mount a ServiceAccount's API credentials?
automount: true
# Annotations to add to the service account
annotations: {}
# The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template
name: ""
# This is for setting Kubernetes Annotations to a Pod.
# For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
podAnnotations: {}
# This is for setting Kubernetes Labels to a Pod.
# For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
podLabels: {}
podSecurityContext: {}
# fsGroup: 2000
securityContext: {}
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000
# This is for setting up a service more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/
service:
# This sets the service type more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types
type: ClusterIP
# This sets the ports more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/#field-spec-ports
name: garage-webui
port: 80
targetPort: 3909
httproute:
enabled: false
annotations: {}
parentRefs: []
hostnames: []
# This block is for setting up the ingress for more information can be found here: https://kubernetes.io/docs/concepts/services-networking/ingress/
ingress:
enabled: false
className: ""
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: chart-example.local
paths:
- path: /
pathType: ImplementationSpecific
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local
resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
# This is to setup the liveness and readiness probes more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/
livenessProbe:
httpGet:
path: /
port: http
initialDelaySeconds: 10
periodSeconds: 30
readinessProbe:
httpGet:
path: /
port: http
initialDelaySeconds: 5
periodSeconds: 10
# This section is for setting up autoscaling more information can be found here: https://kubernetes.io/docs/concepts/workloads/autoscaling/
autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 100
targetCPUUtilizationPercentage: 80
# targetMemoryUtilizationPercentage: 80
# Additional volumes on the pod (merged with built-in config volume when config.enabled).
# Each volume here must have a matching mount in volumeMounts.
volumes: []
# - name: certs
# secret:
# secretName: my-tls-secret
# optional: false
# - name: extra-config
# configMap:
# name: my-config
# Additional volumeMounts for the main container (merged with config mount when config.enabled).
# Names must match entries in volumes.
volumeMounts: []
# - name: certs
# mountPath: /etc/certs
# readOnly: true
# - name: extra-config
# mountPath: /etc/extra
# readOnly: true
nodeSelector: {}
tolerations: []
affinity: {}
garageConfig:
s3Endpoint: "http://garage:3900"
region: "garage"
adminApiUrl: "http://garage-admin:3903"
adminApiKey: ""
auth:
# Generate this using: htpasswd -nbBC 10 "admin" "yourpassword"
userPassHash: ""
# API credentials (admin API key, auth hash) from an existing Secret.
# When enabled, env vars are set via secretKeyRef; otherwise values from garageConfig.adminApiKey and auth.userPassHash are used.
secretRefs:
enabled: false
# Name of the existing Secret (required when enabled)
name: ""
# Map of environment variable names to Secret data keys
keys:
API_ADMIN_KEY: "" # e.g. "admin-api-key"
AUTH_USER_PASS: "" # e.g. "user-pass-hash"
config:
# -- Enable mounting of the config file
enabled: false
# -- Name of the ConfigMap to mount
name: "garage-webui-config"