Skip to content
Laravel on Kubernetes(k8s) for development
PHP HTML Other
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
app
bootstrap
config
database
k8s
packages/Acme/Point
public
resources
routes
storage
tests
.editorconfig
.env.example
.gitattributes
.gitignore
.styleci.yml
Makefile
artisan
composer.json
composer.lock
package.json
phpunit.xml
readme.md
ruleset.xml
server.php
webpack.mix.js

readme.md

A sample Laravel development environments on Kubernetes

CircleCI

Requirements

  • Kubenernetes I tested with Docker Desktop for Mac 2.1.0.5(Kubernetes v1.14.8).

Instlation

* make

When you have done the installation, you can see the resources below.

* kubectl get all,configmap
NAME                 READY   STATUS    RESTARTS   AGE
pod/sample-db        1/1     Running   0          9m21s
pod/sample-db-test   1/1     Running   0          9m21s
pod/sample-php       2/2     Running   0          9m20s

NAME                     TYPE           CLUSTER-IP      EXTERNAL-IP   PORT(S)          AGE
service/kubernetes       ClusterIP      10.96.0.1       <none>        443/TCP          8d
service/sample-db        ClusterIP      10.96.170.170   <none>        5432/TCP         9m21s
service/sample-db-test   ClusterIP      10.96.232.170   <none>        5432/TCP         9m22s
service/sample-php       LoadBalancer   10.101.30.33    localhost     8000:32243/TCP   9m21s

NAME                       DATA   AGE
configmap/sample-nginx     3      9m22s
configmap/sample-php-fpm   2      9m22s

Sample actions

$ kubectl exec -it sample-db -- psql -Uapp app
psql (11.5)
Type "help" for help.

app=#
  • execute the PHP commands in the php-fpm container.
kubectl exec -it sample-php -c php-fpm -- php -v
PHP 7.4.0 (cli) (built: Nov 28 2019 20:41:26) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.0, Copyright (c), by Zend Technologies
    with Xdebug v2.8.0, Copyright (c) 2002-2019, by Derick Rethans
You can’t perform that action at this time.