serverless-manager

command module
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 1, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

README

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

  1. Clone the project.

    git clone https://github.com/kyma-project/serverless-manager.git && cd serverless-manager/
    
  2. Set the serverless-manager image name.

    export IMG=<DOCKER_USERNAME>/custom-serverless-manager:0.0.1
    
  3. Verify the compability.

    make test
    
  4. Build and push the image to the registry.

    make module-image
    
  5. Deploy.

    make deploy
    
Test integration with lifecycle-manager on the k3d cluster
  1. Clone the project.

    git clone https://github.com/kyma-project/serverless-manager.git && cd serverless-manager/
    
  2. 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

  • For MacBook M1 users

    Some parts of the scripts may not work because the Kyma CLI is not released for Apple Silicon users. To fix it install Kyma CLI manually and export the path to it.

    export KYMA=$(which kyma)
    

    The example error may look like this: Error: unsupported platform OS_TYPE: Darwin, OS_ARCH: arm64; to mitigate this problem set variable KYMA with the absolute path to kyma-cli binary compatible with your operating system and architecture. Stop.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
api
v1alpha1
Package v1alpha1 contains API Schema definitions for the operator v1alpha1 API group +kubebuilder:object:generate=true +groupName=operator.kyma-project.io
Package v1alpha1 contains API Schema definitions for the operator v1alpha1 API group +kubebuilder:object:generate=true +groupName=operator.kyma-project.io
components
operator Module
internal
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL