|
| 1 | +# IDP Tutorial: Building a Production-Ready Platform with Crossplane and ArgoCD |
| 2 | + |
| 3 | +Welcome to the Internal Developer Platform (IDP) tutorial. This repository contains a complete, hands-on guide to building a production-ready, multi-cloud platform using Crossplane for infrastructure-as-code and ArgoCD for GitOps delivery. |
| 4 | + |
| 5 | +This project is designed for Senior DevOps Engineers who are already comfortable with Kubernetes and want to master the art of platform engineering. |
| 6 | + |
| 7 | +## Full Documentation |
| 8 | + |
| 9 | +The complete, detailed documentation for this tutorial is generated by MkDocs and can be found in the `/docs` directory. |
| 10 | + |
| 11 | +**➡️ [Next Section: Repository Management](./docs/repository-management/01-multi-repo-strategy.md)** |
| 12 | + |
| 13 | +## Prerequisites |
| 14 | + |
| 15 | +Before you begin, ensure you have the following: |
| 16 | + |
| 17 | +- A GitHub account. |
| 18 | +- Access to an Azure, GCP, or Hetzner cloud account (optional, but required for provider-specific exercises). |
| 19 | +- [Nix](https://nixos.org/download.html) and [Devbox](https://www.jetpack.io/devbox/docs/installing-devbox/) installed on your local machine (Linux or macOS). |
| 20 | + |
| 21 | +For detailed setup instructions, please see the **[Getting Started Guide](./docs/getting-started/01-introduction.md)**. |
| 22 | + |
| 23 | +## VS Code Configuration (Important) |
| 24 | + |
| 25 | +This repository contains configuration for the Gemini Code Assist extension in the `.vscode/mcp.json` file. This allows the assistant to have long-term memory about our project. |
| 26 | + |
| 27 | +After you clone this repository, you **must** update the `mcp.json` file to point to the absolute path of the `.memory` directory on your local machine. |
| 28 | + |
| 29 | +1. Open `.vscode/mcp.json`. |
| 30 | +2. Find the line containing `e:\Dev\idp-tutorial\.memory:/data`. |
| 31 | +3. Replace `e:\Dev\idp-tutorial` with the absolute path to where you have cloned this repository. |
| 32 | + |
| 33 | +**Example:** If you cloned the repository to `/home/user/projects/idp-tutorial`, the new line should be `"-v", "/home/user/projects/idp-tutorial/.memory:/data",`. |
| 34 | + |
| 35 | +## Quick Start: Bootstrapping the Environment |
| 36 | + |
| 37 | +These steps will get your local learning environment up and running. |
| 38 | + |
| 39 | +### 1. Create Your Platform GitOps Repository |
| 40 | + |
| 41 | +This tutorial provides the content for your "Platform GitOps Repo". You will create a new GitHub repository and push this content to it. |
| 42 | + |
| 43 | +1. **Clone this tutorial repository** to your local machine: |
| 44 | + |
| 45 | + ```bash |
| 46 | + gh repo clone icklers/idp-tutorial |
| 47 | + cd idp-tutorial |
| 48 | + ``` |
| 49 | + |
| 50 | +2. **Create your new Platform GitOps Repo on GitHub** and push the content. This command will create a new public repository on GitHub (e.g., `my-platform-gitops-repo`), push the current directory's content to it, and set it as the `origin` remote. |
| 51 | +
|
| 52 | + ```bash |
| 53 | + # Replace <your-repo-name> with your desired repository name (e.g., my-platform-gitops-repo) |
| 54 | + gh repo create <your-repo-name> --public --source . --remote origin |
| 55 | + ``` |
| 56 | +
|
| 57 | +This repository (`<your-repo-name>`) will now be your source of truth for all GitOps configurations. |
| 58 | +
|
| 59 | +### 2. Activate the Development Environment |
| 60 | +
|
| 61 | +This command uses Nix and Devbox to install the exact versions of all the tools required for this tutorial. |
| 62 | +
|
| 63 | +```bash |
| 64 | +devbox shell |
| 65 | +``` |
| 66 | +
|
| 67 | +### 3. Install Project Tools |
| 68 | +
|
| 69 | +Run the `setup-tools` script to install the Crossplane CLI and Python dependencies for MkDocs: |
| 70 | +
|
| 71 | +```bash |
| 72 | +devbox run setup-tools |
| 73 | +``` |
| 74 | +
|
| 75 | +### 4. Create the Local Kubernetes Cluster |
| 76 | +
|
| 77 | +This command creates a local Kubernetes-in-Docker (KinD) cluster that will serve as our platform's control plane. |
| 78 | + |
| 79 | +```bash |
| 80 | +kind create cluster --config gitops-bootstrap/kind-cluster/kind-cluster.yaml |
| 81 | +``` |
| 82 | + |
| 83 | +### 5. Bootstrap ArgoCD |
| 84 | + |
| 85 | +This is the only manual step. First, we create the namespace for ArgoCD. Then, we apply the official installation manifest directly from the ArgoCD project's GitHub repository. This is the recommended way to ensure you are installing a stable and complete version of ArgoCD. |
| 86 | +
|
| 87 | +Finally, we apply our `platform-core.yaml` to tell our new ArgoCD instance to start managing our platform from Git. |
| 88 | +
|
| 89 | +```bash |
| 90 | +# Create the namespace for ArgoCD |
| 91 | +kubectl create namespace argocd |
| 92 | +
|
| 93 | +# Apply the official ArgoCD installation manifest |
| 94 | +kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml |
| 95 | +
|
| 96 | +# The platform-core.yaml manifest needs to point to your new GitOps repository. |
| 97 | +# Set your repository URL as an environment variable and use `sed` to update the file. |
| 98 | +export PLATFORM_GITOPS_REPO_URL="https://github.com/your-username/your-repo-name.git" # <-- REPLACE THIS |
| 99 | +sed -i "s|__YOUR_PLATFORM_GITOPS_REPO_URL__|$PLATFORM_GITOPS_REPO_URL|g" gitops-bootstrap/argocd/platform-core.yaml |
| 100 | +
|
| 101 | +# Apply the Platform Core ApplicationSet to start the GitOps sync |
| 102 | +kubectl apply -f gitops-bootstrap/argocd/platform-core.yaml |
| 103 | +``` |
| 104 | +
|
| 105 | +### 6. Access ArgoCD |
| 106 | +
|
| 107 | +Your entire platform is now being created via GitOps. You can watch it happen in the ArgoCD UI. |
| 108 | +
|
| 109 | +```bash |
| 110 | +# Get the initial admin password |
| 111 | +kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d; echo |
| 112 | +
|
| 113 | +# Port-forward the ArgoCD server |
| 114 | +kubectl port-forward svc/argocd-server -n argocd 8080:443 |
| 115 | +``` |
| 116 | +
|
| 117 | +You can now log in to `https://localhost:8080` with username `admin` and the password you just retrieved. |
| 118 | +
|
| 119 | +## Next Steps |
| 120 | +
|
| 121 | +Your environment is now fully bootstrapped. To understand what you've built and how to use your new platform, please proceed to the **[full tutorial documentation](./docs/index.md)**. |
0 commit comments