Skip to content

Commit e0a5bc1

Browse files
committed
Updates for uplink docs
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
1 parent 122dfb2 commit e0a5bc1

11 files changed

+160
-60
lines changed
750 KB
Loading
687 KB
Loading
785 KB
Loading

docs/uplink/connect-to-tunnels.md renamed to docs/uplink/connect-tunnel-client.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Connect to tunnels
1+
# Connect the tunnel client
22

33
The tunnel plugin for the inlets-pro CLI can be used to get connection instructions for a tunnel.
44

docs/uplink/create-tunnels.md

Lines changed: 48 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
1-
# Create a tunnel for a customer
1+
# Create a tunnel
22

3-
## Use separate namespaces for your tunnels
3+
## Create a namespace for the tunnel
44

5-
The `inlets` namespace contains the control plane for inlets uplink, so you'll need to create at least one additional namespace for your customer tunnels.
5+
The `inlets` namespace contains the control plane for inlets uplink and should not be used to host tunnels.
66

7-
1. Create a namespace per customer (recommended)
7+
So you'll need to create at least one additional namespace for your tunnels.
8+
9+
=== "One namespace per tenant"
810

911
This approach avoids conflicts on names, and gives better isolation between tenants.
1012

1113
After creating the tunnel, you'll also need to label it `inlets.dev/uplink=1`
1214

1315
```bash
14-
kubectl create namespace acmeco
15-
kubectl label --overwrite namespace acmeco "inlets.dev/uplink"=1
16+
export NS="tenant1"
17+
kubectl create namespace $NS
18+
kubectl label --overwrite namespace $NS "inlets.dev/uplink"=1
1619
```
1720

1821
Then, create a copy of the license secret in the new namespace:
1922

2023
```bash
21-
export NS="n1"
24+
export NS="tenant1"
2225
export LICENSE=$(kubectl get secret -n inlets inlets-uplink-license -o jsonpath='{.data.license}' | base64 -d)
2326

2427
kubectl create secret generic \
@@ -27,27 +30,44 @@ The `inlets` namespace contains the control plane for inlets uplink, so you'll n
2730
--from-literal license=$LICENSE
2831
```
2932

30-
2. A single namespace for all customer tunnels (not recommended)
33+
=== "One namespace for all tunnels"
34+
35+
For development purposes, you could create a single namespace for all your tenants.
3136

32-
For development purposes, you could create a single namespace for all your customers.
37+
After creating the tunnel, you'll also need to label it `inlets.dev/uplink=1`\
3338

3439
```bash
35-
kubectl create namespace tunnels
40+
export NS="tunnels"
41+
kubectl create namespace $NS
42+
kubectl label --overwrite namespace $NS "inlets.dev/uplink"=1
3643
```
3744

38-
Finally, if you're using Istio, then you need to label each additional namespace to enable sidecar injection:
45+
Then, create a copy of the license secret in the new namespace:
3946

47+
```bash
48+
export NS="tunnels"
49+
export LICENSE=$(kubectl get secret -n inlets inlets-uplink-license -o jsonpath='{.data.license}' | base64 -d)
50+
51+
kubectl create secret generic \
52+
-n $NS \
53+
inlets-uplink-license \
54+
--from-literal license=$LICENSE
55+
```
56+
57+
If you're using Istio, then you need to label each additional namespace to enable sidecar injection:
4058

4159
```bash
42-
kubectl label namespace inlets \
60+
export NS="tunnels"
61+
62+
kubectl label namespace $NS \
4363
istio-injection=enabled --overwrite
4464
```
4565

4666
## Create a Tunnel with an auto-generated token
4767

48-
`Tunnel` describes an inlets-uplink tunnel server. The specification describes a set of ports to use for TCP tunnels.
68+
The `Tunnel` Custom Resource describes an inlets-uplink tunnel server. You can specify a reference to a pre-existing Kubernetes secret for the token, or have one generated for you.
4969

