Skip to main content

Create a Knative service

In this tutorial, you are going to deploy the image you build, tagged and pushed to harbor in the previous tutorial by creating a Knative service.

Activate Knative

Go to Apps under the Platform section in the side menu and Drag and Drop Knative from the Disabled apps to the Enabled apps and click on Deploy Changes in the left menu.

Create a Knative Service

Create a hello-ksvc.yaml file and copy/paste the following Kubernetes manifests:

kind: Service
name: hello-ksvc
annotations: '1' container-limits,psp-allowed-users
- image: harbor.<your-ip>
runAsUser: 1001

Deploy the Knative Service

If you haven't done already, first set your kubectl context:

In Otomi console, select team demo in the top bar. On the bottom of the left panel, click on download KUBECFG.

Now export the KUBECFG to set the kubectl context:

export KUBECONFIG=$path-to-your-kubeconfig.yaml

And apply the manifest to Kubernetes:

kubectl apply -f hello-ksvc.yaml

Check if the Knative service has been created:

kubectl describe ksvc hello-ksvc