Serverless Operator
Status
Overview
Serverless Operator allows deploying the Serverless component on the Kyma cluster in compatibility with Lifecycle Manager.
Install
Apply the following script to install Serverless Operator:
kubectl apply -f https://github.com/kyma-project/serverless-manager/releases/latest/download/serverless-operator.yaml
To get Serverless installed, apply the sample Serverless CR:
kubectl apply -f https://github.com/kyma-project/serverless-manager/releases/latest/download/default_serverless_cr.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 Operator image name.
export IMG=<DOCKER_USERNAME>/custom-serverless-operator:0.0.1
-
Verify the compability.
make test
-
Build and push the image to the registry.
make module-image
-
Deploy Serverless Operator.
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 Serverless Operator 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 Operator
-
Create a Serverless instance.
kubectl apply -f config/samples/default_serverless_cr.yaml
-
Delete a Serverless instance.
kubectl delete -f config/samples/default_serverless_cr.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