Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

control-service: make image registry configurable #100

Merged
merged 1 commit into from
Aug 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,10 @@ Create the name of the service account to use


{{/*
Return the proper Pipelines Control Service image name
Return the proper Control Service image name
*/}}
{{- define "pipelines-control-service.image" -}}
{{- $globalRegistryOverrideName := .Values.image.globalRegistryOverride -}}
{{- $registryName := .Values.image.registry -}}
{{- $repositoryName := .Values.image.repository -}}
{{- $tag := .Values.image.tag | toString -}}
Expand All @@ -78,13 +79,60 @@ Helm 2.11 supports the assignment of a value to a variable defined in a differen
but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic.
Also, we can't use a single if because lazy evaluation is not an option
*/}}
{{- if .Values.global.imageRegistry }}
{{- if $globalRegistryOverrideName }}
{{- printf "%s/%s:%s" $globalRegistryOverrideName $repositoryName $tag -}}
{{- else if .Values.global.imageRegistry }}
{{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}}
{{- else -}}
{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}}
{{- end -}}
{{- end -}}

{{/*
Return the proper Control Service deployment builder image name
*/}}
{{- define "pipelines-control-service.deploymentBuilderImage" -}}
{{- $globalRegistryOverrideName := .Values.deploymentBuilderImage.globalRegistryOverride -}}
{{- $registryName := .Values.deploymentBuilderImage.registry -}}
{{- $repositoryName := .Values.deploymentBuilderImage.repository -}}
{{- $tag := .Values.deploymentBuilderImage.tag | toString -}}
{{/*
Helm 2.11 supports the assignment of a value to a variable defined in a different scope,
but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic.
Also, we can't use a single if because lazy evaluation is not an option
*/}}
{{- if $globalRegistryOverrideName }}
{{- printf "%s/%s:%s" $globalRegistryOverrideName $repositoryName $tag -}}
{{- else if .Values.global.imageRegistry }}
{{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}}
{{- else -}}
{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}}
{{- end -}}
{{- end -}}

{{/*
Return the proper Control Service vdk image used to run deployed data jobs
*/}}
{{- define "pipelines-control-service.deploymentVdkDistributionImage" -}}
{{- $globalRegistryOverrideName := .Values.deploymentVdkDistributionImage.globalRegistryOverride -}}
{{- $registryName := .Values.deploymentVdkDistributionImage.registry -}}
{{- $repositoryName := .Values.deploymentVdkDistributionImage.repository -}}
{{- $tag := .Values.deploymentVdkDistributionImage.tag | toString -}}
{{/*
Helm 2.11 supports the assignment of a value to a variable defined in a different scope,
but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic.
Also, we can't use a single if because lazy evaluation is not an option
*/}}
{{- if $globalRegistryOverrideName }}
{{- printf "%s/%s:%s" $globalRegistryOverrideName $repositoryName $tag -}}
{{- else if .Values.global.imageRegistry }}
{{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}}
{{- else -}}
{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}}
{{- end -}}
{{- end -}}


{{/*
Create the name of the deployment Kubernetes namespace used by Data Jobs
*/}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ spec:
- name: DOCKER_REPOSITORY_URL
value: "{{ .Values.deploymentDockerRepository }}"
- name: DOCKER_VDK_BASE_IMAGE
value: "{{ .Values.deploymentDockerVdkBaseImage }}"
value: {{ template "pipelines-control-service.deploymentVdkDistributionImage" . }}
- name: DATAJOBS_BUILDER_IMAGE
value: {{ template "pipelines-control-service.deploymentBuilderImage" . }}
- name: SERVER_MAX_HTTP_HEADER_SIZE
value: "{{ .Values.server.maxHttpHeaderSize }}"
- name: DB_JDBC_URL
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## Global Docker image parameters
## Please, note that this will override the image parameters, including dependencies, configured to use the global value
## Current available global Docker image parameters: imageRegistry and imagePullSecrets
## Set global.imageRegistry if you use docker proxy to the proxy prefix for versatiledataki.
##
global: {}
# imageRegistry: myRegistryName
Expand All @@ -19,6 +20,14 @@ image:
##
pullPolicy: Always

# The image configuration for builder jobs used during deployment of data jobs.
# Generally those should be left as it is.
deploymentBuilderImage:
registry: registry.hub.docker.com/versatiledatakit
repository: job-builder
tag: "1.0.5"


## String to partially override pipelines-control-service.fullname template (will maintain the release name)
##
# nameOverride:
Expand Down Expand Up @@ -168,13 +177,16 @@ deploymentDockerRegistryUsername: ""
deploymentDockerRegistryPassword: ""

## Image name of VDK which will be used to run the data jobs.
## It will use image with tag latest and will be pulled before any execution thus making sure jobs use the same and latest version of VDK.
## It is recommended to use image with same tag (e.g release or latest)
## As it will be pulled before any execution thus making sure all jobs use the same and latest version of VDK.
## The image should contain installation of VDK (vdk) which will be used to run the data jobs (vdk run command)
## Only the installed python modules (vdk and its dependencies) will be used from the image.
## Everything else is effectively discarded since another image is used as base during execution.
## Override if you build VDK SDK yourself instead of using one provided by default.
## (without https:// scheme)
deploymentDockerVdkBaseImage: "registry.hub.docker.com/versatiledatakit/quickstart-vdk:release"
deploymentVdkDistributionImage:
registry: registry.hub.docker.com/versatiledatakit
repository: quickstart-vdk
tag: "release"


## ini formatted options that provides default and per-job VDK options.
Expand Down