50-
For example the following Tunnel configuration sets up a http tunnel on port `8000` by default and adds port `8080` for use with TCP tunnels. The `licenceRef` needs to reference a secret containing an inlets-uplink license.
70+
The below configures a tunnel for a customer called `acmeco` in the `tunnels` namespace. Port 8080 is exposed as a TCP tunnel, and the `licenceRef` needs to reference a secret containing an inlets-uplink license.
5171

5272
```yaml
5373
apiVersion: uplink.inlets.dev/v1alpha1
@@ -71,13 +91,19 @@ inlets-pro tunnel create acmeco \
7191
--port 8080
7292
```
7393

94+
Once created, you can check the status of the tunnel, and you will see a secret was generated for the token.
95+
96+
```bash
97+
kubectl get -n tunnels tunnel/acmeco
98+
```
99+
74100
## Create a Tunnel with a pre-defined token
75101

76102
If you delete a Tunnel with an auto-generated token, and re-create it later, the token will change. So we recommend that you pre-define your tokens. This style works well for GitOps and automated deployments with Helm.
77103

78104
Make sure the secret is in the same namespace as the Tunnel Custom Resource.
79105

80-
You can use `openssl` to generate a secure token:
106+
You can use `openssl` to generate a strong token:
81107

82108
```bash
83109
openssl rand -base64 32 |tr -d '\n' > token.txt
@@ -105,14 +131,16 @@ spec:
105131
licenseRef:
106132
name: inlets-uplink-license
107133
namespace: tunnels
108-
tokenRef:
109-
name: acmeco-token
110-
namespace: tunnels
134+
+ tokenRef:
135+
+ name: acmeco-token
136+
+ namespace: tunnels
111137
tcpPorts:
112138
- 8080
113139
```
114140
115-
Clients can now connect to the tunnel using the custom token.
141+
The `tokenRef` section is used to reference the secret containing the token.
142+
143+
Clients can now connect to the tunnel using the pre-defined token.
116144

117145
### Node selection and annotations for tunnels
118146

