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
default
namespace 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 True
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Check if the service is working by using the
curl
service 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
TARGET
is 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
hello
service is deleted by attempting tolist
it.kn service list hello
$ kn service list hello No services found.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow