30 Commits

Author SHA1 Message Date
Josh Sizer
3e91e96ea1 fix: use .Values.service.name 2024-03-15 17:38:46 -04:00
perangel
66d4da1f9a Support for setting the service name 2024-03-15 17:38:46 -04:00
Joshua Sizer
808510d274 Merge pull request #106 from ChevronTango/main
Adding Deployment Annotations
2024-03-15 17:13:04 -04:00
Edward Brough
c7d3bc3b42 adding deployment annotations
Signed-off-by: Edward Brough <edward.brough@gmail.com>
2024-03-15 17:25:42 +00:00
Joshua Sizer
baae5c6986 Merge pull request #117 from laverya/patch-1
Update README.md to use correct default version
2024-03-12 21:15:51 -04:00
Andrew Lavery
a03420f765 Update README.md to use correct default version 2024-03-12 11:19:31 -04:00
Vyas
7d16b3c57b Merge pull request #114 from ddelange/patch-3
Fix backwards compatibility for k8s 1.24
2024-03-08 09:49:40 -06:00
ddelange
c112edabe5 Revert version 2024-03-08 06:45:07 +01:00
ddelange
456d4f0308 Remove .github/workflows/healm_publish.yaml 2024-03-06 07:20:19 +01:00
Vyas
419a289a0e Merge pull request #102 from erikfuego/security-context-missing-fields
Add missing fields for Security context  and secrets
2024-03-05 13:59:41 -06:00
erikfuego
ed0a778281 Add missing fields for Security context and secrets 2024-03-04 12:36:40 -05:00
ddelange
9193ce0ae8 Bump chart version
This reverts commit 345f178c44ab853fb603dab5bba6c58eae3e954b.
2024-01-04 10:49:33 +01:00
ddelange
ebc2372fb4 Merge branch 'helm-publish' of https://github.com/ddelange/docker-registry.helm into patch-3
* 'helm-publish' of https://github.com/ddelange/docker-registry.helm:
  Publish helm chart as release asset
  Fix backwards compatibility for k8s 1.24
2024-01-04 10:20:52 +01:00
ddelange
38acafc680 Fix backwards compatibility for k8s 1.24 2024-01-04 10:20:25 +01:00
ddelange
a1b77cb212 Publish helm chart as release asset 2024-01-04 10:09:33 +01:00
ddelange
05d75cad63 Fix backwards compatibility for k8s 1.24 2024-01-04 10:01:08 +01:00
Devin Canterberry
d74c33abd9 Merge pull request #88 from syseleven/deprecation-1.25
Migrate PodDisruptionBudget policy/v1beta1 to policy/v1
2023-02-24 08:05:02 -08:00
Stefan Andres
fc2ab7e7ac Migrate PodDisruptionBudget policy/v1beta1 to policy/v1
In k8s 1.25 policy/v1beta1 is no longer served, migrate to policy/v1.

https://kubernetes.io/docs/reference/using-api/deprecation-guide/#v1-25
2022-12-13 15:58:54 +01:00
Devin Canterberry
405346f80e 🏁 v2.2.2 Release 2022-08-18 10:20:10 -07:00
Devin Canterberry
b152f62233 Merge pull request #79 from pieveee/fix/#73
fix extraVolumes and extraVolumeMounts (hypen typo) #78 #77
2022-08-18 10:19:07 -07:00
Michael Blickenstorfer
55647356c5 fix #73 2022-08-18 12:20:21 +02:00
Devin Canterberry
294d61f9d3 Merge pull request #75 from canterberry/remove-duplicate-check
🐞 Fix duplicate PR diff GitHub action and tweak test values
(approved by @ddelange)
2022-08-17 12:22:40 -07:00
Devin Canterberry
836f46131f 🚦 Hard-coding the "before" chart URL in the PR diff GitHub action
While this may not be strictly necessary, it's the correct resolution
enough of the time that the clarity of explicitly stating the "before"
is, I think, worth it.
2022-08-17 12:08:24 -07:00
Devin Canterberry
c7b3257baa 🚦 Add release namespace and target namespaces to PR diff action test values 2022-08-17 11:56:49 -07:00
Devin Canterberry
1315fc281e Merge pull request #65 from canterberry/namespaced-service-account
🐞 Add missing namespace to ServiceAccount
2022-08-17 11:50:50 -07:00
Devin Canterberry
635fd0fa0c Merge pull request #72 from edwargix/registr-2.8
Upgrade default image version from 2.7.1 to 2.8.1
2022-08-17 11:49:16 -07:00
Devin Canterberry
91dd5f2928 🚦 Add extraVolumes and extraVolumeMounts to PR diff GitHub action 2022-08-17 11:43:37 -07:00
Devin Canterberry
8ce5a40b47 🔥 Remove duplicate trigger for PR diff GitHub action 2022-08-17 11:40:34 -07:00
David Florness
96ad7c0eb4 Upgrade default image version from 2.7.1 to 2.8.1
Includes changes from releases 2.8.0 and 2.8.1, which mostly contain bugfixes:

