Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
pwright committed Mar 28, 2024
1 parent 2f62ff3 commit d0a5906
Show file tree
Hide file tree
Showing 4 changed files with 160 additions and 11 deletions.
39 changes: 38 additions & 1 deletion docs/docs/cli/podman.html
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ <h3 id="exposing-services-on-the-service-network-from-a-linux-host">Exposing ser
<li><code>expose</code> supports simple use cases, for example, a host with a single service.
See <a href="#exposing-simple-services-on-the-service-network">Exposing simple services on the service network</a> for instructions.</li>
<li><code>service create</code> and <code>service bind</code> is a more flexible method of exposing services, for example, if you have multiple services for a host.
See <a href="#exposing-complex-services">exposing-complex-services</a> for instructions.</li>
See <a href="#exposing-complex-services-on-the-service-network">Exposing complex services on the service network</a> for instructions.</li>
</ul>
<h4 id="exposing-simple-services-on-the-service-network">Exposing simple services on the service network</h4>
<p>This section describes how services can be enabled for a service network for simple use cases.</p>
Expand Down Expand Up @@ -292,6 +292,43 @@ <h4 id="exposing-simple-services-on-the-service-network">Exposing simple service
</code></pre>
</li>
</ol>
<h4 id="exposing-complex-services-on-the-service-network">Exposing complex services on the service network</h4>
<p>This section describes how services can be enabled for a service network for more complex use cases.</p>
<ul>
<li>A Skupper Podman site</li>
</ul>
<ol>
<li><p>Run a server, for example:</p>
<pre><code class="language-bash">$ podman run --name backend-target --network skupper --detach --rm -p 8080:8080 quay.io/skupper/hello-world-backend
</code></pre>
<p>This step is not Skupper-specific, that is, this process is unchanged from standard processes for your host.</p>
</li>
<li><p>Create a service that can communicate on the service network:</p>
<pre><code class="language-bash">$ skupper service create &lt;name&gt; &lt;port&gt;
</code></pre>
<p>where</p>
<ul>
<li><code>&lt;name&gt;</code> is the name of the service you want to create</li>
<li><code>&lt;port&gt;</code> is the port the service uses</li>
</ul>
<p>For the example deployment in step 1, you create a service using the following command:</p>
<pre><code class="language-bash">$ skupper service create hello-world-backend 8080
</code></pre>
</li>
<li><p>Bind the service to a cluster service:</p>
<pre><code class="language-bash">$ skupper service bind &lt;service-name&gt; &lt;target-type&gt; &lt;target-name&gt;
</code></pre>
<p>where</p>
<ul>
<li><code>&lt;service-name&gt;</code> is the name of the service on the service network</li>
<li><code>&lt;target-type&gt;</code> is the object you want to expose, <code>host</code> is the only current valid value.</li>
<li><code>&lt;target-name&gt;</code> is the name of the cluster service</li>
</ul>
<p>For the example deployment in step 1, you bind the service using the following command:</p>
<pre><code class="language-bash">$ skupper service bind hello-world-backend host hello-world-backend
</code></pre>
</li>
</ol>
<h4 id="consuming-simple-services-from-the-service-network">Consuming simple services from the service network</h4>
<p>Services exposed on Podman sites are not automatically available to other sites.
This is the equivalent to Kubernetes sites created using <code>skupper init --enable-service-sync false</code>.</p>
Expand Down
47 changes: 46 additions & 1 deletion input/docs/cli/podman.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ The `skupper` CLI has two options for exposing services that already exist on a
* `expose` supports simple use cases, for example, a host with a single service.
See [Exposing simple services on the service network](#exposing-simple-services-on-the-service-network) for instructions.
* `service create` and `service bind` is a more flexible method of exposing services, for example, if you have multiple services for a host.
See [exposing-complex-services](#exposing-complex-services) for instructions.
See [Exposing complex services on the service network](#exposing-complex-services-on-the-service-network) for instructions.
#### Exposing simple services on the service network
This section describes how services can be enabled for a service network for simple use cases.
Expand Down Expand Up @@ -266,6 +266,51 @@ This section describes how services can be enabled for a service network for sim
$ skupper service create backend 8080
```
#### Exposing complex services on the service network
This section describes how services can be enabled for a service network for more complex use cases.
* A Skupper Podman site
1. Run a server, for example:
```bash
$ podman run --name backend-target --network skupper --detach --rm -p 8080:8080 quay.io/skupper/hello-world-backend
```
This step is not Skupper-specific, that is, this process is unchanged from standard processes for your host.
2. Create a service that can communicate on the service network:
```bash
$ skupper service create <name> <port>
```
where
* `<name>` is the name of the service you want to create
* `<port>` is the port the service uses
For the example deployment in step 1, you create a service using the following command:
```bash
$ skupper service create hello-world-backend 8080
```
3. Bind the service to a cluster service:
```bash
$ skupper service bind <service-name> <target-type> <target-name>
```
where
* `<service-name>` is the name of the service on the service network
* `<target-type>` is the object you want to expose, `host` is the only current valid value.
* `<target-name>` is the name of the cluster service
For the example deployment in step 1, you bind the service using the following command:
```bash
$ skupper service bind hello-world-backend host hello-world-backend
```
#### Consuming simple services from the service network
Services exposed on Podman sites are not automatically available to other sites.
Expand Down
7 changes: 3 additions & 4 deletions subrepos/skupper-docs/cli/index.adoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
include::../partials/attributes.adoc[]
:context: skupper-kubernetes
//Category: skupper-cli
// Type: assembly
[id="skupper-cli"]
Expand Down Expand Up @@ -201,22 +200,22 @@ where `<link-name>` is the name of the link specified during creation.
include::link-cost.adoc[leveloffset=+1]

// Type: concept
[id="{context}_exposing-services-ns"]
[id="kubernetes_exposing-services-ns"]
== Exposing services on the {service-network} from a namespace

After creating a {service-network}, exposed services can communicate across that network.

The `skupper` CLI has two options for exposing services that already exist in a namespace:

* `expose` supports simple use cases, for example, a deployment with a single service.
See xref:skupper-kubernetes_exposing-simple-services[] for instructions.
See xref:kubernetes_exposing-simple-services[] for instructions.
* `service create` and `service bind` is a more flexible method of exposing services, for example, if you have multiple services for a deployment.
See xref:exposing-complex-services[] for instructions.
// Type: procedure
[id="skupper-kubernetes_exposing-simple-services"]
[id="kubernetes_exposing-simple-services"]
=== Exposing simple services on the {service-network}
This section describes how services can be enabled for a {service-network} for simple use cases.

Expand Down
78 changes: 73 additions & 5 deletions subrepos/skupper-docs/cli/podman.adoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
include::../partials/attributes.adoc[]
:context: skupper-podman
//Category: skupper-cli
// Type: assembly
[id='using-skupper-podman']
Expand Down Expand Up @@ -193,7 +192,7 @@ $ skupper link status
include::link-cost.adoc[leveloffset=+1]

// Type: concept
[id="{context}_exposing-services-ns"]
[id="podman_exposing-services-ns"]
== Exposing services on the {service-network} from a Linux host

After creating a {service-network}, exposed services can communicate across that network.
Expand All @@ -203,13 +202,13 @@ The general flow for working with services is the same for Kubernetes and Podman
The `skupper` CLI has two options for exposing services that already exist on a host:

* `expose` supports simple use cases, for example, a host with a single service.
See xref:skupper-podman_exposing-simple-services[] for instructions.
See xref:podman_exposing-simple-services[] for instructions.

* `service create` and `service bind` is a more flexible method of exposing services, for example, if you have multiple services for a host.
See xref:exposing-complex-services[] for instructions.
See xref:podman_exposing-complex-services[] for instructions.

// Type: procedure
[id="skupper-podman_exposing-simple-services"]
[id="podman_exposing-simple-services"]
=== Exposing simple services on the {service-network}
This section describes how services can be enabled for a {service-network} for simple use cases.

Expand Down Expand Up @@ -266,6 +265,75 @@ NOTE: You can specify more than one port by repeating this option.
$ skupper service create backend 8080
----


// Type: procedure
[id="podman_exposing-complex-services"]
=== Exposing complex services on the {service-network}

This section describes how services can be enabled for a {service-network} for more complex use cases.

.Prerequisites

* A Skupper Podman site

.Procedure

. Run a server, for example:
+
[source, bash]
----
$ podman run --name backend-target --network skupper --detach --rm -p 8080:8080 quay.io/skupper/hello-world-backend
----
+
This step is not Skupper-specific, that is, this process is unchanged from standard processes for your host.

. Create a service that can communicate on the {service-network}:
+
--
[source, bash]
----
$ skupper service create <name> <port>
----

where

* `<name>` is the name of the service you want to create
* `<port>` is the port the service uses

For the example deployment in step 1, you create a service using the following command:
[source, bash]
----
$ skupper service create hello-world-backend 8080
----


--

. Bind the service to a cluster service:
+
--
[source, bash]
----
$ skupper service bind <service-name> <target-type> <target-name>
----

where

* `<service-name>` is the name of the service on the {service-network}

* `<target-type>` is the object you want to expose, `host` is the only current valid value.

* `<target-name>` is the name of the cluster service

For the example deployment in step 1, you bind the service using the following command:
[source, bash]
----
$ skupper service bind hello-world-backend host hello-world-backend
----

--


// Type: procedure
[id="consuming-simple-services"]
=== Consuming simple services from the {service-network}
Expand Down

0 comments on commit d0a5906

Please sign in to comment.