You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/uplink/ingress-for-tunnels.md
+29-29Lines changed: 29 additions & 29 deletions
Original file line number
Diff line number
Diff line change
@@ -4,16 +4,17 @@
4
4
5
5
Inlets Uplink is designed to connect customer services to a remote Kubernetes cluster for command and control as part of a SaaS product.
6
6
7
-
Any tunnelled service can be accessed directly from within the cluster and does not need to be exposed to the public Internet for access.
7
+
Any tunnelled service can be accessed directly from within the cluster using a ClusterIP Service and does not need to be exposed to the public Internet in order to be used by a SaaS product.
8
8
9
-
Beware: by following these instructions, you are exposing one or more of those tunnels to the public Internet.
9
+
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.
10
10
11
+
Alternatively, the data-router component can be used along with a wild-card DNS reocrd 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.
11
12
12
-
Make inlets uplink HTTP tunnels publicly accessible by setting up ingress for the data plane.
13
+
## Quick start
13
14
14
15
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`.
15
16
16
-
Both tunnels can be created with `kubectl`or the `inlets-pro`cli. See [create tunnels](/uplink/create-tunnels/) for more info:
17
+
Both tunnels can be created with `kubectl`using the Custom Resource Definition, the `inlets-pro`CLI, or the [REST API](/uplink/rest-api/). See [create tunnels](/uplink/create-tunnels/) for more info:
17
18
18
19
=== "kubectl"
19
20
@@ -53,7 +54,7 @@ Both tunnels can be created with `kubectl` or the `inlets-pro` cli. See [create
53
54
54
55
Follow the instruction for Kubernetes Ingress or Istio depending on how you deployed inlets uplink.
55
56
56
-
## Setup tunnel ingress
57
+
## Expose the Tunnel with Ingress
57
58
58
59
1. Create a new certificate Issuer for tunnels:
59
60
@@ -86,7 +87,7 @@ Follow the instruction for Kubernetes Ingress or Istio depending on how you depl
86
87
kind: Ingress
87
88
metadata:
88
89
name: grafana-tunnel-ingress
89
-
namespace: inlets
90
+
namespace: tunnels
90
91
annotations:
91
92
kubernetes.io/ingress.class: nginx
92
93
cert-manager.io/issuer: tunnels-letsencrypt-prod
@@ -99,7 +100,7 @@ Follow the instruction for Kubernetes Ingress or Istio depending on how you depl
99
100
pathType: Prefix
100
101
backend:
101
102
service:
102
-
name: grafana.tunnels
103
+
name: grafana
103
104
port:
104
105
number: 8000
105
106
tls:
@@ -110,14 +111,14 @@ Follow the instruction for Kubernetes Ingress or Istio depending on how you depl
110
111
111
112
Note that the annotation `cert-manager.io/issuer` is used to reference the certificate issuer created in the first step.
112
113
113
-
To setup ingress for multiple tunnels simply define multiple ingress resources. For example apply a second ingress resource for the openfaas tunnel:
114
+
To setup ingress for multiple tunnels simply define multiple ingress resources. For example, you could create a second ingress resource for the openfaas tunnel:
114
115
115
116
```yaml
116
117
apiVersion: networking.k8s.io/v1
117
118
kind: Ingress
118
119
metadata:
119
120
name: openfaas-tunnel-ingress
120
-
namespace: inlets
121
+
namespace: tunnels
121
122
annotations:
122
123
kubernetes.io/ingress.class: nginx
123
124
cert-manager.io/issuer: tunnels-letsencrypt-prod
@@ -130,7 +131,7 @@ spec:
130
131
pathType: Prefix
131
132
backend:
132
133
service:
133
-
name: openfaas.tunnels
134
+
name: openfaas
134
135
port:
135
136
number: 8000
136
137
tls:
@@ -139,8 +140,7 @@ spec:
139
140
secretName: openfaas-cert
140
141
```
141
142
142
-
143
-
## Setup tunnel ingress with an Istio Ingress gateway
143
+
## Expose the Tunnel with an Istio Ingress Gateway
144
144
145
145
1. Create a new certificate Issuer for tunnels:
146
146
@@ -203,10 +203,10 @@ spec:
203
203
204
204
Note that both the certificates and issuer are created in the `istio-system` namespace.
205
205
206
-
3. Configure the ingress gateway for both tunnels. In this case we create a single resource for both hosts but you could also split the configuration into multiple Gateway resources.
206
+
3. Configure the Ingress Gateway for both tunnels. In this case we create a single resource for both hosts but you could also split the configuration into multiple Gateway resources.
207
207
208
208
```yaml
209
-
apiVersion: networking.istio.io/v1alpha3
209
+
apiVersion: networking.istio.io/v1
210
210
kind: Gateway
211
211
metadata:
212
212
name: tunnel-gateway
@@ -240,7 +240,7 @@ spec:
240
240
4. Configure the gateway's traffic routes by defining corresponding virtual services:
241
241
242
242
```yaml
243
-
apiVersion: networking.istio.io/v1alpha3
243
+
apiVersion: networking.istio.io/v1
244
244
kind: VirtualService
245
245
metadata:
246
246
name: grafana
@@ -260,7 +260,7 @@ spec:
260
260
port:
261
261
number: 8000
262
262
---
263
-
apiVersion: networking.istio.io/v1alpha3
263
+
apiVersion: networking.istio.io/v1
264
264
kind: VirtualService
265
265
metadata:
266
266
name: openfaas
@@ -287,7 +287,7 @@ After applying these resources you should be able to access the data plane for b
287
287
288
288
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.
289
289
290
-
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, and Google Cloud DNS listed.
290
+
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.
291
291
292
292
DNS01 challenges require a secret to be created containing the credentials for the DNS provider. The secret is referenced by the issuer resource.
Create a separate `Issuer`, assuming a domain of `t.example.com`, where each tunnel would be i.e. `prometheus.t.example.com` or `api.t.example.com`:
300
+
Create a separate `Issuer`, assuming a domain of `uplink.example.com`, where each tunnel would be i.e. `prometheus.uplink.example.com` or `api.uplink.example.com`:
301
301
302
302
```bash
303
303
export NS="inlets"
304
304
export ISSUER_NAME="inlets-wildcard"
305
-
export DOMAIN="t.example.com"
305
+
export DOMAIN="uplink.example.com"
306
306
307
307
cat <<EOF | kubectl apply -f -
308
308
apiVersion: cert-manager.io/v1
@@ -333,8 +333,8 @@ Update values.yaml to enable the dataRouter and to specify the wildcard domain:
333
333
dataRouter:
334
334
enabled: true
335
335
336
-
# Leave out the asterix i.e. *.t.example.com would be: t.example.com
337
-
wildcardDomain: "t.example.com"
336
+
# Leave out the asterix i.e. *.uplink.example.com would be: uplink.example.com
337
+
wildcardDomain: "uplink.example.com"
338
338
339
339
tls:
340
340
issuerName: "inlets-wildcard"
@@ -360,7 +360,7 @@ Create a tunnel with an Ingress Domain specified in the `.Spec` field:
0 commit comments