-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add example and instructions to test knative in airgapped (#932)
* feat: add example and instructions to test knative in airgap
- Loading branch information
Showing
3 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Testing Knative in airgapped | ||
|
||
This directory is dedicated to testing Knative in an airgapped environment. | ||
|
||
## Prerequisites | ||
|
||
Prepare the airgapped environment and deploy CKF by following the steps in [Airgapped test scripts](https://github.com/canonical/bundle-kubeflow/tree/main/tests/airgapped#testing-airgapped-installation). | ||
|
||
Once you run the test scripts, the `knative/helloworld-go` image used in the `helloworld` example will be included in your airgapped environment. It's specifically added in the [`get-all-images.sh` script](../../../scripts/airgapped/get-all-images.sh). | ||
|
||
## How to test Knative in an Airgapped environment | ||
1. Connect to the dashboard by visiting the IP of your airgapped VM. To get the IP run: | ||
``` | ||
lxc ls | grep eth0 | ||
``` | ||
2. Log in to the dashboard and create a Profile. | ||
3. Apply the `helloworld.yaml` found in this directory to your Profile's Namespace: | ||
``` | ||
kubectl apply -f ./helloworld.yaml -n <your namespace> | ||
``` | ||
4. Wait for the Knative Service to be `Ready` | ||
``` | ||
kubectl get ksvc -n <your namespace> | ||
``` | ||
Expected output: | ||
``` | ||
NAME URL LATESTCREATED LATESTREADY READY REASON | ||
helloworld http://helloworld.admin.10.64.140.43.nip.io helloworld-00001 helloworld-00001 True | ||
``` | ||
5. Curl the Knative Service using the `URL` from the previous step | ||
``` | ||
curl -L http://helloworld.admin.10.64.140.43.nip.io | ||
``` | ||
Expected output: | ||
``` | ||
Hello World! | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# This example is based on the [Knative Serving tutorial](https://knative.dev/docs/getting-started/first-service/#__tabbed_1_2) | ||
apiVersion: serving.knative.dev/v1 | ||
kind: Service | ||
metadata: | ||
name: hello | ||
spec: | ||
template: | ||
metadata: | ||
labels: | ||
# Disable istio sidecar due to https://github.com/canonical/kserve-operators/issues/216 | ||
sidecar.istio.io/inject : "false" | ||
spec: | ||
containers: | ||
- image: 172.17.0.2:5000/knative/helloworld-go:latest | ||
ports: | ||
- containerPort: 8080 | ||
env: | ||
- name: TARGET | ||
value: "World" |