Install via Kubernetes
警告
We highly recommend the helm approach, this page is for Advanced Installation only
We provide a sample k8s-deploy.yaml to help deploy DevLake to Kubernetes
k8s-deploy.yaml will create a namespace devlake
on your k8s cluster, and use nodePort 30004
for config-ui
, nodePort 30002
for grafana
dashboards. If you would like to use a specific version of Apache DevLake, please update the image tag of grafana
, devlake
and config-ui
deployments.
Step-by-step guide
- Download k8s-deploy.yaml
- Customize the settings (
devlake-config
config map):- Settings shared between
grafana
andmysql
MYSQL_ROOT_PASSWORD
: set root password formysql
MYSQL_USER
: shared betweenmysql
andgrafana
MYSQL_PASSWORD
: shared betweenmysql
andgrafana
MYSQL_DATABASE
: shared betweenmysql
andgrafana
- Settings used by
grafana
MYSQL_URL
: set MySQL URL forgrafana
in$HOST:$PORT
formatGF_SERVER_ROOT_URL
: Public URL to thegrafana
- Settings used by
config-ui
:GRAFANA_ENDPOINT
: FQDN of grafana which can be reached within k8s cluster, normally you don't need to change it unless namespace was changedDEVLAKE_ENDPOINT
: FQDN of devlake which can be reached within k8s cluster, normally you don't need to change it unless namespace was changedADMIN_USER
/ADMIN_PASS
: Not required, but highly recommended
- Settings used by
devlake
:DB_URL
: update this value ifMYSQL_USER
,MYSQL_PASSWORD
orMYSQL_DATABASE
were changedLOGGING_DIR
: the directory of logs for Devlake - you likely don't need to change it.
- Settings shared between
- The
devlake
deployment store its configuration in/app/.env
. In our sample yaml, we usehostPath
volume, so please make sure directory/var/lib/devlake
exists on your k8s workers, or employ other techniques to persist/app/.env
file. Please do NOT mount the entire/app
directory, because plugins are located in/app/bin
folder. - Finally, execute the following command and DevLake should be up and running:
kubectl apply -f k8s-deploy.yaml
FAQ
Can I use a managed Cloud database service instead of running database in k8s?
Yes, it only takes a few changes in the sample yaml file. Below we'll use MySQL on AWS RDS as an example.
- (Optional) Create a MySQL instance on AWS RDS following this doc, skip this step if you'd like to use an existing instance
- Remove the
mysql
deployment and service sections fromk8s-deploy.yaml
- Update
devlake-config
configmap according to your RDS instance setup:
MYSQL_ROOT_PASSWORD
: remove this lineMYSQL_USER
: use your RDS instance's master usernameMYSQL_PASSWORD
: use your RDS instance's passwordMYSQL_DATABASE
: use your RDS instance's DB name, you may need to create a database first withCREATE DATABASE <DB name>;
MYSQL_URL
: set this forgrafana
in$HOST:$PORT
format, where $HOST and $PORT should be your RDS instance's endpoint and port respectivelyDB_URL
: update the connection string with your RDS instance's info fordevlake