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

docs: mounting volumes, secrets and configmaps for devworkspaces #2296

Merged
merged 11 commits into from
May 3, 2022

This file was deleted.

This file was deleted.

This file was deleted.

8 changes: 4 additions & 4 deletions modules/end-user-guide/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
** xref:benefits-of-pull-requests-review-in-che.adoc[]
* xref:selecting-an-ide.adoc[]
* xref:customizing-workspaces-components.adoc[]
* xref:configuring-user-preferences-and-secrets.adoc[]
** xref:configuring-user-secrets.adoc[]
** xref:secret-as-a-file.adoc[]
** xref:secret-as-a-variable.adoc[]
* xref:mounting-volumes-secrets-and-configmaps.adoc[]
** xref:mounting-volumes.adoc[]
** xref:mounting-configmaps-and-secrets.adoc[]
** xref:git-credential-store.adoc[]
* xref:image-pull-secrets.adoc[]
* xref:integrating-with-kubernetes.adoc[]
** xref:automatic-token-injection.adoc[]
** xref:navigating-che-from-openshift-developer-perspective.adoc[]
Expand Down

This file was deleted.

40 changes: 0 additions & 40 deletions modules/end-user-guide/pages/configuring-user-secrets.adoc

This file was deleted.

106 changes: 106 additions & 0 deletions modules/end-user-guide/pages/image-pull-secrets.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
:navtitle: Creating image pull Secrets
:keywords: user-guide, configuring, user, secrets
:page-aliases:

[id="image-pull-secrets_{context}"]
= Creating image pull Secrets

You can create an image pull Secret containing credentials to allow {devworkspace} Pods to access private container registries.
dkwon17 marked this conversation as resolved.
Show resolved Hide resolved

An existing Docker credentials file such as `.dockercfg` or `$HOME/.docker/config.json` can be used to create the image pull Secret. Alternatively, the Secret can be created by running `{orch-cli} create secret docker-registry`.

== Create an image pull Secret with an existing `.dockercfg` or `config.json` file

.Prerequisites

* A running instance of {prod-short}.
* You have a `.dockercfg` or `$HOME/.docker/config.json` file containing credentials for the private container registry.
* You have CLI or GUI access to the {orch-name} cluster of your organization's {prod-short} instance.
* For CLI users: The `{orch-cli}` and link:https://www.gnu.org/software/coreutils/base64[`base64`] command line tools are installed in the operating system you are using.

.Procedure

. Encode the `.dockercfg` or `$HOME/.docker/config.json` file to Base64.
+
[TIP]
====
CLI users can use the `base64` command as needed:

`$ cat config.json | base64 | tr -d '\n'`
====

. Create a new {orch-name} Secret in your user {orch-namespace}.

* For `.dockercfg` create:
+
[source,yaml,subs="+quotes,+attributes,+macros"]
----
apiVersion: v1
kind: Secret
metadata:
name: __<Secret_name>__
labels:
controller.devfile.io/devworkspace_pullsecret: 'true'
controller.devfile.io/watch-secret: 'true'
data:
.dockercfg: __<Base64_content_of_.dockercfg>__
type: kubernetes.io/dockercfg
----

* For `$HOME/.docker/config.json` create:
+
[source,yaml,subs="+quotes,+attributes,+macros"]
----
apiVersion: v1
kind: Secret
metadata:
name: __<Secret_name>__
labels:
controller.devfile.io/devworkspace_pullsecret: 'true'
controller.devfile.io/watch-secret: 'true'
data:
.dockerconfigjson: __<Base64_content_of_.dockerconfigjson>__
type: kubernetes.io/dockerconfigjson
----

. Use the CLI or GUI to apply the Secret to the {orch-name} cluster of your organization's {prod-short} instance.

+
[TIP]
====
CLI users can apply the Secret with `{orch-cli}`:

[subs="+quotes,+attributes,+macros"]
----
$ {orch-cli} apply -f - <<EOF
__<Secret_prepared_in_the_previous_step>__
EOF
----
====

== Create an image pull Secret from scratch with {orch-cli}

.Prerequisites

* A running instance of {prod-short}.
* You have CLI access to the {orch-name} cluster of your organization's {prod-short} instance.

.Procedure

. In your user {orch-namespace}, create an image pull Secret with your private container registry details and credentials by running:
+
[subs="+quotes,+attributes,+macros"]
----
$ {orch-cli} create secret docker-registry __<Secret_name>__ \
--docker-server=__<registry_server>__ \
--docker-username=<user_name> \
--docker-password=<password> \
--docker-email=<email>
----

. Add the required label to the image pull Secret by running:
+
[subs="+quotes,+attributes,+macros"]
----
$ {orch-cli} label secret __<Secret_name>__ controller.devfile.io/devworkspace_pullsecret=true controller.devfile.io/watch-secret=true
----
Loading