vognev/laravel-serverless-knative

Laravel/Serverless for Knative

v0.0.1 2019-09-30 11:45 UTC

This package is auto-updated.

Last update: 2024-04-04 20:38:09 UTC


README

Package's aim is to provide a possibility to deploy Laravel application as an Knative service.

Installation

Package can be installed into existing project using composer:

composer require vognev/laravel-serverless-knative

Also, you need docker locally to be able to build runtume image and access to Kubernetes with Knative deployed.

It seems that most easier is to deploy Knative using Gloo.

See /manifests for reference.

For SQS queue you have to install corresponding composer package and deploy Knative SQS EventSource.

Initialization

Run php artisan serverless:install command.

It will publish:

config/serverless.php

This is a configuration file, where you can tweak package's behaviour. Apart from being able to define where to store package's data, it's aim is to configure which php modules should be included in runtime.

storage/serverless

On default all runtime-related assets will be published here. Inside of this location you can find context folder, holding docker's context to build a runtime.

.php.conf.d

In this folder you can tweak php modules options, or add your own .ini configs.

Building Runtime

./artisan serverless:runtime will build and push image containing php and your code.

Deployment

After steps above are done, you can deploy your project into Knative using pipe:

./artisan serverless:manifest | kubectl apply -f-

Local Development

Anything you can get running: minikube, k3s etc. Or use generated runtime image with docker-compose.