This repository contains configurations and scripts for managing OpenFaaS functions. The functions are deployed in an OpenFaaS environment based on the settings defined in the functions.yaml
file.
-
functions-up.sh
: This script is used to deploy OpenFaaS functions based on the configurations defined in thefunctions.yaml
file. It uses thefaas-cli
tool to do this. -
functions.yaml
: This file contains the configurations for OpenFaaS functions, including details such as name, programming language, Docker image, environment variables, and other related parameters. -
pull-handlers.sh
: This script is used to update the handlers of the functions from the Git repository. It pulls the latest changes from relevant branches (e.g., "main") to keep the functions up-to-date. -
push.sh
: This script facilitates sending the configurations and scripts needed to the OpenFaaS server. It copies thefunctions.yaml
andpull-handlers.sh
files to the server and runspull-handlers.sh
remotely to update the handlers. -
ssh.sh
: This script allows you to access the OpenFaaS server via SSH using the specified authentication key.
The configurations for OpenFaaS functions are defined in the functions.yaml
file. Each function is configured with the following details:
- Function name.
- Programming language.
- Handler (path to the function's code).
- Docker image.
- Environment variables related to the function.
- Version: version of file
- provider - Gateway: Gateway url to openFaas (See OpenFaas documentation)
- Functions: List of functions to deploy (name of functions)
-
- git_url: Git url of function
-
- git_ref: Release tag to deploy this function
-
- lang: stack to build function inside of openFaas (see openfaas templates documentation)
-
- handler: path to function inside of openFaas server
-
- image: image name (if private registry, named with url registry and tag)
To use the provided scripts in this repository, follow these steps:
-
Function Deployment:
- Use the
functions-up.sh
script to deploy functions in the OpenFaaS environment. You can specify an optional filter to deploy only specific functions if needed.
- Use the
-
Handler Updates:
- Use the
pull-handlers.sh
script to keep the handlers of the functions updated. It will pull the latest changes from relevant branches in the Git repositories of the functions.
- Use the
-
Sending Configurations and Scripts:
- The
push.sh
script makes it easy to send the configurations and scripts to the OpenFaaS server. It will copy thefunctions.yaml
andpull-handlers.sh
files to the server and runpull-handlers.sh
remotely to update the handlers.
- The
-
Accessing the OpenFaaS Server:
- Use the
ssh.sh
script to access the OpenFaaS server via SSH using the specified authentication key.
- Use the
Make sure to properly configure the environment variables and other necessary parameters in the function configurations in functions.yaml
before deploying the functions.
Note: Ensure that you have the appropriate permissions and correctly configure SSH keys and other authentication details for the OpenFaaS server before using these scripts.