Install Nuclio

At this stage you should have a functioning Kubernetes cluster, a Docker registry, and a working Kubernetes CLI (kubectl), and you can proceed to install the Nuclio services on the cluster (i.e., deploy Nuclio). For more information about kubectl, see the Kubernetes documentation.

Create a Nuclio namespace by running the following command:

Note

All Nuclio resources go into the “nuclio” namespace, and role-based access control (RBAC) is configured accordingly.

kubectl create namespace nuclio

Create a registry secret: because Nuclio functions are images that need to be pushed and pulled to/from the registry, you need to create a secret that stores your registry credentials. Replace the <...> placeholders in the following commands with your username, password, and URL:

You are encouraged to look at the nuclio-rbac.yaml file that’s used in the following command before applying it, so that you don’t get into the habit of blindly running things on your cluster (akin to running scripts off the internet as root).

In this example, the Nuclio dashboard service has full access to the local machine’s Docker daemon. If you’re concerned about the security implications, isolate the dashboard in its own node. The Nuclio team is working with the community to establish a secure and robust on-cluster build mechanism.

Use the command kubectl get pods --namespace nuclio to verify both the controller and dashboard are running.

Forward the Nuclio dashboard port: the Nuclio dashboard publishes a service at port 8070. To use the dashboard, you first need to forward this port to your local IP address:

Deploy a function with the Nuclio dashboard

Browse to http://localhost:8070 (after having forwarded this port as part of the Nuclio installation). You should see the Nuclio dashboard UI. Choose one of the built-in examples and click Deploy. The first build will populate the local Docker cache with base images and other files, so it might take a while, depending on your network. When the function deployment is completed, you can click Invoke to invoke the function with a body.

Deploy a function with the Nuclio CLI (nuctl)

Start by downloading the latest version of the nuctl Nuclio CLI for your platform, and then deploy the helloworld Go sample function. You can add the --verbose flag if you want to peek under the hood:

Note

If you are using Docker Hub, the URL here includes your username — registry.hub.docker.com/<username>.