Skip to content

Ucode-io/knative

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Knative Template Repository

Introduction to Knative

Knative is a Kubernetes-based platform that simplifies the deployment of serverless workloads. It provides powerful building blocks such as event-driven computing and autoscaling capabilities, making it ideal for building scalable cloud-native applications.

Key features of Knative include:

  • Knative Serving: Run serverless containers with advanced routing, autoscaling, and rollout capabilities.
  • Knative Eventing: Build event-driven architectures using cloud events.

This repository provides a template to quickly bootstrap Knative-based services.


Knative Installation Guide

MacOS

  1. Install the Knative client:
    brew install knative/client/kn
  2. Install the Knative kn-plugins:
    brew tap knative-extensions/kn-plugins
  3. Install the func:
    brew install func 

Ubuntu

  1. Download the func binary for Ubuntu:
    wget https://github.com/knative/func/releases/download/knative-v1.16.1/func_linux_amd64
  2. Make the binary executable:
    chmod +x func_linux_amd64
  3. Move the binary to a directory in your PATH:
    sudo mv func_linux_amd64 /usr/local/bin/func

Generate New Function

To create a new function, use the provided template:

 make gen-function

Redis Integration

Redis can be used to manage state or as a message broker. Redis client can be enabled with following environment variables.

REDIS_HOST='' REDIS_PORT=6379 REDIS_USER=redis_user # if exists REDIS_PASS=redis_pass # if password is enabled REDIS_ENABLED=true

Logging

Logging is crucial for monitoring and debugging. To see the logs of your application go to the following link. And choose your function.

grafana credentials: login: ucode-dev password: sie0eeBuZ3Neigageejo 

Running on local

Make sure that func is installed on your laptop by running the command, func version.

Build image:

make build-function

Run container: You have to give external container port for PORT parametr

make run PORT=8888

Stop image:

make stop

You can send request to the faas in local with the url: http://localhost:PORT/.

Inside the ./faas/main.go you can build another paths too. But it is only recommended for specific cases.


For more details or support, feel free to raise issues in this repository.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published