Skip to content

Commit 658874c

Browse files
committed
feat(tutorials): Add Gateway API
Signed-off-by: Sascha Spreitzer <[email protected]>
1 parent d863aea commit 658874c

File tree

3 files changed

+131
-0
lines changed

3 files changed

+131
-0
lines changed

content/docs/manifest.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,10 @@
607607
"title": "Introduction",
608608
"path": "/docs/tutorials/README.md"
609609
},
610+
{
611+
"title": "Securing Cilium Gateway API",
612+
"path:": "/docs/tutorials/acme/cilium-gateway-api.md"
613+
},
610614
{
611615
"title": "Securing NGINX-ingress",
612616
"path": "/docs/tutorials/acme/nginx-ingress.md"

content/docs/tutorials/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ description: 'cert-manager tutorials: Overview'
66
Step-by-step tutorials are a great way to get started with cert-manager, and we provide a few
77
for you to learn from. Take a look!
88

9+
### Gateway API Tutorials
10+
11+
- [Securing Cilium Gateway API](./acme/cilium-gateway-api.md): A tutorial for deploying Kubernetes Gateway API in combination with Cilium and securing ingress traffic with certificates from `Let's Encrypt` with the Automatic Certificate Management Environment (ACME) mechanism.
12+
13+
### Ingress Tutorials
14+
15+
Kubernetes Ingress is in a feature freeze state in favor of the Kubernetes Gateway API. See the [Kubernetes Ingress](https://kubernetes.io/docs/concepts/services-networking/ingress/) and [Kubernetes Gateway API](https://kubernetes.io/docs/concepts/services-networking/gateway/) documentation.
16+
917
- [Securing Ingresses with NGINX-Ingress and cert-manager](./acme/nginx-ingress.md): Tutorial for deploying NGINX into your
1018
cluster and securing incoming connections with a certificate from Let's Encrypt.
1119
- [GKE + Ingress + Let's Encrypt](./getting-started-with-cert-manager-on-google-kubernetes-engine-using-lets-encrypt-for-ingress-ssl/README.md):
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
---
2+
title: Securing Cilium Gateway API
3+
description: 'cert-manager tutorials: Using Cilium Gateway API to solve Automatic Certificate Management Environment (ACME) challenges'
4+
---
5+
6+
This tutorial will specify how to automate ingress traffic encryption to your Kubernetes cluster with `Kubernetes Gateway API`, `Cilium` and `cert-manager`.
7+
8+
## Steps
9+
10+
* [Step 1 - Install Helm](#step-1---install-helm)
11+
* [Step 2 - Deploy Kubernetes Gateway API](#step-2---deploy-kubernetes-gateway-api)
12+
* [Step 3 - Deploy Cilium](#step-3---deploy-cilium)
13+
* [Step 4 - Deploy cert-manager and Configure an Issuer](#step-4---deploy-cert-manager-and-configure-an-issuer)
14+
* [Step 5 - Configure a Gateway and HTTPRoute](#step-5---configure-a-gateway-and-httproute)
15+
16+
## Step 1 - Install Helm
17+
18+
> *Skip this step if you have helm already installed on your client.*
19+
20+
The easiest way to install and manage `cert-manager` and `Cilium` is to use [`Helm`](https://helm.sh), a templating and deployment tool for Kubernetes resources.
21+
22+
First, ensure the Helm client is installed on your client by following the [Helm installation instructions](https://helm.sh/docs/intro/install/).
23+
24+
For example, on MacOS:
25+
26+
```shell
27+
$ brew install helm
28+
```
29+
30+
For a detailed description read the documentation provided at: https://helm.sh/docs/intro/install/
31+
32+
## Step 2 - Deploy Kubernetes Gateway API
33+
34+
> *In this tutorial we are focusing on Cilium version `1.17.5`, which supports Gateway API version `1.2.0`.*
35+
36+
Install the Gateway API Custom Resource Definitions (CRDs):
37+
38+
```shell
39+
$ kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/gateway-api/v1.2.0/config/crd/standard/gateway.networking.k8s.io_gatewayclasses.yaml
40+
$ kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/gateway-api/v1.2.0/config/crd/standard/gateway.networking.k8s.io_gateways.yaml
41+
$ kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/gateway-api/v1.2.0/config/crd/standard/gateway.networking.k8s.io_httproutes.yaml
42+
$ kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/gateway-api/v1.2.0/config/crd/standard/gateway.networking.k8s.io_referencegrants.yaml
43+
$ kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/gateway-api/v1.2.0/config/crd/standard/gateway.networking.k8s.io_grpcroutes.yaml
44+
```
45+
46+
Optionally the *experimental* TLSRoute CRD:
47+
48+
```shell
49+
$ kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/gateway-api/v1.2.0/config/crd/experimental/gateway.networking.k8s.io_tlsroutes.yaml
50+
```
51+
52+
This is also described in the [cilium docs](https://docs.cilium.io/en/stable/network/servicemesh/gateway-api/gateway-api/#prerequisites).
53+
54+
## Step 3 - Deploy Cilium
55+
56+
Install the cilium cli either via your package manager or GitHub releases. For example:
57+
58+
```shell
59+
$ brew install cilium-cli
60+
```
61+
62+
Install cilium on a newly deployed Kubernetes cluster with the Gateway API integration enabled:
63+
64+
```shell
65+
$ cilium install \
66+
--set kubeProxyReplacement=true \
67+
--set gatewayAPI.enabled=true
68+
69+
$ cilium status --wait
70+
```
71+
72+
There is a detailed description in the [cilium docs](https://docs.cilium.io/en/stable/gettingstarted/k8s-install-default/).
73+
74+
## Step 4 - Deploy cert-manager and Configure an Issuer
75+
76+
Install the Helm repository:
77+
78+
```shell
79+
$ helm repo add jetstack https://charts.jetstack.io --force-update
80+
```
81+
82+
Install cert-manager:
83+
84+
```shell
85+
$ helm install \
86+
cert-manager jetstack/cert-manager \
87+
--namespace cert-manager \
88+
--create-namespace \
89+
--set crds.enabled=true
90+
```
91+
92+
There is also a detailed installation documentation with [Helm](/docs/installation/helm/).
93+
94+
Defining a letsencrypt ACME HTTP01 cluster issuer:
95+
96+
`custerissuer-letsencrypt.yaml`
97+
```yaml
98+
apiVersion: cert-manager.io/v1
99+
kind: ClusterIssuer
100+
metadata:
101+
name: letsencrypt
102+
spec:
103+
acme:
104+
105+
privateKeySecretRef:
106+
name: letsencrypt-clusterissuer
107+
server: https://acme-v02.api.letsencrypt.org/directory
108+
solvers:
109+
- http01:
110+
ingress: {}
111+
```
112+
113+
Apply it to the cluster:
114+
```shell
115+
$ kubectl apply -f clusterissuer-letsencrypt.yaml
116+
```
117+
118+
## Step 5 - Configure a Gateway and HTTPRoute
119+

0 commit comments

Comments
 (0)