This document walks you through how to get started with building OpenFunction in your local environment.
If you are interested in developing controller-manager, see sample-controller and kubebuilder.
OpenFunction is based on Kubernetes. Both of them are written in Go. If you don't have a Go development environment, please set it up first.
Kubernetes | requires Go |
---|---|
1.18+ | go>=1.12 |
Tips:
- Ensure your GOPATH and PATH have been configured in accordance with the Go environment instructions.
- It's recommended to install macOS GNU tools when using MacOS for development.
OpenFunction components are often deployed as containers in Kubernetes. If you need to rebuild the OpenFunction components in the Kubernetes cluster, you'll need to install Docker in advance.
OpenFunction uses Go Modules to manage dependencies.
You can build openfunction
image for your local environment by modifying cmd/Dockerfile
.
After uploading the image to your personal image repository, change the image url corresponding to the openfunction
container in the workload (Deployment) openfunction-controller-manager and switch it to your personal image repository.
kubectl edit deployments.apps -n openfunction openfunction-controller-manager
Kubernetes will then automatically apply your controllers.