Skip to content

Commit 34c4980

Browse files
committed
add docker registry ui chart
1 parent ff0f997 commit 34c4980

File tree

10 files changed

+401
-0
lines changed

10 files changed

+401
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: v2
2+
name: docker-registry-ui
3+
description: |-
4+
Helm chart to deploy [docker-registry-ui](https://github.com/Quiq/docker-registry-ui).
5+
type: application
6+
version: 0.0.1
7+
appVersion: 0.9.4
8+
home: https://github.com/slamdev/helm-charts/tree/master/charts/docker-registry-ui
9+
icon: https://upload.wikimedia.org/wikipedia/commons/thumb/4/48/Emblem-question.svg/1200px-Emblem-question.svg.png
10+
maintainers:
11+
- name: slamdev
12+
email: valentin.fedoskin@gmail.com
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# docker-registry-ui
2+
3+
![Version: 0.0.1](https://img.shields.io/badge/Version-0.0.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.9.4](https://img.shields.io/badge/AppVersion-0.9.4-informational?style=flat-square)
4+
5+
Helm chart to deploy [docker-registry-ui](https://github.com/Quiq/docker-registry-ui).
6+
7+
**Homepage:** <https://github.com/slamdev/helm-charts/tree/master/charts/docker-registry-ui>
8+
9+
## Maintainers
10+
11+
| Name | Email | Url |
12+
| ---- | ------ | --- |
13+
| slamdev | <valentin.fedoskin@gmail.com> | |
14+
15+
## Values
16+
17+
| Key | Type | Default | Description |
18+
|-----|------|---------|-------------|
19+
| additionalResources | list | `[]` | list of additional resources to create (are processed via `tpl` function) |
20+
| affinity | object | `{}` | affinity for scheduler pod assignment |
21+
| config | string | `"listen_addr: 0.0.0.0:8000\nbase_path: /\nregistry_url: http://registry:5000\nevent_listener_token: token\nanyone_can_delete: true\nevent_database_driver: sqlite3"` | docker-registry-ui config to provision inside of the container |
22+
| containerPorts | list | `[{"containerPort":8000,"name":"http","protocol":"TCP"}]` | ports exposed by container |
23+
| env | list | `[]` | additional environment variables for the deployment |
24+
| fullnameOverride | string | `""` | full name of the chart. |
25+
| image.pullPolicy | string | `"IfNotPresent"` | image pull policy |
26+
| image.repository | string | `"quiq/docker-registry-ui"` | image repository |
27+
| image.tag | string | `""` | image tag (chart's appVersion value will be used if not set) |
28+
| imagePullSecrets | list | `[]` | image pull secret for private images |
29+
| livenessProbe.httpGet.path | string | `"/"` | path for liveness probe |
30+
| livenessProbe.httpGet.port | string | `"http"` | port for liveness probe |
31+
| nameOverride | string | `""` | override name of the chart |
32+
| nodeSelector | object | `{}` | node for scheduler pod assignment |
33+
| podSecurityContext | object | `{}` | specifies security settings for a pod |
34+
| readinessProbe.httpGet.path | string | `"/"` | path for readiness probe |
35+
| readinessProbe.httpGet.port | string | `"http"` | port for readiness probe |
36+
| replicaCount | int | `1` | number of replicas for docker-registry-ui deployment. |
37+
| resources | object | `{}` | custom resource configuration |
38+
| securityContext | object | `{}` | specifies security settings for a container |
39+
| service.ports | list | `[{"name":"http","port":80,"protocol":"TCP","targetPort":"http"}]` | service ports |
40+
| service.type | string | `"ClusterIP"` | service type |
41+
| serviceAccount.annotations | object | `{}` | annotations to add to the service account |
42+
| serviceAccount.create | bool | `false` | specifies whether a service account should be created |
43+
| serviceAccount.name | string | `nil` | the name of the service account to use; if not set and create is true, a name is generated using the fullname template |
44+
| tolerations | list | `[]` | tolerations for scheduler pod assignment |
45+
| volumeMounts | list | `[]` | additional volume mounts |
46+
| volumes | list | `[]` | additional volumes |
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
1. Get the application URL by running these commands:
2+
{{- if contains "NodePort" .Values.service.type }}
3+
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "docker-registry-ui.fullname" . }})
4+
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
5+
echo http://$NODE_IP:$NODE_PORT
6+
{{- else if contains "LoadBalancer" .Values.service.type }}
7+
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
8+
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "docker-registry-ui.fullname" . }}'
9+
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "docker-registry-ui.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
10+
echo http://$SERVICE_IP:{{ .Values.service.port }}
11+
{{- else if contains "ClusterIP" .Values.service.type }}
12+
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "docker-registry-ui.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
13+
echo "Visit http://127.0.0.1:8080 to use your application"
14+
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:80
15+
{{- end }}
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
{{/* vim: set filetype=mustache: */}}
2+
{{/*
3+
Expand the name of the chart.
4+
*/}}
5+
{{- define "docker-registry-ui.name" -}}
6+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
7+
{{- end -}}
8+
9+
{{/*
10+
Create a default fully qualified app name.
11+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
12+
If release name contains chart name it will be used as a full name.
13+
*/}}
14+
{{- define "docker-registry-ui.fullname" -}}
15+
{{- if .Values.fullnameOverride -}}
16+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
17+
{{- else -}}
18+
{{- $name := default .Chart.Name .Values.nameOverride -}}
19+
{{- if contains $name .Release.Name -}}
20+
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
21+
{{- else -}}
22+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
23+
{{- end -}}
24+
{{- end -}}
25+
{{- end -}}
26+
27+
{{/*
28+
Create chart name and version as used by the chart label.
29+
*/}}
30+
{{- define "docker-registry-ui.chart" -}}
31+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
32+
{{- end -}}
33+
34+
{{/*
35+
Common labels
36+
*/}}
37+
{{- define "docker-registry-ui.labels" -}}
38+
helm.sh/chart: {{ include "docker-registry-ui.chart" . }}
39+
{{ include "docker-registry-ui.selectorLabels" . }}
40+
{{- if .Chart.AppVersion }}
41+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
42+
{{- end }}
43+
app.kubernetes.io/managed-by: {{ .Release.Service }}
44+
{{- end -}}
45+
46+
{{/*
47+
Selector labels
48+
*/}}
49+
{{- define "docker-registry-ui.selectorLabels" -}}
50+
app.kubernetes.io/name: {{ include "docker-registry-ui.name" . }}
51+
app.kubernetes.io/instance: {{ .Release.Name }}
52+
{{- end -}}
53+
54+
{{/*
55+
Create the name of the service account to use
56+
*/}}
57+
{{- define "docker-registry-ui.serviceAccountName" -}}
58+
{{- if .Values.serviceAccount.create -}}
59+
{{ default (include "docker-registry-ui.fullname" .) .Values.serviceAccount.name }}
60+
{{- else -}}
61+
{{ default "default" .Values.serviceAccount.name }}
62+
{{- end -}}
63+
{{- end -}}
64+
65+
{{/*
66+
Create the tag for the docker image to use
67+
*/}}
68+
{{- define "docker-registry-ui.tag" -}}
69+
{{- .Values.image.tag | default .Chart.AppVersion -}}
70+
{{- end -}}
71+
72+
73+
{{/*
74+
envoy.rawResource will create a resource template that can be
75+
merged with each item in `.Values.additionalResources`.
76+
*/}}
77+
{{- define "docker-registry-ui.rawResource" -}}
78+
metadata:
79+
labels:
80+
{{- include "docker-registry-ui.labels" . | nindent 4 }}
81+
{{- end }}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{{- $template := fromYaml (include "docker-registry-ui.rawResource" .) -}}
2+
{{- range $i, $t := .Values.additionalResources }}
3+
---
4+
{{ toYaml (merge (tpl $t $ | fromYaml) $template) -}}
5+
{{- end }}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: {{ include "docker-registry-ui.fullname" . }}
5+
namespace: {{ .Release.Namespace }}
6+
labels:
7+
{{- include "docker-registry-ui.labels" . | nindent 4 }}
8+
data:
9+
config.yml: |-
10+
{{- .Values.config | nindent 4 }}
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: {{ include "docker-registry-ui.fullname" . }}
5+
namespace: {{ .Release.Namespace }}
6+
labels:
7+
{{- include "docker-registry-ui.labels" . | nindent 4 }}
8+
spec:
9+
replicas: {{ .Values.replicaCount }}
10+
selector:
11+
matchLabels:
12+
{{- include "docker-registry-ui.selectorLabels" . | nindent 6 }}
13+
template:
14+
metadata:
15+
labels:
16+
{{- include "docker-registry-ui.selectorLabels" . | nindent 8 }}
17+
annotations:
18+
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
19+
spec:
20+
{{- with .Values.imagePullSecrets }}
21+
imagePullSecrets:
22+
{{- toYaml . | nindent 8 }}
23+
{{- end }}
24+
serviceAccountName: {{ include "docker-registry-ui.serviceAccountName" . }}
25+
securityContext:
26+
{{- toYaml .Values.podSecurityContext | nindent 8 }}
27+
containers:
28+
- name: {{ .Chart.Name }}
29+
securityContext:
30+
{{- toYaml .Values.securityContext | nindent 12 }}
31+
image: "{{ .Values.image.repository }}:{{ include "docker-registry-ui.tag" . }}"
32+
imagePullPolicy: {{ .Values.image.pullPolicy }}
33+
{{- with .Values.containerPorts }}
34+
ports:
35+
{{- toYaml . | nindent 12 }}
36+
{{- end }}
37+
livenessProbe:
38+
{{- toYaml .Values.livenessProbe | nindent 12 }}
39+
readinessProbe:
40+
{{- toYaml .Values.readinessProbe | nindent 12 }}
41+
resources:
42+
{{- toYaml .Values.resources | nindent 12 }}
43+
{{- with .Values.env }}
44+
env:
45+
{{- toYaml . | nindent 12 }}
46+
{{- end }}
47+
volumeMounts:
48+
- name: {{ include "docker-registry-ui.fullname" . }}
49+
mountPath: /opt/config.yml
50+
subPath: config.yml
51+
{{- with .Values.volumeMounts }}
52+
{{- toYaml . | nindent 12 }}
53+
{{- end }}
54+
volumes:
55+
- name: {{ include "docker-registry-ui.fullname" . }}
56+
configMap:
57+
name: {{ include "docker-registry-ui.fullname" . }}
58+
items:
59+
- key: config.yml
60+
path: config.yml
61+
mode: 292 # 0444
62+
{{- with .Values.volumes }}
63+
{{- toYaml . | nindent 8 }}
64+
{{- end }}
65+
{{- with .Values.nodeSelector }}
66+
nodeSelector:
67+
{{- toYaml . | nindent 8 }}
68+
{{- end }}
69+
{{- with .Values.affinity }}
70+
affinity:
71+
{{- toYaml . | nindent 8 }}
72+
{{- end }}
73+
{{- with .Values.tolerations }}
74+
tolerations:
75+
{{- toYaml . | nindent 8 }}
76+
{{- end }}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: {{ include "docker-registry-ui.fullname" . }}
5+
namespace: {{ .Release.Namespace }}
6+
labels:
7+
{{- include "docker-registry-ui.labels" . | nindent 4 }}
8+
spec:
9+
type: {{ .Values.service.type }}
10+
{{- with .Values.service.ports }}
11+
ports:
12+
{{- toYaml . | nindent 4 }}
13+
{{- end }}
14+
selector:
15+
{{- include "docker-registry-ui.selectorLabels" . | nindent 4 }}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{{- if .Values.serviceAccount.create -}}
2+
apiVersion: v1
3+
kind: ServiceAccount
4+
metadata:
5+
name: {{ include "docker-registry-ui.serviceAccountName" . }}
6+
namespace: {{ .Release.Namespace }}
7+
labels:
8+
{{- include "docker-registry-ui.labels" . | nindent 4 }}
9+
{{- with .Values.serviceAccount.annotations }}
10+
annotations:
11+
{{- toYaml . | nindent 4 }}
12+
{{- end }}
13+
{{- end -}}

0 commit comments

Comments
 (0)