From 76ce8004059b9db539fc0518211619bcaee7f4cb Mon Sep 17 00:00:00 2001 From: Benjamin Affolter <5555767+bliemli@users.noreply.github.com> Date: Thu, 12 Oct 2023 14:41:07 +0200 Subject: [PATCH 1/2] Consolidate Kubernetes and OpenShift parts --- .../docs/additional-concepts/configmaps/_index.md | 15 ++------------- content/en/docs/troubleshooting/_index.md | 2 +- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/content/en/docs/additional-concepts/configmaps/_index.md b/content/en/docs/additional-concepts/configmaps/_index.md index 1201211a..19ff60e7 100644 --- a/content/en/docs/additional-concepts/configmaps/_index.md +++ b/content/en/docs/additional-concepts/configmaps/_index.md @@ -107,23 +107,12 @@ Here is a complete example Deployment of a sample Java app: This means that the container should now be able to access the ConfigMap's content in `/etc/config/java.properties`. Let's check: -{{% onlyWhen openshift %}} - -```bash -oc exec --namespace -- cat /etc/config/java.properties -``` - -{{% /onlyWhen %}} -{{% onlyWhenNot openshift %}} - ```bash -kubectl exec -it --namespace -- cat /etc/config/java.properties +{{% param cliToolName %}} exec --namespace -- cat /etc/config/java.properties ``` -{{% /onlyWhenNot %}} - {{% alert title="Note" color="info" %}} -On Windows, you can use Git Bash with `winpty kubectl exec -it --namespace -- cat //etc/config/java.properties`. +On Windows, you can use Git Bash with `winpty {{% param cliToolName %}} exec -it --namespace -- cat //etc/config/java.properties`. {{% /alert %}} {{< readfile file="/content/en/docs/additional-concepts/configmaps/java.properties" code="true" lang="yaml" >}} diff --git a/content/en/docs/troubleshooting/_index.md b/content/en/docs/troubleshooting/_index.md index dcc71ba4..07d8ff53 100644 --- a/content/en/docs/troubleshooting/_index.md +++ b/content/en/docs/troubleshooting/_index.md @@ -13,8 +13,8 @@ Running containers should be treated as immutable infrastructure and should ther ## {{% task %}} Shell into Pod -With {{% param distroName %}} you can open a remote shell into a Pod without installing SSH by using the command `{{% onlyWhenNot openshift %}}kubectl exec{{% /onlyWhenNot %}}{{% onlyWhen openshift %}}oc rsh{{% /onlyWhen %}}`. The command can also be used to execute any command in a Pod. {{% onlyWhenNot openshift %}}With the parameter `-it` you can leave an open connection.{{% /onlyWhenNot %}} +With {{% param distroName %}} you can open a remote shell into a Pod without installing SSH by using the command `{{% param cliToolName %}} {{% onlyWhenNot openshift %}}exec{{% /onlyWhenNot %}}{{% onlyWhen openshift %}}rsh{{% /onlyWhen %}}`. The command can also be used to execute any command in a Pod. {{% alert title="Note" color="info" %}} If you're using Git Bash on Windows, you need to append the command with `winpty`. From d274cb8f266104711e931eead6754ccee0d8e72c Mon Sep 17 00:00:00 2001 From: Benjamin Affolter <5555767+bliemli@users.noreply.github.com> Date: Thu, 12 Oct 2023 14:42:39 +0200 Subject: [PATCH 2/2] Correct statement regarding -ti parameters --- content/en/docs/troubleshooting/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/docs/troubleshooting/_index.md b/content/en/docs/troubleshooting/_index.md index 07d8ff53..d4fb4cd1 100644 --- a/content/en/docs/troubleshooting/_index.md +++ b/content/en/docs/troubleshooting/_index.md @@ -13,8 +13,8 @@ Running containers should be treated as immutable infrastructure and should ther ## {{% task %}} Shell into Pod -{{% onlyWhenNot openshift %}}With the parameter `-it` you can leave an open connection.{{% /onlyWhenNot %}} With {{% param distroName %}} you can open a remote shell into a Pod without installing SSH by using the command `{{% param cliToolName %}} {{% onlyWhenNot openshift %}}exec{{% /onlyWhenNot %}}{{% onlyWhen openshift %}}rsh{{% /onlyWhen %}}`. The command can also be used to execute any command in a Pod. +{{% onlyWhenNot openshift %}}If you want to get a shell to a running container, you will additionally need the parameters `-it`. These set up an interactive session where you can supply input to the process inside the container.{{% /onlyWhenNot %}} {{% alert title="Note" color="info" %}} If you're using Git Bash on Windows, you need to append the command with `winpty`.