Serverless Manager
Overview
Serverless Manager allows deploying the Serverless component on the Kyma cluster in compatibility with the Lifecycle Manager.
Install
To install serverless-manager simply apply the following script:
kubectl apply -f https://github.com/kyma-project/serverless-manager/releases/latest/download/serverless-manager.yaml
To get Serverless installed, apply the sample Serverless CR:
kubectl apply -f config/samples/operator_v1alpha1_serverless.yaml
Development
Prerequisites
Manual installation using make targets
-
Clone the project.
git clone https://github.com/kyma-project/serverless-manager.git && cd serverless-manager/
-
Set the serverless-manager
image name.
export IMG=<DOCKER_USERNAME>/custom-serverless-manager:0.0.1
-
Verify the compability.
make test
-
Build and push the image to the registry.
make module-image
-
Deploy.
make deploy
Test integration with lifecycle-manager on the k3d cluster
-
Clone the project.
git clone https://github.com/kyma-project/serverless-manager.git && cd serverless-manager/
-
Build the manager locally and run it on the k3d cluster.
make -C hack/local run-with-lifecycle-manager
NOTE: To clean up the k3d cluster, use the make -C hack/local stop
make target.
Using serverless-manager
-
Create a Serverless instance.
kubectl apply -f config/samples/operator_v1alpha1_serverless.yaml
-
Delete a Serverless instance.
kubectl delete -f config/samples/operator_v1alpha1_serverless.yaml
-
Use external registry.
The following example shows how you can modify the Serverless docker registry address using the serverless.operator.kyma-project.io
CR:
kubectl create secret generic my-secret \
--namespace kyma-system \
--from-literal username="<USERNAME>" \
--from-literal password="<PASSWORD>" \
--from-literal serverAddress="<SERVER_ADDRESS>" \
--from-literal registryAddress="<REGISTRY_ADDRESS>"
NOTE: For DockerHub:
cat <<EOF | kubectl apply -f -
apiVersion: operator.kyma-project.io/v1alpha1
kind: Serverless
metadata:
name: serverless-sample
spec:
dockerRegistry:
enableInternal: false
secretName: my-secret
EOF
Testing Strategy
Each pull request to the repository triggers CI/CD jobs that verify the serverless-manager reconciliation logic and run integration tests of the Serverless module.
pre-serverless-manager-operator-build
- Compiling the serverless-manager code and pushing its docker image.
pre-serverless-manager-operator-tests
- Testing the serverless-manager reconciliation code (Serverless CR CRUD operations).
pre-main-serverless-manager-verify
- Integration testing for the Serverless module installed by serverless-manager (not using lifecycle-manager).
pull-serverless-module-build
- Bundling a module template manifest that allows testing it against lifecycle-manager manually.
After the pull request is merged, the following CI/CD jobs are executed:
post-main-serverless-manager-verify
- Installs the Serverless module (using lifecycle-manager) and runs integration tests of Serverless.
post-serverless-manager-operator-build
- rebuilds the Serverless module and the module template manifest file that can be submitted to modular Kyma.
Troubleshooting