- https://github.com/distribution/distribution/releases/tag/v2.8.0
- https://github.com/distribution/distribution/releases/tag/v2.8.1
2022-08-16 22:29:59 -04:00
Devin Canterberry
a1cd36f55e 🐞 Add missing namespace to ServiceAccount
When `serviceAccount.create` is `true`, this chart creates
a service account. Currently, that service account will be
created without an explicit namespace. This can be problematic
because the Deployment resource does have an explicit namespace
set. Because the ServiceAccount and Deployment (ultimately, the
Pod) must coexist in the same namespace, we need to follow the
same logic when setting the namespace for both.

Fixes https://github.com/twuni/docker-registry.helm/issues/60.
2022-07-27 23:50:13 -07:00
11 changed files with 41 additions and 18 deletions

View File

@@ -1,8 +1,8 @@
name: PR Diff for Helm chart
on:
pull_request:
pull_request_target:
permissions:
pull-requests: write
@@ -16,14 +16,20 @@ jobs:
id: diff
run: |
OPTIONS=(
--namespace meta-namespace
--set serviceAccount.create=true
--set priorityClassName=high
--set podAnnotations.test=annotation
--set extraEnvVars[0].name=TEST_NAME
--set extraEnvVars[0].value=TEST_VALUE
--set extraVolumes[0].name=test
--set extraVolumes[0].emptyDir.medium=Memory
--set extraVolumeMounts[0].name=test
--set extraVolumeMounts[0].mountPath=/test
--set secrets.htpasswd=abc
--set tlsSecretName=abc
--set garbageCollect.enabled=true
--set namespace=target-namespace
--set proxy.enabled=true
--set storage=s3
--set secrets.s3.secretKey=abc
@@ -32,7 +38,7 @@ jobs:
--set s3.bucket=abc
--set s3.encrypt=abc
)
helm template --debug ${OPTIONS[@]} --output-dir before ${{ github.server_url }}/${{ github.repository }}/archive/refs/heads/${{ github.base_ref }}.tar.gz
helm template --debug ${OPTIONS[@]} --output-dir before https://github.com/twuni/docker-registry.helm/archive/refs/heads/main.tar.gz
helm template --debug ${OPTIONS[@]} --output-dir after .
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#multiline-strings
echo 'HELM_DIFF<<EOF' >> $GITHUB_ENV

View File

@@ -1,8 +1,8 @@
apiVersion: v1
description: A Helm chart for Docker Registry
name: docker-registry
version: 2.2.1
appVersion: 2.7.1
version: 2.2.2
appVersion: 2.8.1
home: https://hub.docker.com/_/registry/
icon: https://helm.twun.io/docker-registry.png
maintainers:

View File

@@ -35,7 +35,7 @@ their default values.
|:----------------------------|:-------------------------------------------------------------------------------------------|:----------------|
| `image.pullPolicy` | Container pull policy | `IfNotPresent` |
| `image.repository` | Container image to use | `registry` |
| `image.tag` | Container image tag to deploy | `2.7.1` |
| `image.tag` | Container image tag to deploy | `2.8.1` |
| `imagePullSecrets` | Specify image pull secrets | `nil` (does not add image pull secrets to deployed pods) |
| `persistence.accessMode` | Access mode to use for PVC | `ReadWriteOnce` |
| `persistence.enabled` | Whether to use a PVC for the Docker storage | `false` |
@@ -46,6 +46,7 @@ their default values.
| `serviceAccount.create` | Create ServiceAccount | `false` |
| `serviceAccount.name` | ServiceAccount name | `nil` |
| `serviceAccount.annotations` | Annotations to add to the ServiceAccount | `{}` |
| `deployment.annotations` | Annotations to add to the Deployment | `{}` |
| `service.port` | TCP port on which the service is exposed | `5000` |
| `service.type` | service type | `ClusterIP` |
| `service.clusterIP` | if `service.type` is `ClusterIP` and this is non-empty, sets the cluster IP of the service | `nil` |

View File

@@ -168,7 +168,7 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
{{- end }}
{{- with .Values.extraVolumeMounts }}
{{- toYaml . }}
{{ toYaml . }}
{{- end }}
{{- end -}}
@@ -204,6 +204,6 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
{{- end }}
{{- with .Values.extraVolumes }}
{{- toYaml . }}
{{ toYaml . }}
{{- end }}
{{- end -}}

