mirror of
https://github.com/twuni/docker-registry.helm.git
synced 2026-02-24 00:43:48 +00:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b5ad18ea83 | ||
|
|
297f860dd6 | ||
|
|
c91c8139c5 | ||
|
|
4b5531d4ef | ||
|
|
489a5a25d9 | ||
|
|
2884368a08 | ||
|
|
5d738bd9e7 | ||
|
|
98bdab8c45 | ||
|
|
2703d08224 | ||
|
|
62c5b344a9 | ||
|
|
266b0ea8d8 |
@@ -1,7 +1,7 @@
|
||||
apiVersion: v1
|
||||
description: A Helm chart for Docker Registry
|
||||
name: docker-registry
|
||||
version: 1.16.0
|
||||
version: 2.1.0
|
||||
appVersion: 2.7.1
|
||||
home: https://hub.docker.com/_/registry/
|
||||
icon: https://helm.twun.io/docker-registry.png
|
||||
|
||||
@@ -61,6 +61,12 @@ their default values.
|
||||
| `podDisruptionBudget` | Pod disruption budget | `{}` |
|
||||
| `resources.limits.cpu` | Container requested CPU | `nil` |
|
||||
| `resources.limits.memory` | Container requested memory | `nil` |
|
||||
| `autoscaling.enabled` | Enable autoscaling using HorizontalPodAutoscaler | `false` |
|
||||
| `autoscaling.minReplicas` | Minimal number of replicas | `1` |
|
||||
| `autoscaling.maxReplicas` | Maximal number of replicas | `2` |
|
||||
| `autoscaling.targetCPUUtilizationPercentage` | Target average utilization of CPU on Pods | `60` |
|
||||
| `autoscaling.targetMemoryUtilizationPercentage` | (Kubernetes ≥1.23) Target average utilization of Memory on Pods | `60` |
|
||||
| `autoscaling.behavior` | (Kubernetes ≥1.23) Configurable scaling behavior | `{}` |
|
||||
| `priorityClassName ` | priorityClassName | `""` |
|
||||
| `storage` | Storage system to use | `filesystem` |
|
||||
| `tlsSecretName` | Name of secret for TLS certs | `nil` |
|
||||
@@ -95,6 +101,7 @@ their default values.
|
||||
| `ingress.path` | Ingress service path | `/` |
|
||||
| `ingress.hosts` | Ingress hostnames | `[]` |
|
||||
| `ingress.tls` | Ingress TLS configuration (YAML) | `[]` |
|
||||
| `ingress.className` | Ingress controller class name | `nginx` |
|
||||
| `metrics.enabled` | Enable metrics on Service | `false` |
|
||||
| `metrics.port` | TCP port on which the service metrics is exposed | `5001` |
|
||||
| `metrics.serviceMonitor.annotations` | Prometheus Operator ServiceMonitor annotations | `{}` |
|
||||
|
||||
@@ -29,6 +29,7 @@ spec:
|
||||
{{- end }}
|
||||
annotations:
|
||||
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
|
||||
checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
|
||||
{{- if $.Values.podAnnotations }}
|
||||
{{ toYaml $.Values.podAnnotations | indent 8 }}
|
||||
{{- end }}
|
||||
@@ -60,7 +61,7 @@ spec:
|
||||
- containerPort: 5000
|
||||
{{- if .Values.metrics.enabled }}
|
||||
- containerPort: {{ (split ":" .Values.configData.http.debug.addr)._1 }}
|
||||
name: metrics
|
||||
name: http-metrics
|
||||
protocol: TCP
|
||||
{{- end }}
|
||||
livenessProbe:
|
||||
|
||||
42
templates/hpa.yaml
Normal file
42
templates/hpa.yaml
Normal file
@@ -0,0 +1,42 @@
|
||||
{{- if .Values.autoscaling.enabled }}
|
||||
{{- $apiVersions := .Capabilities.APIVersions -}}
|
||||
{{- if $apiVersions.Has "autoscaling/v2" }}
|
||||
apiVersion: autoscaling/v2
|
||||
kind: HorizontalPodAutoscaler
|
||||
metadata:
|
||||
name: {{ template "docker-registry.fullname" . }}
|
||||
labels:
|
||||
app: {{ template "docker-registry.name" . }}
|
||||
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
spec:
|
||||
scaleTargetRef:
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
name: {{ template "docker-registry.fullname" . }}
|
||||
minReplicas: {{ .Values.autoscaling.minReplicas }}
|
||||
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
|
||||
metrics:
|
||||
{{- with .Values.autoscaling.targetCPUUtilizationPercentage }}
|
||||
- type: Resource
|
||||
resource:
|
||||
name: cpu
|
||||
target:
|
||||
type: Utilization
|
||||
averageUtilization: {{ . }}
|
||||
{{- end }}
|
||||
{{- with .Values.autoscaling.targetMemoryUtilizationPercentage }}
|
||||
- type: Resource
|
||||
resource:
|
||||
name: memory
|
||||
target:
|
||||
type: Utilization
|
||||
averageUtilization: {{ . }}
|
||||
{{- end }}
|
||||
{{- with .Values.autoscaling.behavior }}
|
||||
behavior:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
22
templates/hpaV1.yaml
Normal file
22
templates/hpaV1.yaml
Normal file
@@ -0,0 +1,22 @@
|
||||
{{- if .Values.autoscaling.enabled }}
|
||||
{{- $apiVersions := .Capabilities.APIVersions -}}
|
||||
{{- if not ($apiVersions.Has "autoscaling/v2") }}
|
||||
apiVersion: autoscaling/v1
|
||||
kind: HorizontalPodAutoscaler
|
||||
metadata:
|
||||
name: {{ template "docker-registry.fullname" . }}
|
||||
labels:
|
||||
app: {{ template "docker-registry.name" . }}
|
||||
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
spec:
|
||||
scaleTargetRef:
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
name: {{ template "docker-registry.fullname" . }}
|
||||
minReplicas: {{ .Values.autoscaling.minReplicas }}
|
||||
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
|
||||
targetCPUUtilizationPercentage: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -1,8 +1,9 @@
|
||||
{{- if .Values.ingress.enabled -}}
|
||||
{{- $apiVersions := .Capabilities.APIVersions -}}
|
||||
{{- $serviceName := include "docker-registry.fullname" . -}}
|
||||
{{- $servicePort := .Values.service.port -}}
|
||||
{{- $path := .Values.ingress.path -}}
|
||||
apiVersion: {{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1beta1" }} networking.k8s.io/v1beta1 {{- else }} extensions/v1beta1 {{- end }}
|
||||
apiVersion: {{- if $apiVersions.Has "networking.k8s.io/v1" }} networking.k8s.io/v1 {{- else }} networking.k8s.io/v1beta1 {{- end }}
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: {{ template "docker-registry.fullname" . }}
|
||||
@@ -20,15 +21,27 @@ metadata:
|
||||
{{ $key }}: {{ $value | quote }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if $apiVersions.Has "networking.k8s.io/v1" }}
|
||||
ingressClassName: {{ .Values.ingress.className }}
|
||||
{{- end }}
|
||||
rules:
|
||||
{{- range $host := .Values.ingress.hosts }}
|
||||
- host: {{ $host }}
|
||||
http:
|
||||
paths:
|
||||
- path: {{ $path }}
|
||||
{{- if $apiVersions.Has "networking.k8s.io/v1" }}
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: {{ $serviceName }}
|
||||
port:
|
||||
number: {{ $servicePort }}
|
||||
{{- else }}
|
||||
backend:
|
||||
serviceName: {{ $serviceName }}
|
||||
servicePort: {{ $servicePort }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
{{- if .Values.ingress.tls }}
|
||||
tls:
|
||||
|
||||
@@ -41,7 +41,7 @@ spec:
|
||||
{{- if .Values.metrics.enabled }}
|
||||
- port: {{ .Values.metrics.port }}
|
||||
protocol: TCP
|
||||
name: metrics
|
||||
name: http-metrics
|
||||
targetPort: {{ (split ":" .Values.configData.http.debug.addr)._1 }}
|
||||
{{- end }}
|
||||
selector:
|
||||
|
||||
@@ -16,6 +16,6 @@ spec:
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
endpoints:
|
||||
- port: metrics
|
||||
- port: http-metrics
|
||||
interval: 15s
|
||||
{{- end }}
|
||||
|
||||
25
values.yaml
25
values.yaml
@@ -37,6 +37,7 @@ service:
|
||||
# foo.io/bar: "true"
|
||||
ingress:
|
||||
enabled: false
|
||||
className: nginx
|
||||
path: /
|
||||
# Used to create an Ingress record.
|
||||
hosts:
|
||||
@@ -162,6 +163,30 @@ podDisruptionBudget: {}
|
||||
# maxUnavailable: 1
|
||||
# minAvailable: 2
|
||||
|
||||
autoscaling:
|
||||
enabled: false
|
||||
minReplicas: 1
|
||||
maxReplicas: 2
|
||||
targetCPUUtilizationPercentage: 60
|
||||
targetMemoryUtilizationPercentage: 60 # available only on Kubernetes ≥1.23 [required "autoscaling/v2"]
|
||||
behavior: {} # available only on Kubernetes ≥1.23 [required "autoscaling/v2"]
|
||||
# scaleDown:
|
||||
# stabilizationWindowSeconds: 300
|
||||
# policies:
|
||||
# - type: Percent
|
||||
# value: 100
|
||||
# periodSeconds: 15
|
||||
# scaleUp:
|
||||
# stabilizationWindowSeconds: 0
|
||||
# policies:
|
||||
# - type: Percent
|
||||
# value: 100
|
||||
# periodSeconds: 15
|
||||
# - type: Pods
|
||||
# value: 4
|
||||
# periodSeconds: 15
|
||||
# selectPolicy: Max
|
||||
|
||||
nodeSelector: {}
|
||||
|
||||
affinity: {}
|
||||
|
||||
Reference in New Issue
Block a user