Skip to content

Commit

Permalink
Podman update (#222)
Browse files Browse the repository at this point in the history
* podman updates
  • Loading branch information
pwright authored Feb 21, 2024
1 parent ccbaf08 commit 4cc6f1f
Show file tree
Hide file tree
Showing 5 changed files with 237 additions and 160 deletions.
7 changes: 7 additions & 0 deletions cli/gateway.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ After creating a {service-network}, you can expose services from a local machine

For example, if you run a database on a server in your data center, you can deploy a front end in a cluster that can access the data as if the database was running in the cluster.

[NOTE]
====
This documentation describes creating a gateway from a local host to a cluster site.
An alternative approach is to create a site on the local host and link to the cluster site.
See link:{podman-link} for information about using the Skupper CLI to create Podman sites.
====

// Type: procedure
[id="exposing-service-gateway"]
== Exposing simple local services to the {service-network}
Expand Down
86 changes: 3 additions & 83 deletions cli/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ client version {skupper-cli-version}
== Creating a site using the CLI

A {service-network} consists of Skupper sites.
This section describes how to create a site using the default settings.
This section describes how to create a site in a Kubernetes cluster using the default settings.
See link:{podman-link} for information about using the Skupper CLI to create Podman sites.

.Prerequisites

Expand Down Expand Up @@ -196,88 +197,7 @@ $ skupper link delete <link-name>
where `<link-name>` is the name of the link specified during creation.
--

// Type: procedure
[id="link-cost"]
== Specifying link cost

When linking sites, you can assign a cost to each link to influence the traffic flow.
By default, link cost is set to `1` for a new link.
In a {service-network}, the routing algorithm attempts to use the path with the lowest total cost from client to target server.

* If you have services distributed across different sites, you might want a client to favor a particular target or link.
In this case, you can specify a cost of greater than `1` on the alternative links to reduce the usage of those links.
+
NOTE: The distribution of open connections is statistical, that is, not a round robin system.
* If a connection only traverses one link, then the path cost is equal to the link cost.
If the connection traverses more than one link, the path cost is the sum of all the links involved in the path.
* Cost acts as a threshold for using a path from client to server in the network.
When there is only one path, traffic flows on that path regardless of cost.
+
NOTE: If you start with two targets for a service, and one of the targets is no longer available, traffic flows on the remaining path regardless of cost.
* When there are a number of paths from a client to server instances or a service, traffic flows on the lowest cost path until the number of connections exceeds the cost of an alternative path.
After this threshold of open connections is reached, new connections are spread across the alternative path and the lowest cost path.
.Prerequisite

* You have set your Kubernetes context to a site that you want to link _from_.
* A token for the site that you want to link _to_.
.Procedure

. Create a link to the {service-network}:
+
--
[source, bash]
----
$ skupper link create <filename> --cost <integer-cost>
----

where `<integer-cost>` is an integer greater than 1 and traffic favors lower cost links.

NOTE: If a service can be called without traversing a link, that service is considered local, with an implicit cost of `0`.

For example, create a link with cost set to `2` using a token file named `token.yaml`:

[source, bash]
----
$ skupper link create token.yaml --cost 2
----
--

. Check the link cost:
+
--
[source, bash]
----
$ skupper link status link1 --verbose
----

The output is similar to the following:

[source, bash]
----
Cost: 2
Created: 2022-11-17 15:02:01 +0000 GMT
Name: link1
Namespace: default
Site: default-0d99d031-cee2-4cc6-a761-697fe0f76275
Status: Connected
----
--

. Observe traffic using the console.
+
--
If you have a console on a site, log in and navigate to the processes for each server.
You can view the traffic levels corresponding to each client.

NOTE: If there are multiple clients on different sites, filter the view to each client to determine the effect of cost on traffic.
For example, in a two site network linked with a high cost with servers and clients on both sites, you can see that a client is served by the local servers while a local server is available.
--
include::link-cost.adoc[leveloffset=+1]

// Type: concept
[id="exposing-services-ns"]
Expand Down
82 changes: 82 additions & 0 deletions cli/link-cost.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
// Type: procedure
[id="link-cost"]
= Specifying link cost

When linking sites, you can assign a cost to each link to influence the traffic flow.
By default, link cost is set to `1` for a new link.
In a {service-network}, the routing algorithm attempts to use the path with the lowest total cost from client to target server.

* If you have services distributed across different sites, you might want a client to favor a particular target or link.
In this case, you can specify a cost of greater than `1` on the alternative links to reduce the usage of those links.
+
NOTE: The distribution of open connections is statistical, that is, not a round robin system.
* If a connection only traverses one link, then the path cost is equal to the link cost.
If the connection traverses more than one link, the path cost is the sum of all the links involved in the path.
* Cost acts as a threshold for using a path from client to server in the network.
When there is only one path, traffic flows on that path regardless of cost.
+
NOTE: If you start with two targets for a service, and one of the targets is no longer available, traffic flows on the remaining path regardless of cost.
* When there are a number of paths from a client to server instances or a service, traffic flows on the lowest cost path until the number of connections exceeds the cost of an alternative path.
After this threshold of open connections is reached, new connections are spread across the alternative path and the lowest cost path.
.Prerequisite

* You have set your Kubernetes context to a site that you want to link _from_.
* A token for the site that you want to link _to_.
.Procedure

. Create a link to the {service-network}:
+
--
[source, bash]
----
$ skupper link create <filename> --cost <integer-cost>
----

where `<integer-cost>` is an integer greater than 1 and traffic favors lower cost links.

NOTE: If a service can be called without traversing a link, that service is considered local, with an implicit cost of `0`.

For example, create a link with cost set to `2` using a token file named `token.yaml`:

[source, bash]
----
$ skupper link create token.yaml --cost 2
----
--

. Check the link cost:
+
--
[source, bash]
----
$ skupper link status link1 --verbose
----

The output is similar to the following:

[source, bash]
----
Cost: 2
Created: 2022-11-17 15:02:01 +0000 GMT
Name: link1
Namespace: default
Site: default-0d99d031-cee2-4cc6-a761-697fe0f76275
Status: Connected
----
--

. Observe traffic using the console.
+
--
If you have a console on a site, log in and navigate to the processes for each server.
You can view the traffic levels corresponding to each client.

NOTE: If there are multiple clients on different sites, filter the view to each client to determine the effect of cost on traffic.
For example, in a two site network linked with a high cost with servers and clients on both sites, you can see that a client is served by the local servers while a local server is available.
--
Loading

0 comments on commit 4cc6f1f

Please sign in to comment.