How zopdev/opentofu-modules works
Main Components
• Core Terraform Module Repository: Encompasses all configuration modules.
• Modules by Functionality:
• Account-Setup: Sets up prerequisites such as VPCs, subnets, and related network resources needed for Kubernetes cluster creation.
• Artifact: Manages artifacts necessary for cloud deployments.
• Bash-Codes: Contains scripts to establish hosted zones, manage remote state, and automate secret management.
• Cassandra (WIP): Provisioning for deploying Cassandra clusters.
• GitHub: Automates the management (repos, teams, secrets) on GitHub.
• Kubernetes (k8s): The central module for configuring Kubernetes clusters across AWS, GCP, and Azure. This module includes sub-modules for specific cloud provider setups (e.g., EKS on AWS, AKS on Azure, and GKE on GCP) and related namespace, ingress, and network/security configurations.
• Kafka: Sets up Kafka clusters for AWS and Azure.
• Observability: Implements observability tools (Loki, Tempo, Cortex) using configurations per cloud provider.
• Redis: Manages redis clusters for caching on AWS (ElastiCache), Azure, and GCP as well as local testing.
• SQL: Provisions databases (MySQL, PostgreSQL) with templates and configurations for each cloud provider.
• Additional modules such as “zop-helm” and “zop-system” extend the deployment to further helm and system-level resource management.
• Cloud Provider Abstraction: Almost every module is subdivided into provider-specific configurations (aws, azure, gcp), reflecting the project's multi-account, multi-cloud approach.
Relationships and Interactions
• The “Account-Setup” module is a foundational component on which other modules depend. For example, before provisioning a Kubernetes cluster (k8s) or a SQL database, the necessary cloud network and VPC configurations must be in place.
• “Bash-Codes” and “Remote-State” modules support configuration management, secret handling, and remote state management across many other modules.
• The “GitHub” module handles integration with version control and automates team/repo creation, usually a supporting but standalone component.
• “Artifact”, “Kafka”, “Observability”, “Redis”, and “SQL” modules work independently to provision infrastructure, but they often serve as underlying services for larger deployments (like Kubernetes workloads).
Architectural Patterns and Design Principles
• Modular Design: Each functional area (e.g., network setup, compute, storage) is encapsulated in its own module following Terraform best practices.
• Provider-Specific Abstraction: Each module typically subdivides into aws, azure, and gcp directories to isolate provider-specific configuration.
• Reusability and Extensibility: The modules include default configurations (var.tf, versions.tf) and templates for extending functionalities (e.g., helm charts and templated resources).
• Integration & Automation: Integrated secret management and automated remote state set-ups emphasize a “no human secrets” approach and continuous delivery.
Relevant Technologies and Frameworks
• Terraform and its modules/layout (main.tf, variables, outputs, versions).
• Shell scripting (in bash-codes) for provisioning supporting automation tools.
• Cloud-specific services (AWS EKS/MSK, Azure AKS, GCP GKE, etc.) as indicated by the file structure.
• Kubernetes configurations (various k8s submodules for clusters, namespaces, nginx, etc.) with helm templating.
Final Recommendations
• Multi-cloud strategy by clearly showing the branches for each cloud provider.
Happy Diagramming!