View File

@@ -38,9 +38,7 @@ spec:
priorityClassName: "{{ .Values.priorityClassName }}"
{{- end }}
{{- if .Values.securityContext.enabled }}
securityContext:
fsGroup: {{ .Values.securityContext.fsGroup }}
runAsUser: {{ .Values.securityContext.runAsUser }}
securityContext: {{ omit .Values.securityContext "enabled" | toYaml | nindent 12 }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
@@ -52,6 +50,9 @@ spec:
- --delete-untagged={{ .Values.garbageCollect.deleteUntagged }}
- /etc/docker/registry/config.yml
env: {{ include "docker-registry.envs" . | nindent 16 }}
{{- if .Values.containerSecurityContext.enabled }}
securityContext: {{ omit .Values.containerSecurityContext "enabled" | toYaml | nindent 16 }}
{{- end }}
volumeMounts: {{ include "docker-registry.volumeMounts" . | nindent 16 }}
restartPolicy: OnFailure
{{- if .Values.nodeSelector }}

View File

@@ -8,6 +8,10 @@ metadata:
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- if .Values.deployment.annotations }}
annotations:
{{ toYaml .Values.deployment.annotations | indent 4 }}
{{- end }}
spec:
selector:
matchLabels:
@@ -43,9 +47,7 @@ spec:
priorityClassName: "{{ .Values.priorityClassName }}"
{{- end }}
{{- if .Values.securityContext.enabled }}
securityContext:
fsGroup: {{ .Values.securityContext.fsGroup }}
runAsUser: {{ .Values.securityContext.runAsUser }}
securityContext: {{ omit .Values.securityContext "enabled" | toYaml | nindent 8 }}
{{- end }}
{{- with .Values.initContainers }}
initContainers:
@@ -82,6 +84,9 @@ spec:
port: 5000
resources: {{ toYaml .Values.resources | nindent 12 }}
env: {{ include "docker-registry.envs" . | nindent 12 }}
{{- if .Values.containerSecurityContext.enabled }}
securityContext: {{ omit .Values.containerSecurityContext "enabled" | toYaml | nindent 12 }}
{{- end }}
volumeMounts: {{ include "docker-registry.volumeMounts" . | nindent 12 }}
{{- if .Values.nodeSelector }}
nodeSelector: {{ toYaml .Values.nodeSelector | nindent 8 }}

View File

@@ -1,6 +1,6 @@
{{- if .Values.ingress.enabled -}}
{{- $apiVersions := .Capabilities.APIVersions -}}
{{- $serviceName := include "docker-registry.fullname" . -}}
{{- $serviceName := .Values.service.name | default (include "docker-registry.fullname" .) -}}
{{- $servicePort := .Values.service.port -}}
{{- $path := .Values.ingress.path -}}
apiVersion: {{- if $apiVersions.Has "networking.k8s.io/v1" }} networking.k8s.io/v1 {{- else }} networking.k8s.io/v1beta1 {{- end }}

View File

@@ -1,5 +1,9 @@
{{- if .Values.podDisruptionBudget -}}
{{- if .Capabilities.APIVersions.Has "policy/v1" -}}
apiVersion: policy/v1
{{- else}}
apiVersion: policy/v1beta1
{{- end }}
kind: PodDisruptionBudget
metadata:
name: {{ template "docker-registry.fullname" . }}

View File

@@ -1,7 +1,7 @@
apiVersion: v1
kind: Service
metadata:
name: {{ template "docker-registry.fullname" . }}
name: {{ .Values.service.name | default (include "docker-registry.fullname" .) }}
namespace: {{ .Values.namespace | default .Release.Namespace }}
labels:
app: {{ template "docker-registry.name" . }}

View File

@@ -7,6 +7,7 @@ metadata:
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
namespace: {{ .Values.namespace | default .Release.Namespace }}
{{- if .Values.serviceAccount.name }}
name: {{ .Values.serviceAccount.name }}
{{- else }}

View File

@@ -19,12 +19,14 @@ serviceAccount:
image:
repository: registry
tag: 2.7.1
tag: 2.8.1
pullPolicy: IfNotPresent
# imagePullSecrets:
# - name: docker
deployment: {}
# annotations:
service:
name: registry
name: ""
type: ClusterIP
# sessionAffinity: None
# sessionAffinityConfig: {}
@@ -152,6 +154,9 @@ configData:
interval: 10s
threshold: 3
containerSecurityContext:
enabled: false
securityContext:
enabled: true
runAsUser: 1000