How iamsaikishore/project4---deploying-a-sample-php-to-do-3-tier-application-on-kubernetes-cluster works
Main Components
• Master Node and Worker Node(s): Represent the control plane (master) and the compute nodes (workers) where the application and database pods run.
• Application Tier (PHP App):
• A PHP pod running the PHP To-Do Application built from the provided Dockerfile and index.php.
• Exposed via a NodePort service (phpapp-svc) on port 8088.
• Data Tier (MySQL Database):
• A MySQL pod (mysql-pod) configured via a YAML file.
• Environment variables are injected via a ConfigMap (db-config) and a Secret (db-secret).
• Exposed via a ClusterIP service (mysql-svc) on port 3306.
• Administration Tier (phpMyAdmin):
• A phpMyAdmin pod (phpadmin-pod) set up through its respective YAML file.
• Configured through a ConfigMap (phpadmin-config) and Secret (phpadmin-secret).
• Exposed via a NodePort service (phpadmin-svc) on a designated port (8099).
Relationships and Interactions
• The PHP application (frontend) communicates with the MySQL database (backend) via the ClusterIP service.
• phpMyAdmin interacts with the MySQL pod (again using the ClusterIP) to manage the database.
• End-users access the PHP app and phpMyAdmin using their respective NodePort services configured on the Kubernetes cluster.
• The Kubernetes setup (using kubeadm) on both master and worker nodes orchestrates scheduling, deployment, and networking between the pods.
Architectural Patterns and Design Principles
• Three-Tier Architecture: Clearly separates presentation (PHP app), business/data logic (MySQL), and administration (phpMyAdmin).
• Containerization & Orchestration: Docker images (via Dockerfile) and Kubernetes pods ensure modularity and scalability.
• Environment Configuration: Use of ConfigMaps and Secrets shows best practices in managing configuration data distinct from code.
• Microservices/Pod Pattern: Even though the components are relatively monolithic in function, they run in separate pods, demonstrating a loosely-coupled design.
Technologies & Frameworks
• PHP for the application logic.
• MySQL as the database.
• phpMyAdmin for database administration.
• Docker for containerization.
• Kubernetes as the orchestration platform (using kubeadm for cluster setup).