Skip to content

NikStormov/flaminto_ta

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FleetDM Helm Chart Deployment

This document shows deployment process for a FleetDM Helm chart on a local Minikube cluster started on Docker driver.

Prerequisites

To deploy the FleetDM Helm chart, the following tools are required:

Installation

The deployment process uses a Makefile to simplify cluster creation and chart installation.

  1. Create the Minikube Cluster: The cluster is created with the Docker driver.

    make cluster
  2. Install the Helm Chart: Deploy the FleetDM chart, including MySQL and Redis dependencies, to the flamingo namespace.

    make install
  3. Expose Services with Minikube Tunnel: To make services accessible via localhost, run Minikube tunnel in the background.

    make tunnel
  4. Access FleetDM: After running the tunnel, FleetDM is available at http://localhost.

Database Migration

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.

Verification

To confirm that FleetDM and its dependencies (MySQL and Redis) are running correctly, use the following checks:

FleetDM

  • Verify connectivity by accessing http://localhost after running make tunnel.
  • Note: FleetDM requires MySQL and Redis to be operational to start successfully.

MySQL

  • Check the MySQL server status:
    kubectl exec flamingo-mysql-0 -n flamingo -- mysqladmin -u fleet -pLab123 ping
    Output:
    mysqld is alive
    

Redis

  • Verify Redis connectivity:
    kubectl exec -it flamingo-redis-master-0 -n flamingo -- redis-cli -a Lab123 PING
    Output:
    PONG
    

What Next

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:

  1. Updating chart dependencies using helm dependency update.
  2. Packaging the chart with helm package to create a .tgz archive.
  3. On successful build, pushing the updated chart to the Helm repository.
  4. Triggering a deployment to test or production environments.

Issues Encountered

During the setup, I faced issues with MySQL, which were resolved by adjusting the MySQL version.

MySQL Database Error

  • Error:
      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!
    
  • Cause: The issue was caused by an incompatible MySQL version.
  • Resolution: Use propriate verison taken from git

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published