@@ -135,7 +163,7 @@ spec:
135163
tcpPorts:
136164
- 8080
137165
podAnnotations:
138-
cutomer: acmeco
166+
customer: acmeco
139167
nodeSelector:
140168
region: east
141169
```

docs/uplink/ingress-for-tunnels.md renamed to docs/uplink/expose-tunnels.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Ingress for tunnels
1+
# How to Expose Tunnels on the Internet
22

33
!!! info
44

@@ -8,8 +8,14 @@
88

99
Each inlets uplink tunnel is provisioned with a ClusterIP service that you can access internally within the cluster. The same service can be used to expose the tunnel to the public Internet using an Ingress resource. This approach is recommended for new users for dozens of tunnels.
1010

11+
[![Each tunnel's data-plane is exposed via a separate Ingress and Certificate](/images/uplink/ingress-per-data-plane.png)](/images/uplink/ingress-per-data-plane.png)
12+
> Each tunnel's data-plane is exposed via a separate Ingress and Certificate
13+
1114
Alternatively, the data-router component can be used along with a wild-card DNS record and TLS certificate to expose many tunnels with a single Ingress record or Istio Gateway. This approach requires additional setup because the DNS01 challenge requires a special cert-manager Issuer with a secret for the DNS provider's API. It is recommended for users with many tunnels, but is more complex to setup.
1215

16+
[![A single certificate and Ingress record can be used for multiple tunnels](/images/uplink/wildcard-ingress.png)](/images/uplink/wildcard-ingressplane.png)
17+
> A single certificate and Ingress record can be used for multiple tunnels
18+
1319
## Quick start
1420

1521
The instructions assume that you want to expose two HTTP tunnels. We will configure ingress for the first tunnel, called `grafana`, on the domain `grafana.example.com`. The second tunnel, called `openfaas`, will use the domain `openfaas.example.com`.
@@ -287,6 +293,8 @@ After applying these resources you should be able to access the data plane for b
287293
288294
As an alternative to creating individual sets of Ingress records, DNS A/CNAME entries and TLS certificates for each tunnel, you can use the `data-router` to route traffic to the correct tunnel based on the hostname. This approach uses a wildcard DNS entry and a single TLS certificate for all tunnels.
289295
296+
To enable the data-router, you will need to modify the values.yaml file you created during the [initial installation](/uplink/installation/) of the Inlets Uplink Helm chart.
297+
290298
The following example is adapted from the cert-manager documentation to use DigitalOcean's DNS servers, however you can find [instructions for issuers](https://cert-manager.io/docs/configuration/acme/dns01/) such as AWS Route53, Cloudflare, Google Cloud DNS, and AzureDNS being listed.
291299
292300
DNS01 challenges require a secret to be created containing the credentials for the DNS provider. The secret is referenced by the issuer resource.
@@ -356,7 +364,7 @@ helm upgrade --install inlets-uplink \
356364
--values ./values.yaml
357365
```
358366
359-
Create a tunnel with an Ingress Domain specified in the `.Spec` field:
367+
You can now create a new tunnel or modify an existing one and specify the hostname you want to use under the `ingressDomains` field. This field is an array and can take more than one hostname, depending on how many services you want to expose via the tunnel.
360368
361369
```bash
362370
export TUNNEL_NS="tunnels"

docs/uplink/index.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,32 @@
22

33
!!! info "What's the difference between Inlets Pro and Inlets Uplink?"
44

5-
Inlets Pro is a stand-alone binary that can be use to expose local HTTPs and TCP services on a remote machine or network.
5+
Inlets Pro is a stand-alone binary that can be use to expose local HTTPs and TCP services on a remote machine or network. This is the easiest option for individuals and small teams.
66

7-
Inlets Uplink is a complete management solution for tunnels for SaaS companies and service providers. It's designed for scale, multi-tenancy and easy management.
7+
Inlets Uplink is a complete management solution for tunnels for SaaS companies, infrastructure teams, and service providers. It's designed for scale, multi-tenancy and automation.
88

9-
Inlets Uplink is our answer to the question: "How do you access customer services from within your own product?"
9+
Inlets Uplink answers two primary questions:
1010

11-
You may consider building your own agent, using a AWS SQS queue, or a VPN.
11+
1. "How do you access customer services from within your own product?"
12+
2. "How to we provide tunnels as a managed service?"
1213

13-
The first two options involve considerable work both up front and in the long run. VPNs require firewall changes, specific network conditions, and lengthy paperwork.
14+
In the first case, of accessing private customer services, you have have already considered building your own agent, using a queue, or a VPN.
1415

15-
Inlets Uplink uses a TLS encrypted websocket to make an outbound connection, and can also work over corporate HTTP proxies.
16+
The first two options involve considerable work both up front and in the long run. VPNs require firewall changes, specific network conditions, additional paperwork, and can have prohibitive costs associated with them.
1617

17-
Here are some of the other differences between Inlets Pro and Inlets Uplink:
18+
The Inlets Uplink runs inside a private network to connect to a public server endpoint using an outbound HTTP connection. Once established, the TLS-encrypted connection is upgraded to a websocket for bi-directional communication. This means it works over NAT, firewalls, and HTTP proxies.
1819

19-
* The management solution is built-in, self-hosted and runs on your Kubernetes cluster
20+
Here are some of the other differences between stand-alone Inlets Pro and Inlets Uplink:
21+
22+
* The management solution is built-in, self-hosted and runs on your own Kubernetes cluster
2023
* You can create a tunnel almost instantly via CLI, REST API or the "Tunnel" Custom Resource
21-
* The license is installed on the server, instead of each client needing it
22-
* TCP ports can be remapped to avoid conflicts
24+
* The license is installed on the server, instead of being attached to the client, to make it easier to give out a connection command to customers and team members
25+
* When exposing TCP ports, they can be remapped to avoid conflicts or needing privileged ports
2326
* A single tunnel can expose HTTP and TCP at the same time
2427
* All tunnels can be monitored centrally for reliability and usage
2528
* By default all tunnels are private and only available for access by your own applications
26-
27-
With Uplink, you deploy tunnel servers for a customers to your Kubernetes cluster, and our operator takes care of everything else.
29+
* Tunnels can also be managed through Helm, ArgoCD or Flux for a GitOps workflow
2830

2931
You can read more about why we created inlets uplink [in the product announcement](https://inlets.dev/blog/2022/11/16/service-provider-uplinks.html).
3032

31-
Reach out to us if you have questions: [Contact the inlets team](https://inlets.dev/contact)
33+
Reach out to us if you have questions or would like to see a demo: [Contact the inlets team](https://inlets.dev/contact)

docs/uplink/become-a-provider.md renamed to docs/uplink/installation.md

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
# Become an inlets uplink provider
1+
# Install Inlets Uplink
22

3-
inlets uplink makes it easy for Service Providers and SaaS companies to deliver their product and services to customer networks.
3+
Inlets Uplink requires a Kubernetes cluster, and an inlets uplink subscription.
44

5-
To become a provider, you'll need a Kubernetes cluster, an inlets uplink subscription and to install the inlets-uplink-provider Helm chart.
5+
The installation is performed through a Helm chart (inlets-uplink-provider)) which is published as an OCI artifact in a container registry.
66

7-
- [Read the Inlets Uplink announcement](https://inlets.dev/blog/2022/11/16/service-provider-uplinks.html)
7+
The default installation keeps tunneled services private, with only the control-plane exposed to the public Internet. To expose the data-plane for one or more tunnels, after you've completed the installation, see the page [Expose tunnels](/uplink/expose-tunnels/).
88

99
## Before you start
1010

1111
Before you start, you'll need the following:
1212

13-
* A Kubernetes cluster with LoadBalancer capabilities (i.e. public cloud).
13+
* A Kubernetes cluster where you can create a LoadBalancer i.e. a managed Kubernetes service like AWS EKS, Azure AKS, Google GKE, etc.
1414
* A domain name clients can use to connect to the tunnel control plane.
1515
* An inlets uplink license (an inlets-pro license cannot be used)
1616
* Optional: [arkade](https://github.com/alexellis/arkade) - a tool for installing popular Kubernetes tools
@@ -21,25 +21,23 @@ Before you start, you'll need the following:
2121
curl -sSLf https://get.arkade.dev/ | sudo sh
2222
```
2323

