From a367d9f2e26f768902815ee608966398a413bd3d Mon Sep 17 00:00:00 2001 From: Steve Xuereb Date: Thu, 7 Dec 2023 10:25:07 +0100 Subject: [PATCH] docs: update exec command with namespace What --- Update the exec command to specify the namespace to connect to toolbox Why --- Following the current instructions: ```sh $ kubectl --namespace gitlab get pods -lapp=toolbox NAME READY STATUS RESTARTS AGE ops-gitlab-toolbox-6f7487f9d6-4tvjv 1/1 Running 0 2d7h ops-gitlab-toolbox-backup-28363740-nvjc2 0/1 Completed 0 32h ops-gitlab-toolbox-backup-28365180-t8gzr 0/1 Completed 0 8h $ kubectl exec -it ops-gitlab-toolbox-6f7487f9d6-4tvjv -- bash Error from server (NotFound): pods "ops-gitlab-toolbox-6f7487f9d6-4tvjv" not found ``` We need to specify `--namespace gitlab` ```sh $ kubectl exec --namespace gitlab -it ops-gitlab-toolbox-6f7487f9d6-4tvjv -- bash Defaulted container "toolbox" out of: toolbox, certificates (init), configure (init) ``` Signed-off-by: Steve Xuereb --- doc/troubleshooting/kubernetes_cheat_sheet.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/troubleshooting/kubernetes_cheat_sheet.md b/doc/troubleshooting/kubernetes_cheat_sheet.md index edca8d7758..26882808fd 100644 --- a/doc/troubleshooting/kubernetes_cheat_sheet.md +++ b/doc/troubleshooting/kubernetes_cheat_sheet.md @@ -127,7 +127,7 @@ and they will assist you with any issues you are having. kubectl --namespace gitlab get pods -lapp=toolbox # enter it - kubectl exec -it -- bash + kubectl --namespace gitlab exec -it -- bash # open rails console # rails console can be also called from other GitLab pods @@ -304,16 +304,16 @@ If you make any changes using the `toolbox` pod, those will not be persisted if To patch the source code in the `toolbox` pod: 1. Fetch the desired `.patch` file to be applied: - + - Either download the diff of a merge request directly as a [patch file](https://docs.gitlab.com/ee/user/project/merge_requests/reviews/#download-merge-request-changes-as-a-patch-file). - Or, fetch the diff directly using `curl`. Replace `` below with the IID of the merge request, or change the URL to point to a raw snippet: - + ```shell curl --output ~/.patch "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/.patch" ``` 1. Patch the local files on the `toolbox` pod: - + ```shell cd /srv/gitlab busybox patch -p1 -f < ~/.patch -- GitLab