-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(helm): add password protection to internal Docker registry
Fixes MODELIX-1058
- Loading branch information
Showing
8 changed files
with
62 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: "{{ include "modelix.fullname" . }}-docker-registry-secret" | ||
labels: | ||
component: docker-registry | ||
{{- include "modelix.labels" . | nindent 4 }} | ||
type: kubernetes.io/dockerconfigjson | ||
data: | ||
{{- $username := "docker-registry-user" }} | ||
# retrieve the secret data using lookup function and when not exists, return an empty dictionary / map as result | ||
{{- $secretObj := (lookup "v1" "Secret" .Release.Namespace (printf "%s%s" ( include "modelix.fullname" . ) "-docker-registry-secret")) | default dict }} | ||
{{- $secretData := (get $secretObj "data") | default dict }} | ||
{{- $password := (get $secretData "password" | b64dec ) | default (randAlphaNum 64) }} | ||
username: {{ $username | b64enc | quote }} | ||
password: {{ $password | b64enc | quote }} | ||
htpasswd: {{ (htpasswd $username $password) | b64enc | quote }} | ||
{{- $authValue := printf "%s:%s" $username $password | b64enc }} | ||
# Kubernetes accesses the internal registry through the static node port exposed at localhost. | ||
# The secrete used in `imagePullSecretes` needs to use this local address. | ||
{{- $registryLocal := printf "%s:%.0f" "localhost" .Values.internalDockerRegistry.nodePort }} | ||
.dockerconfigjson: {{ (printf "%s%s%s%s%s" "{ \"auths\": { \"" $registryLocal "\": {\"auth\": \"" $authValue "\"}}}") | b64enc | quote }} | ||
# Pods access a the registry by its service name. | ||
# They need an auth the uses the service name. | ||
{{- $registryServiceName := printf "%s%s" ( include "modelix.fullname" . ) "-docker-registry"}} | ||
.dockerconfigjsonUsingServiceName: {{ (printf "%s%s%s%s%s" "{ \"auths\": { \"" $registryServiceName ":5000\": {\"auth\": \"" $authValue "\"}}}") | b64enc | quote }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# Modelix core version. | ||
modelixCoreVersion=10.1.0-pr1190-817f4549 | ||
# Modelix Workspaces versions | ||
modelixWorkspacesVersion=0.5.0 | ||
modelixWorkspacesVersion=0.8.0 | ||
vncBaseImageVersion=0.8.3 |