Deploying a function

You can deploy a function to your cluster as a Knative service, by using the kn func deploy command.

If the targeted function is already deployed, it is updated with a new container image that is pushed to a container image registry, and the Knative service is updated.

If you are using as the image registry, you must ensure that the repository is not private. The first time an image is deployed these settings may need to be updated.

  • You must have already initialized the function that you want to deploy.

  • Deploy a function:

    $ kn func deploy [-n <namespace> -p <path> -i <image> -r <registry>]
    • If no namespace is specified, the function will be deployed in the current namespace.

    • The function is deployed from the current directory, unless a path is specified.

    • The Knative service name is derived from the project name, and cannot be changed using this command.