MySQL Logo

MySQL Provisioning

Laralord provisions MySQL, a popular open-source relational database, as a core component for efficient data storage in Kubernetes clusters. Widely used in Laravel projects for its performance and simplicity, MySQL supports application data management with seamless integration. This page details the MySQL deployment, its NodePort access, the phpMyAdmin dashboard for management, and integration with Laralord’s multi-tenant SaaS platform. For more information, refer to the official MySQL documentation.

phpMyAdmin Dashboard
phpMyAdmin dashboard for MySQL, securely accessed via Laralord’s SSO proxy

MySQL Overview

MySQL is a fast, reliable, and widely adopted open-source relational database, known for its ease of use and performance in web applications. It is a popular choice for Laravel projects due to its compatibility with Laravel’s Eloquent ORM and support for efficient data storage and retrieval. Laralord deploys MySQL with secure NodePort access and an HTTP-based phpMyAdmin dashboard, enabling robust data management for multi-tenant SaaS applications.

MySQL Deployment Details

Laralord deploys MySQL in a user-defined namespace using a Helm chart from Bitnami’s container registry. The deployment is configured for security, scalability, and manageability, with NodePort access for database connections and a phpMyAdmin dashboard for administration. Key aspects include:

  • Namespace: Deployed in a user-defined namespace (e.g., databases), isolating MySQL from other services for security and organization.
  • Helm Configuration: Uses a specific Helm chart version with settings for root, user, and replication credentials, a dedicated database, and support for a single replica (with commented-out replication options).
  • Secret Management: Stores connection details (host, port, root password, user password, replication password, database name) in a Kubernetes secret, with randomly generated passwords for enhanced security.
  • mTLS Support: Configures mTLS client certificate authentication, with details stored in the secret for secure external connections.
  • Authentication: Uses password-based authentication for internal and external connections, with credentials managed via the Kubernetes secret.
  • NodePort Access: Exposes MySQL via a NodePort service on port 3306, using a dynamically assigned node port for external connectivity within the cluster.
  • phpMyAdmin Dashboard: Provides an HTTP-based phpMyAdmin interface, accessible via a custom domain (e.g., phpmyadmin.your-domain), routed through APISIX Gateway for secure management.
  • Replication Readiness: Configured with one secondary replica, with options for enabling full replication commented out for future scalability.

Key Features

The MySQL deployment by Laralord provides the following features:

  • Relational Database: Supports efficient data storage, queries, and transactions for Laravel applications.
  • Secure Connectivity: Uses password authentication and mTLS for authenticated, encrypted database access.
  • NodePort Access: Enables direct client connections via a dynamically assigned NodePort on port 3306.
  • phpMyAdmin Dashboard: Offers a user-friendly HTTP interface for database administration, securely accessed via APISIX.
  • Replication Support: Configured with one replica, with options for full replication to enhance availability.
  • Laravel Compatibility: Integrates seamlessly with Laravel’s Eloquent ORM for streamlined data management.

Why MySQL?

MySQL is chosen by Laralord for its performance, simplicity, and compatibility with Laravel ecosystems. Key advantages include:

  • Laravel Integration: Native support for Laravel’s Eloquent ORM, enabling efficient database operations for web applications.
  • Security: Password authentication and mTLS ensure data protection in multi-tenant environments.
  • Performance: Optimized for high-throughput workloads, ideal for SaaS applications with frequent database queries.
  • Scalability: Supports replication (with one replica enabled), providing a foundation for high availability.
  • Kubernetes-Native: Seamlessly integrates with Kubernetes via Helm, with NodePort and phpMyAdmin for accessibility.

Integration with Laralord

MySQL is a cornerstone of Laralord’s multi-tenant SaaS platform, providing reliable data storage for tenant applications. Key integrations include:

  • Tenant Databases: Each tenant uses a dedicated database with unique credentials, ensuring data isolation within the MySQL cluster.
  • Laravel Applications: Powers Laravel applications via the MySQL driver, configured with tenant-specific connection details.
  • APISIX Gateway: Routes phpMyAdmin traffic to a custom domain, enforcing mTLS and SSO for secure dashboard access.
  • Vault Integration: Stores tenant-specific database credentials in Vault HashiCorp, securely distributing them to applications.
  • Argo CD Deployments: Supports Argo CD-managed applications by providing persistent storage for tenant data.
  • Valkey Synergy: Complements Valkey for caching and queuing, with MySQL handling persistent storage.
  • PostgreSQL Alternative: Offers an alternative to PostgreSQL, providing flexibility for Laravel applications requiring MySQL’s features.

Secure Access with NodePort and phpMyAdmin

Laralord secures access to MySQL through a NodePort service and an HTTP-based phpMyAdmin dashboard, ensuring robust authentication and encryption. Key features of the secure access mechanism include:

  • NodePort Connectivity: Clients connect to MySQL via a NodePort service on port 3306, using a dynamically assigned node port for external access within the cluster.
  • Password Authentication: Internal and external connections use randomly generated passwords (root, user, replication) stored in a Kubernetes secret.
  • mTLS Encryption: External connections support mTLS with client certificate authentication, with details stored in the secret.
  • phpMyAdmin Dashboard: Provides a secure HTTP interface for database management, accessible via APISIX Gateway on a custom domain (e.g., phpmyadmin.your-domain) with SSO and mTLS.
  • APISIX Gateway Proxy: Routes phpMyAdmin traffic, enforcing SSO, mTLS, and HTTP-to-HTTPS redirection for secure access.
Laralord © 2024UI Build: 0.1.0-rc1-42-g4cde