This document shows deployment process for a FleetDM Helm chart on a local Minikube cluster started on Docker driver.
To deploy the FleetDM Helm chart, the following tools are required:
The deployment process uses a Makefile to simplify cluster creation and chart installation.
make cluster
flamingo namespace.
make install
localhost, run Minikube tunnel in the background.
make tunnel
http://localhost.The database migration for FleetDM is executed as a Kubernetes Job. Initially, I considered running fleetdm prepare db as a container within the same pod before starting fleetdm serve.
To confirm that FleetDM and its dependencies (MySQL and Redis) are running correctly, use the following checks:
http://localhost after running make tunnel.kubectl exec flamingo-mysql-0 -n flamingo -- mysqladmin -u fleet -pLab123 ping
Output:
mysqld is alive
kubectl exec -it flamingo-redis-master-0 -n flamingo -- redis-cli -a Lab123 PING
Output:
PONG
To make the FleetDM Helm chart publicly available, a Helm has been created at https://nikstormov.github.io/flamingo/charts. Further work is needed to learn how to maintain and release updates for the chart, including versioning and documentation.
For CI/CD integration, the proposed workflow includes:
helm dependency update.helm package to create a .tgz archive.During the setup, I faced issues with MySQL, which were resolved by adjusting the MySQL version.
FAIL 20220915165115_AppleMDMTables.go (failed to apply nanomdm schema: Error 6125: Failed to add the foreign key constraint. Missing unique key for constraint 'nano_enrollments_ibfk_2' in the referenced table 'nano_users'), quitting migration.
Changed Version to 8.0.24
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/opt/bitnami/mysql/tmp/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/opt/bitnami/mysql/tmp/mysql.sock' exists!