Skip to content

openshift-labs/serverless-devfile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NodeJS function for Serverless.com Knative Component demo

This demo will setup an env on Eclipse Che to code, build and run a Function on your Kubernetes and OpenShift cluster using Knative and Serverless.com components. Components give the possiblity of delegating the build phase to the cluster, so that can be done for you by Kaniko or Source-to-Image when using Knative Component.

Prerequisites

Serverless.com

Serverless.com components require a login at Serverless.com.

From Dashboard, Create an Access Key, we will use it for Deploying the function: https://app.serverless.com/<YOUR_ORG>/settings/accessKeys

Knative

Install Knative or OpenShift Serverless in your cluster. Get them from OperatorHub or from OperatorHub embedded marketplace inside OpenShift.

Cluster info

Populate the .env file with your cluster info:

  • KUBERNETES_ENDPOINT: Cluster API URL (e.g. https://api.my-cluster.tld)
  • KUBERNETES_PORT: Cluster API port (e.g. 6443)
  • KUBERNETES_SERVICE_ACCOUNT_TOKEN: get your k8s user serviceaccount token (e.g. in OpenShift oc whoami -t)
  • KUBERNETES_SKIP_TLS_VERIFY: skip TLS verification if you are not using trusted certificates for API (e.g. true)

if you are using it on Kubernetes, a Docker Hub account is required. Add these credentials to the .env file then:

  • DOCKER_USERNAME: Docker Hub username
  • DOCKER_PASSWORD: Docker Hub password

serverless.yml

Update the org property in the serverless.yml file with the name of your serverless.com account.

Run in Eclipse Che!

Code, build, test and deploy your Function as scale-to-zero app directly from Eclipse Che in-browser IDE:

Contribute

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published