Skip to content

Commit 419adb5

Browse files
authored
chore: add note about ssh passphrase when mounting bashrc (#1313)
Fix #1317 Signed-off-by: dkwon17 <[email protected]>
1 parent a7c016c commit 419adb5

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

docs/additional-configuration.adoc

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ When "file" is used, the configmap is mounted as a directory within the workspac
159159
## Adding image pull secrets to workspaces
160160
Labelling secrets with `controller.devfile.io/devworkspace_pullsecret: true` marks a secret as the Docker pull secret for the workspace deployment. This should be applied to secrets with docker config types (`kubernetes.io/dockercfg` and `kubernetes.io/dockerconfigjson`)
161161

162-
Note: As for automatically mounting secrets, it is necessary to apply the `controller.devfile.io/watch-secret` label to image pull secrets
162+
*Note:* As for automatically mounting secrets, it is necessary to apply the `controller.devfile.io/watch-secret` label to image pull secrets
163163

164164
## Adding git credentials to a workspace
165165
Labelling secrets with `controller.devfile.io/git-credential` marks the secret as containing git credentials. All git credential secrets will be merged into a single secret (leaving the original resources intact). The merged credentials secret is mounted to `/.git-credentials/credentials`. See https://git-scm.com/docs/git-credential-store#_storage_format[git documentation] for details on the file format for this configuration. For example
@@ -176,7 +176,7 @@ type: Opaque
176176
data:
177177
credentials: https://{USERNAME}:{PERSONAL_ACCESS_TOKEN}@{GIT_WEBSITE}
178178
----
179-
Note: As for automatically mounting secrets, it is necessary to apply the `controller.devfile.io/watch-secret` label to git credentials secrets
179+
*Note:* As for automatically mounting secrets, it is necessary to apply the `controller.devfile.io/watch-secret` label to git credentials secrets
180180
181181
This will mount a file `/tmp/.git-credentials/credentials` in all workspace containers, and construct a git config to use this file as a credentials store.
182182
@@ -215,6 +215,16 @@ kubectl create secret -n "$NAMESPACE" generic git-ssh-key \
215215
--from-file=ssh_config=/tmp/ssh_config \
216216
--from-literal=passphrase="$PASSPHRASE"
217217
----
218+
+
219+
*Note:* If a passphrase is provided, the DevWorkspace Operator adds a postStart event that starts the SSH agent and adds the passphrase.
220+
The DevWorkspace Operator also modifies the `~/.bashrc` to configure the `SSH_AGENT_PID` and `SSH_AUTH_SOCK` environment variables.
221+
If you are automatically mounting your own `~/.bashrc` with a ConfigMap (see link:additional-configuration.adoc#automatically-mounting-volumes-configmaps-and-secrets[Automatically mounting volumes, configmaps, and secrets])
222+
you must add the following in your `~/.bashrc`:
223+
+
224+
[source,bash]
225+
----
226+
[ -f $HOME/ssh-environment ] && source $HOME/ssh-environment
227+
----
218228
219229
3. Annotate the secret to configure automatic mounting to DevWorkspaces
220230
+

0 commit comments

Comments
 (0)