-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[kots] Allow users to upload a .docker/config.json
file
#12174
Conversation
5a04f3f
to
e963107
Compare
81ecde6
to
21b2ed1
Compare
/werft run publish-to-kots 👍 started the job as gitpod-build-tar-kots-dockerconfig.20 |
@@ -174,8 +184,7 @@ spec: | |||
kubectl create secret docker-registry container-registry \ | |||
--namespace "{{repl Namespace }}" \ | |||
--from-file=.dockerconfigjson=/tmp/container-registry-secret \ | |||
-o yaml --dry-run=client | \ | |||
kubectl replace --namespace "{{repl Namespace }}" --force -f - | |||
-o yaml --dry-run=client > "${GITPOD_OBJECTS}/templates/gitpod.yaml" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed this to save the secret in the gitpod.yaml
, instead of applying so that we can post process it if the user submits more docker configs through the new option
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems a reasonable approach. This means that we'll have a secret at the start of the YAML file, but that shouldn't be a problem as it's what we're doing anyway
@Pothulapati what does the UX, specifically the user flow, look like here? When does a user set this and how - do they need to also set something else for this to take Affect? |
@lucasvaltl This adds a new config option in the
Not really, because this is automatically set everywhere to be used. They will have to obviously use the container image somewhere to actually use the functionality. 🤔 |
21b2ed1
to
107b284
Compare
107b284
to
e429538
Compare
@@ -79,6 +79,16 @@ spec: | |||
fi | |||
|
|||
echo "Gitpod: Generate the base Installer config" | |||
echo "Gitpod: Create a Helm template directory" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The echo "Gitpod: Generate the base Installer config"
line should go above the /app/installer init > "${CONFIG_FILE}"
so that the logging is representative of what's going on
@@ -174,8 +184,7 @@ spec: | |||
kubectl create secret docker-registry container-registry \ | |||
--namespace "{{repl Namespace }}" \ | |||
--from-file=.dockerconfigjson=/tmp/container-registry-secret \ | |||
-o yaml --dry-run=client | \ | |||
kubectl replace --namespace "{{repl Namespace }}" --force -f - | |||
-o yaml --dry-run=client > "${GITPOD_OBJECTS}/templates/gitpod.yaml" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems a reasonable approach. This means that we'll have a secret at the start of the YAML file, but that shouldn't be a problem as it's what we're doing anyway
706b2a6
to
4caf78e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/hold
Works beautifully. I've respectfully made a couple of suggestions on the config wording, but approved so you can merge when ready
Signed-off-by: Tarun Pothulapati <[email protected]>
4caf78e
to
5f32584
Compare
when: '{{repl ConfigOptionEquals "reg_docker_config_enable" "1" }}' | ||
type: file | ||
required: true | ||
help_text: Docker [config JSON file](https://docs.docker.com/engine/reference/commandline/cli/#sample-configuration-file) with auth credentials used to access private registries, for workspace images. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
help_text: Docker [config JSON file](https://docs.docker.com/engine/reference/commandline/cli/#sample-configuration-file) with auth credentials used to access private registries, for workspace images. | |
help_text: Docker [config JSON file](https://docs.docker.com/engine/reference/commandline/cli/#sample-configuration-file) with auth credentials used to access private registries used for pulling base workspace images. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
credentials used to access private registries used for pulling base workspace images.
Happy to update, but used to <> used for <>
sounds a bit confusing?
help_text: This is useful when you have base workspace images in private registries other than the above configured ones. | ||
|
||
- name: reg_docker_config | ||
title: Registry credentials |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
title: Registry credentials | |
title: Private base image registry credentials |
title: Configure additional registry credentials for pulling workspace images | ||
type: bool | ||
default: "0" | ||
help_text: This is useful when you have base workspace images in private registries other than the above configured ones. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
help_text: This is useful when you have base workspace images in private registries other than the above configured ones. | |
help_text: This is useful when you want to use base workspace images in private registries other than the above configured ones or the [default base workspace images stored on Docker Hub](https://github.com/gitpod-io/workspace-images). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some suggestions that you can merge right in. Otherwise LGTM, although I think we should hack around KOTS a bit to create a better separation between the push and pull registries here.
/unhold |
Follow up to #12174, and improves the help_text around the newly added fields. Signed-off-by: Tarun Pothulapati <[email protected]>
…owList` Follow upto #12174 This PR updates the installer logic to also load the auth's reigstry URL's into `.containerRegistry.privateBaseImageAllowList`. Signed-off-by: Tarun Pothulapati <[email protected]>
…owList` Follow upto #12174 This PR updates the installer logic to also load the auth's reigstry URL's into `.containerRegistry.privateBaseImageAllowList`. Signed-off-by: Tarun Pothulapati <[email protected]> Co-authored-by: Simon Emms <[email protected]> Co-authored-by: Simon Emms <[email protected]>
…owList` Follow upto #12174 This PR updates the installer logic to also load the auth's reigstry URL's into `.containerRegistry.privateBaseImageAllowList`. Signed-off-by: Tarun Pothulapati <[email protected]> Co-authored-by: Simon Emms <[email protected]> Co-authored-by: Simon Emms <[email protected]>
…owList` Follow upto #12174 This PR updates the installer logic to also load the auth's reigstry URL's into `.containerRegistry.privateBaseImageAllowList`. Signed-off-by: Tarun Pothulapati <[email protected]> Co-authored-by: Simon Emms <[email protected]> Co-authored-by: Nandaja Varma <[email protected]>
…owList` Follow upto #12174 This PR updates the installer logic to also load the auth's reigstry URL's into `.containerRegistry.privateBaseImageAllowList`. Signed-off-by: Tarun Pothulapati <[email protected]> Co-authored-by: Simon Emms <[email protected]> Co-authored-by: Nandaja Varma <[email protected]>
…owList` Follow upto #12174 This PR updates the installer logic to also load the auth's reigstry URL's into `.containerRegistry.privateBaseImageAllowList`. Signed-off-by: Tarun Pothulapati <[email protected]> Co-authored-by: Simon Emms <[email protected]> Co-authored-by: Nandaja Varma <[email protected]>
…owList` Follow upto #12174 This PR updates the installer logic to also load the auth's reigstry URL's into `.containerRegistry.privateBaseImageAllowList`. Signed-off-by: Tarun Pothulapati <[email protected]> Co-authored-by: Simon Emms <[email protected]> Co-authored-by: Nandaja Varma <[email protected]>
Description
This PR updates the
kots
UI to add a new config option to upload registrycredentials irrespective of the registry being used, which is then merged
into a single
config.json
file and passed as the registry secret whichis then used across the workspace image builder components.
Related Issue(s)
Fixes #12136
How to test
Upload a
dockerconfigjson
file through the new option,and see those credentials in the secret by running
Release Notes
Documentation
Werft options: