Deploying your first Knative Service
Hit . on your keyboard to move forward in the tutorial. Use , to go back at any time.
In this tutorial, you will deploy a “Hello world” service.
This service will accept an environment variable, , and print “Hello ${TARGET}!
.”
Since our “Hello world” Service is being deployed as a Knative Service, not a Kubernetes Service, it gets some super powers out of the box .
kn
Note the name “world” which you passed in as “revision-name,” naming your Revisions
will help you to more easily identify them, but don’t worry, you’ll learn more about later.
Expected output:
Service hello created to latest revision 'hello-world' is available at URL:
YAML
Once you’ve created your YAML file (named something like “hello.yaml”):
kubectl apply -f hello.yaml
Why did I pass in the second name, ?
Expected output:
To see the URL where your Knative Service is hosted, leverage the kn
CLI:
Ping your Knative Service
Ping your Knative Service by opening in your browser of choice or by running the command:
Expected output:
Hello World!
Congratulations , you’ve just created your first Knative Service. Up next, Autoscaling!