24-
Inlets uplink has its own independent subscription from inlets-pro.
25-
26-
Sign-up here: [inlets uplink plans](https://subscribe.openfaas.com/).
24+
You can obtain a subscription for inlets uplink here: [inlets uplink plans](https://inlets.dev/pricing).
2725

2826
## Create a Kubernetes cluster
2927

3028
We recommend creating a Kubernetes cluster with a minimum of three nodes. Each node should have a minimum of 2GB of RAM and 2 CPU cores.
3129

3230
## Install cert-manager
3331

34-
Install [cert-manager](https://cert-manager.io/docs/), which is used to manage TLS certificates for inlets-uplink.
32+
Install [cert-manager](https://cert-manager.io/docs/), which is used to manage TLS certificates for inlets-uplink for the control-plane and the REST API.
3533

3634
You can use Helm, or arkade:
3735

3836
```bash
3937
arkade install cert-manager
4038
```
4139

42-
## Create a namespace for the inlets-uplink-provider and install your license
40+
## Create a namespace for the chart and add the license secret
4341

4442
Make sure to create the target namespace for you installation first.
4543

@@ -72,21 +70,15 @@ kubectl create secret generic \
7270
--from-file license=$HOME/.inlets/LICENSE_UPLINK
7371
```
7472
75-
## Setup up ingress for customer tunnels
76-
77-
Tunnels on your customers' network will connect to your own inlets-uplink-provider.
73+
## Setup up Ingress for the control-plane
7874
79-
There are two options for deploying the inlets-uplink-provider.
75+
Tunnel clients will connect to the client-router component which needs to be exposed via Ingress.
8076
81-
Use Option A if you're not sure, if your team already uses Istio or prefers Istio, use Option B.
77+
You can use Kubernetes Ingress or Istio. We recommend using Ingress (Option A), unless your team or organisation is already using Istio (Option B).
8278
8379
### A) Install with Kubernetes Ingress
8480
85-
We recommend ingress-nginx, and have finely tuned the configuration to work well for the underlying websocket for inlets. That said, you can change the IngressController if you wish.
86-
87-
!!! note "Chart configuration changes - Sept 2024"
88-
89-
The configuration for a built-in issuer, and some ingress configuration has now moved up one level from the clientRouter, dataRouter, clientApi etc, to the top level of values.yaml. This is a breaking change and you will need to update your values.yaml file before upgrading the chart.
81+
We recommend [ingress-nginx](https://github.com/kubernetes/ingress-nginx) for Ingress, and have finely tuned the configuration to work well for the underlying websocket for inlets. If your organisation uses a different Ingress Controller, you can alter the `class` fields in the chart.
9082
9183
Install ingress-nginx using arkade or Helm:
9284

docs/uplink/manage-tunnels.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Manage customer tunnels
1+
# Manage tunnels
22

33
You can use `kubectl` or the tunnel plugin for the `inlets-pro` CLI to manage tunnels.
44

docs/uplink/private-tunnels.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
## Access tunnels privately
2+
3+
By default, only the control-plane is made public, and the data-plane is kept private.
4+
5+
This suits two use-cases:
6+
7+
* A SaaS or Service Provider who needs to give customers a way to tunnel a private endpoint or service to their control plane
8+
* An infrastructure team managing their own applications or services across multiple environments
9+
10+
Once the [tunnel client is connected](/uplink/connect-tunnel-client/), the data-plane of the tunnel can be access from within the Inlets Uplink control-plane cluster.
11+
12+
You can deploy your applications to the management Kubernetes Cluster, then access them via the tunnel's ClusterIP just like they were running directly within your cluster.
13+
14+
The traffic will go to the ClusterIP, which points at the tunnel server's data-plane ports, which then causes a connection to be dialed back to the client.
15+
16+
[![Uplink with no external ingress or exposed tunnels](/images/uplink/no-external-ingress.png)](/images/uplink/no-external-ingress.png)
17+
> Uplink with no external ingress or exposed tunnels
18+
19+
If you need external ingress for one or more tunnels, then you should see the [expose tunnels](/uplink/expose-tunnels/) page.
20+
21+
### Access a TCP service via ClusterIP
22+
23+
If you have forwarded a TCP service, then you can access it via the ClusterIP of the service.
24+
25+
Let's say that you port-forwarded SSH and remapped port 22 to 2222 to avoid needing to use any additional privileged for the tunnel server Pod:
26+
27+
```bash
28+
kubectl run -t -i --rm tcp-access --image=ubuntu --restart=Never -- sh
29+
```
30+
31+
Then from within the pod, you can access the service via the ClusterIP:
32+
33+
```bash
34+
# apt update
35+
# apt install -qy openssh-client
36+
37+
# ssh -p 2222 [email protected]
38+
```
39+
40+
The address is made up of the tunnel name plus the namespace you used for the customer.
41+
42+
### Access a HTTP service via ClusterIP
43+
44+
If you have forwarded an HTTP service, then you can access it via the ClusterIP of the service, using port 8000.
45+
46+
If you have forwarded multiple HTTP endpoints, use the HTTP "Host" header to access one or the other.
47+
48+
```bash
49+
kubectl run -t -i --rm http-access --image=ubuntu --restart=Never -- sh
50+
```
51+
52+
Then from within the pod, you can access the service via the ClusterIP:
53+
54+
```bash
55+
# apt update
56+
# apt install -qy curl
57+
58+
# curl -i http://tunnel1.customer1:8000
59+
```
60+
61+
To access a specific domain, use the HTTP "Host" header:
62+
63+
```bash
64+
# apt update
65+
# apt install -qy curl
66+
67+
# curl -H "Host: www.example.com" -i http://tunnel1.customer1:8000
68+
```
69+

0 commit comments

Comments
 (0)