Skip to content

Commit

Permalink
add expose command again as altenate
Browse files Browse the repository at this point in the history
  • Loading branch information
splattner committed Jul 3, 2023
1 parent 0d98c60 commit 537d381
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions content/en/docs/exposing-a-service/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ And then apply the file with:
{{% param cliToolName %}} apply -f svc-web-go.yaml --namespace <namespace>
```

There is also am imperative command to create a service and expose your application which can be used instead of the yaml file with the `{{% param cliToolName %}} apply ...` y command

```bash
{{% param cliToolName %}} expose deployment example-web-go --type=ClusterIP --name=example-web-go --port=5000 --target-port=5000 --namespace <namespace>
```

{{% onlyWhen openshift %}}
{{% onlyWhenNot baloise %}}
You will get the error message reading `Error from server (AlreadyExists): services "example-web-go" already exists` here. This is because the `oc new-app` command you executed during lab 3 already created a service. This is the default behavior of `oc new-app` while `oc create deployment` doesn't have this functionality.
Expand All @@ -45,6 +51,8 @@ As a consequence, the `oc expose` command above doesn't add anything new but it
{{% /onlyWhenNot %}}
{{% /onlyWhen %}}



Let's have a more detailed look at our Service:

```bash
Expand Down

0 comments on commit 537d381

Please sign in to comment.