Appearance
Kubernetes Config
Overview
The kubernetes config for generated applications is as straightforward as possible and is designed to be as simple as possible to get started with.
It's composed of the api and ui services; and uses nginx-ingress and cert-manager.
DigitalOcean Deployment
We host our services on DigitalOcean and prepared a simple guide on how to host Codecannon apps on the DigitalOcean Managed Kubernetes clusters.
Prerequisites
- Build and push docker images to your docker repository
- Configure repository access on your kubernetes cluster
- Install nginx-ingress in the DigitalOcean Marketplace
- Install cert-manager in the DigitalOcean Marketplace
- Replace placeholder values in
k8s/**/*.ymlconfigs with actual values - Create a
Namespace. A simpleNamespaceconfig is available ink8s/namespace.yml
Api Service
The api service contains your Laravel backend alongside a SQLite database.
It's based on the api Docker image (api/Dockerfile).
- You can find the api
Serviceink8s/services/api_service.yml. It's the simplest service config exposing the api service on port80. - You can find the api
Deploymentink8s/deployments/api_deployment.yml.
INFO
The api deployment runs a few commands on startup:
yes n | cp -i /storage-initial/database/database.sqlite 2>/dev/null;- Creates an empty database if one doesn't existphp artisan key:generate- Generates APP_KEYphp artisan optimize- Runs all Laravel cache commandsphp artisan migrate --force- Runs migrationsphp artisan db:seed --force- Runs seeders
- The deployment environment variables are stored in a
ConfigMapandSecretfile.- The
Configmapcan be found ink8s/configmaps/api_configmap.yml - The
Secretfile found ink8s/secrets/api_secret.yml
- The
UI Service
The ui service contains your Vue.js frontend.
It's based on the ui Docker image (ui/Dockerfile).
- You can find the ui
Serviceink8s/services/ui_service.yml. It's the simplest service config exposing the ui service on port80. - You can find the ui
Deploymentink8s/deployments/ui_deployment.yml. It's a simple deployment configuration with minimal presets.
Ingress Controller
DigitalOcean Marketplace - NGINX Ingress Controller
For the simplest deployment, the default DigitalOcean nginx-ingress installation should be sufficient.
- You can find the
Ingressconfig ink8s/ingress/ingress.yml. It's a simple ingress config that hosts theuiservice on the root of the domain and theapiservice on the/apipath.
Cert manager
DigitalOcean Marketplace - Cert-Manager
For the simplest deployment, the default DigitalOcean cert-manager installation should be sufficient.
- The
ClusterIssuerconfig for the letsencrypt staging server can be found ink8s/cluster_issuer.yml. - The
Certificateconfig can be found ink8s/certificate.yml.