Skip to content

Commit

Permalink
Merge pull request #566 from acend/optimizations
Browse files Browse the repository at this point in the history
Optimizations/consolidations
  • Loading branch information
splattner authored Jan 19, 2024
2 parents 025f658 + 6cd4ce1 commit 8dd6d41
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
15 changes: 2 additions & 13 deletions content/en/docs/additional-concepts/configmaps/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <pod name> --namespace <namespace> -- cat /etc/config/java.properties
```

{{% /onlyWhen %}}
{{% onlyWhenNot openshift %}}

```bash
kubectl exec -it <pod> --namespace <namespace> -- cat /etc/config/java.properties
{{% param cliToolName %}} exec <pod> --namespace <namespace> -- cat /etc/config/java.properties
```

{{% /onlyWhenNot %}}

{{% alert title="Note" color="info" %}}
On Windows, you can use Git Bash with `winpty kubectl exec -it <pod> --namespace <namespace> -- cat //etc/config/java.properties`.
On Windows, you can use Git Bash with `winpty {{% param cliToolName %}} exec -it <pod> --namespace <namespace> -- cat //etc/config/java.properties`.
{{% /alert %}}

{{< readfile file="/content/en/docs/additional-concepts/configmaps/java.properties" code="true" lang="yaml" >}}
Expand Down
4 changes: 2 additions & 2 deletions content/en/docs/troubleshooting/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
{{% 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`.
Expand Down

0 comments on commit 8dd6d41

Please sign in to comment.