This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.9.3. Basic workflow using Knative Client
Use this basic workflow to create, read, update, delete (CRUD) operations on a service. The following example deploys a simple Hello World service that reads the environment variable TARGET and prints its output.
Procedure
Create a service in the
defaultnamespace from an image.Copy to Clipboard Copied! Toggle word wrap Toggle overflow List the service.
kn service list
$ kn service list NAME URL LATEST AGE CONDITIONS READY REASON hello http://hello.default.apps-crc.testing hello-gsdks-1 8m35s 3 OK / 3 TrueCopy to Clipboard Copied! Toggle word wrap Toggle overflow Check if the service is working by using the
curlservice endpoint command:curl http://hello.default.apps-crc.testing
$ curl http://hello.default.apps-crc.testing Hello Knative!Copy to Clipboard Copied! Toggle word wrap Toggle overflow Update the service.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The service’s environment variable
TARGETis now set toKn.Describe the service.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Delete the service.
kn service delete hello
$ kn service delete hello Service 'hello' successfully deleted in namespace 'default'.Copy to Clipboard Copied! Toggle word wrap Toggle overflow You can then verify that the
helloservice is deleted by attempting tolistit.kn service list hello
$ kn service list hello No services found.Copy to Clipboard Copied! Toggle word wrap Toggle overflow