Skip to content

Commit 0ee4b4b

Browse files
docs: restructure Knative tutorial per maintainer feedback
Co-authored-by: Hemang Sharrma <hemangsharrma@gmail.com> Signed-off-by: ishaanxgupta <ishaankone@gmail.com>
1 parent 70ff35e commit 0ee4b4b

File tree

1 file changed

+45
-36
lines changed

1 file changed

+45
-36
lines changed

docs/tutorials/knative.md

Lines changed: 45 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,43 @@ for custom configurations.
88
## Prerequisites
99

1010
- A running Kubernetes cluster
11+
- `urunc` installed (follow the [installation guide](https://urunc.io/tutorials/How-to-urunc-on-k8s/))
12+
13+
## Install Knative Serving
14+
15+
### Option 1: Use Pre-built Knative (Recommended)
16+
17+
Apply the pre-built Knative manifests with urunc support:
18+
19+
```bash
20+
kubectl apply -f https://s3.nbfc.io/knative/knative-v[[ versions.knative ]]-urunc-5220308.yaml
21+
```
22+
23+
> Note: There are cases where due to the large manifests, kubectl fails. Try a second time, or use `kubectl create -f https://s3.nbfc.io/knative/knative-v[[ versions.knative ]]-urunc-5220308.yaml`
24+
25+
### Option 2: Build Knative from Source
26+
27+
If you prefer to build Knative yourself, follow these steps.
28+
29+
#### Prerequisites for building from source
30+
1131
- A Docker-compatible registry (e.g. Harbor, Docker Hub)
1232
- Ubuntu 20.04 or newer
1333
- Basic `git`, `curl`, `kubectl`, and `docker` installed
14-
15-
## Environment Setup
34+
35+
#### Environment Setup
1636

1737
Install [Docker](/quickstart/#install-docker), Go [[ versions.go ]], and `ko`:
1838

19-
### Install Go [[ versions.go ]]
39+
##### Install Go [[ versions.go ]]
2040
```bash
2141
wget https://go.dev/dl/go[[ versions.go ]].linux-amd64.tar.gz
2242
sudo rm -rf /usr/local/go
2343
sudo tar -zxvf go[[ versions.go ]].linux-amd64.tar.gz -C /usr/local/
2444
rm go[[ versions.go ]].linux-amd64.tar.gz
2545
```
2646

27-
### Verify Go installation (Should be [[ versions.go ]])
47+
##### Verify Go installation (Should be [[ versions.go ]])
2848

2949
```console
3050
$ export PATH=/usr/local/go/bin:$PATH
@@ -33,46 +53,31 @@ $ go version
3353
go version go[[ versions.go ]] linux/amd64
3454
```
3555

36-
### Install ko (latest)
56+
##### Install ko (latest)
3757
```bash
3858
curl -sSfL https://github.com/ko-build/ko/releases/latest/download/ko_Linux_x86_64.tar.gz | sudo tar xzf - -C /usr/local/bin
3959
ko version
4060
```
4161

42-
## Clone and Build Knative with the queue-proxy patch
43-
44-
### Set your container registry
62+
#### Set your container registry
4563

4664
> Note: You should be able to use Docker Hub for this. e.g. `<yourdockerhubid>/knative`
4765
4866
```bash
4967
export KO_DOCKER_REPO='<your-registry>/knative'
5068
```
5169

52-
### Option 1: Use Pre-built Knative (Recommended)
53-
54-
The quickest way to get started is to use our pre-built Knative binaries with urunc support:
55-
56-
```bash
57-
kubectl apply -f https://s3.nbfc.io/knative/knative-v[[ versions.knative ]]-urunc-5220308.yaml
58-
```
70+
#### Clone urunc-enabled Knative Serving and build
5971

60-
If the manifest is too large and kubectl fails, try again or use:
6172
```bash
62-
kubectl create -f https://s3.nbfc.io/knative/knative-v[[ versions.knative ]]-urunc-5220308.yaml
73+
git clone https://github.com/nubificus/serving -b feat_urunc
74+
cd serving/
75+
ko resolve -Rf ./config/core/ > knative-custom.yaml
6376
```
6477

65-
### Option 2: Build Knative from Source
66-
67-
If you need to build Knative with custom modifications using urunc support:
78+
#### Apply knative's manifests to the local k8s
6879

6980
```bash
70-
# Clone urunc-enabled Knative Serving with urunc patches
71-
git clone https://github.com/nubificus/serving -b feat_urunc
72-
cd serving/
73-
74-
# Build and deploy
75-
ko resolve -Rf ./config/core/ > knative-custom.yaml
7681
kubectl apply -f knative-custom.yaml
7782
```
7883

@@ -125,7 +130,19 @@ kubectl apply -f https://raw.githubusercontent.com/nubificus/c-httpreply/refs/he
125130
kubectl get ksvc -A -o wide
126131
```
127132

128-
### Test the service (replace IP with actual ingress IP)
133+
### Get the ingress IP
134+
135+
Before testing the service, get the IP address of the Kourier internal service:
136+
137+
```bash
138+
kubectl get svc -n kourier-system kourier-internal -o jsonpath='{.spec.clusterIP}'
139+
```
140+
141+
Note the IP address returned (e.g., `10.244.9.220`). You'll use this in the following curl commands.
142+
143+
### Test the service
144+
145+
Replace `<INGRESS_IP>` with the IP address from the previous step:
129146

130147
```bash
131148
curl -v -H "Host: hellocontainerc.default.127.0.0.1.nip.io" http://<INGRESS_IP>
@@ -145,9 +162,7 @@ NAME URL LATESTCREA
145162
hellounikernelfc http://hellounikernelfc.default.127.0.0.1.nip.io hellounikernelfc-00001 hellounikernelfc-00001 True
146163
```
147164

148-
and once it's on a `Ready` state, you could issue a request:
149-
> Note: 10.244.9.220 is the IP of the `kourier-internal` svc. You can check your own from:
150-
> `kubectl get svc -n kourier-system |grep kourier-internal`
165+
Once it's in a `Ready` state, invoke the function using the ingress IP you obtained earlier:
151166

152167
```console
153168
$ curl -v -H "Host: hellounikernelfc.default.127.0.0.1.nip.io" http://10.244.9.220:80
@@ -169,9 +184,3 @@ $ curl -v -H "Host: hellounikernelfc.default.127.0.0.1.nip.io" http://10.244.9.2
169184
Hello, World!
170185
* Connection #0 to host 10.244.9.220 left intact
171186
```
172-
173-
## Wrapping Up
174-
175-
You're now running unikernel-based workloads via Knative and `urunc`! With this
176-
setup, you can push the boundaries of lightweight, secure, and high-performance
177-
serverless deployments — all within a Kubernetes-native environment.

0 commit comments

Comments
 (0)