Skip to content

Commit 4240ba1

Browse files
committed
Update uplink docs for automatic tunnel Ingress generation
Update the docs page on exposing tunnels on the internet to use the new controller feature to generate ingress resources for tunnels. Signed-off-by: Han Verstraete (OpenFaaS Ltd) <[email protected]>
1 parent 73ea0b7 commit 4240ba1

File tree

1 file changed

+38
-63
lines changed

1 file changed

+38
-63
lines changed

Diff for: docs/uplink/expose-tunnels.md

+38-63
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
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.
88

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.
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. The uplink operator can be configured to automatically generate ingress resources for tunnels. This approach is recommended for new users for dozens of tunnels.
1010

1111
[![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)
1212
> Each tunnel's data-plane is exposed via a separate Ingress and Certificate
@@ -35,6 +35,8 @@ Both tunnels can be created with `kubectl` using the Custom Resource Definition,
3535
licenseRef:
3636
name: inlets-uplink-license
3737
namespace: tunnels
38+
ingressDomains:
39+
- grafana.example.com
3840
---
3941
apiVersion: uplink.inlets.dev/v1alpha1
4042
kind: Tunnel
@@ -45,106 +47,79 @@ Both tunnels can be created with `kubectl` using the Custom Resource Definition,
4547
licenseRef:
4648
name: inlets-uplink-license
4749
namespace: tunnels
50+
ingressDomains:
51+
- openfaas.example.com
4852
EOF
4953
```
5054

5155
=== "cli"
5256

5357
```bash
54-
$ inlets-pro tunnel create grafana
58+
$ inlets-pro tunnel create grafana \
59+
--ingress grafana.example.com
5560
Created tunnel openfaas. OK.
5661

57-
$ inlets-pro tunnel create openfaas
62+
$ inlets-pro tunnel create openfaas \
63+
--ingress openfaas.example.com
5864
Created tunnel openfaas. OK.
5965
```
6066

6167
Follow the instruction for Kubernetes Ingress or Istio depending on how you deployed inlets uplink.
6268

6369
## Expose the Tunnel with Ingress
6470

65-
1. Create a new certificate Issuer for tunnels:
71+
1. Create a new certificate Issuer for tunnels.
6672

6773
```bash
6874
export EMAIL="[email protected]"
6975

70-
cat > tunnel-issuer-prod.yaml <<EOF
76+
cat > letsencrypt-prod-tunnels <<EOF
7177
apiVersion: cert-manager.io/v1
72-
kind: Issuer
78+
kind: ClusterIssuer
7379
metadata:
74-
name: tunnels-letsencrypt-prod
75-
namespace: inlets
80+
name: letsencrypt-prod-tunnels
7681
spec:
7782
acme:
7883
server: https://acme-v02.api.letsencrypt.org/directory
7984
email: $EMAIL
8085
privateKeySecretRef:
81-
name: tunnels-letsencrypt-prod
86+
name: letsencrypt-prod-tunnels
8287
solvers:
8388
- http01:
8489
ingress:
8590
class: "nginx"
8691
EOF
8792
```
8893
89-
2. Create an ingress resource for the tunnel:
94+
We are creating a `ClusterIssuer` that can be used to issue certificates for tunnels in multiple namespaces. If you don't want to use a cluster wide issuer it is also possible to define an `Issuer` with the same name in each individual tunnel namespace. This requires a lot more configuration and we would recommend to use the `ClusterIssuer` instead.
95+
96+
2. Update the Inlets Uplink deployment to enable automatic Ingress resource generation.
97+
98+
To enable ingress resource generation for tunnels you will need to update the Uplink deployment. Modify the `values.yaml` file you created during the [initial installation](/uplink/installation/) of Inlets Uplink.
9099
91100
```yaml
92-
apiVersion: networking.k8s.io/v1
93-
kind: Ingress
94-
metadata:
95-
name: grafana-tunnel-ingress
96-
namespace: tunnels
97-
annotations:
98-
kubernetes.io/ingress.class: nginx
99-
cert-manager.io/issuer: tunnels-letsencrypt-prod
100-
spec:
101-
rules:
102-
- host: grafana.example.com
103-
http:
104-
paths:
105-
- path: /
106-
pathType: Prefix
107-
backend:
108-
service:
109-
name: grafana
110-
port:
111-
number: 8000
112-
tls:
113-
- hosts:
114-
- grafana.example.com
115-
secretName: grafana-cert
101+
operator:
102+
tunnelIngress:
103+
enabled: true
104+
class: nginx
105+
issuer:
106+
name: letsencrypt-prod-tunnels
107+
# Change the issuer type to Issuer of you chose to use an
108+
# issuer per namespace instead of a ClusterIssuer.
109+
type: ClusterIssuer
116110
```
117111
118-
Note that the annotation `cert-manager.io/issuer` is used to reference the certificate issuer created in the first step.
112+
Apply the updated values:
119113
120-
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+
```sh
115+
helm upgrade --install inlets-uplink \
116+
oci://ghcr.io/openfaasltd/inlets-uplink-provider \
117+
--namespace inlets \
118+
--values ./values.yaml
119+
```
120+
121+
The Uplink operator will automatically generate new Ingress resources for all hosts included in the IngressDomain field of the Tunnel spec.
121122
122-
```yaml
123-
apiVersion: networking.k8s.io/v1
124-
kind: Ingress
125-
metadata:
126-
name: openfaas-tunnel-ingress
127-
namespace: tunnels
128-
annotations:
129-
kubernetes.io/ingress.class: nginx
130-
cert-manager.io/issuer: tunnels-letsencrypt-prod
131-
spec:
132-
rules:
133-
- host: openfaas.example.com
134-
http:
135-
paths:
136-
- path: /
137-
pathType: Prefix
138-
backend:
139-
service:
140-
name: openfaas
141-
port:
142-
number: 8000
143-
tls:
144-
- hosts:
145-
- openfaas.example.com
146-
secretName: openfaas-cert
147-
```
148123
149124
## Expose the Tunnel with an Istio Ingress Gateway
150125
@@ -327,7 +302,7 @@ spec:
327302
solvers:
328303
- dns01:
329304
digitalocean:
330-
tokenSecretRef:
305+
apiTokenSecretRef:
331306
name: digitalocean-dns
332307
key: access-token
333308
EOF

0 commit comments

Comments
 (0)