Автор: apachy_admin

  • Building a Multi-Cloud Management Plane with Crossplane: What I Learned

    Over the past few weeks I’ve been building something I’ve wanted to try for a while: a GitOps-managed, multi-cloud control plane using Crossplane.

    🍀The core idea🍀


    Instead of running Terraform apply every time infrastructure needs to change, the management cluster (`gke-mgmt`) runs Crossplane, which continuously reconciles the desired state described in Git against the actual state in the cloud. Add a YAML file describing a database, push it, and Crossplane creates it. Delete the file, and it tears it down. No manual `apply`, no drift between what’s documented and what’s running.

    FluxCD handles the GitOps loop; Crossplane handles the actual cloud API calls; OpenBao handles secrets, synced into clusters via External Secrets Operator.

    Crossplane’s provider ecosystem covers essentially every major cloud (AWS, Azure, and more), Helm provider, Kubernetes provider. «Multi-cloud» here it means one declarative pattern that doesn’t care where the API endpoint lives.

    🍀Two kinds of repositories, on purpose🍀

    One decision that paid off: infrastructure and application code live in separate repositories, with separate lifecycles. Three repositories handle infrastructure — one for the Terraform bootstrap layer, one for the management cluster’s GitOps state, one per workload cluster. Everything else — the actual applications running on top lives in its own repository with its own CI pipeline, building and pushing container images that the infrastructure layer picks up automatically via Flux’s image automation. Infrastructure changes and application deploys never touch the same pull request, and each repo has exactly the access it needs — nothing more.

    🍀You still need Terraform first🍀

    Crossplane needs somewhere to run — Kubernetes cluster, which itself needs to be created by something. 
    So the real architecture is a two-layer bootstrap:

    • Terraform (for example) creates the management cluster, core IAM/OIDC trust relationships, and KMS keys infrastructure that changes rarely and needs a human in the loop.
    • Crossplane, running inside that cluster, takes over everything downstream: additional clusters (including on other clouds), managed databases, storage buckets and etc.

    You can pause the management cluster when you’re not actively changing infrastructure. The GKE dev cluster, the Cloud SQL instance, the storage bucket — none of them depend on Crossplane being «up» to keep running. It only needs to be running when you want reconciliation, drift correction, or new resources.

    The honest caveat: while it’s paused, nothing gets corrected if something drifts, and any secret rotation that depends on it pauses too. It’s a real cost-saving lever, but for a personal use.
    🍀🍀🍀🍀🍀🍀🍀🍀🍀

    #Crossplane#MultiCloud#IaC#FluxCD#GitOps

  • Создание мультиоблачного Control Plane на базе Crossplane

    Давно хотела попробовать реализовать управляемый через GitOps мультиоблачный control plane с использованием Crossplane.

    🍀 Основная идея 🍀


    Управляющий кластер (gke-mgmt) запускает Crossplane, который непрерывно сверяет желаемое состояние, описанное в Git, с реальным состоянием в облаке. Добавили YAML-файл с описанием базы данных, закоммитили — Crossplane её создаёт. Удалили файл — он её уничтожает. Никаких ручных apply и никакого рассинхрона между тем, что задокументировано, и тем, что реально работает.

    За GitOps отвечает FluxCD; Crossplane обрабатывает вызовы к API облачных провайдеров; OpenBao хранит секреты, которые синхронизируются в кластере через External Secrets Operator.
    Для Crossplane существуют провайдеры практически для всех облаков (AWS, Azure и другие), провайдеры для Helm и Kubernetes. «Мультиоблачность» означает единый декларативный шаблон, которому неважно, где именно находится конечная точка API.

    🍀 Два типа репозиториев🍀


    Код инфраструктуры и код приложений живут в разных репозиториях с разным жизненным циклом. За инфраструктуру отвечают три репозитория: один для слоя бутстрапа (Terraform), один для GitOps-состояния управляющего кластера и по одному на каждый рабочий кластер (workload cluster).

    Всё остальное — сами приложения, работающие поверх этой системы — живет в собственных репозиториях со своими CI-пайплайнами. Они собирают и публикуют Docker-образы, которые инфраструктурный слой подхватывает автоматически через автоматизацию images во Flux. Изменения в инфраструктуре и деплой приложений никогда не пересекаются в одном Pull Request, и каждый репозиторий имеет ровно тот уровень доступа, который ему необходим — ничего лишнего.

    🍀 Terraform всё ещё нужен на первом этапе 🍀

    Crossplane должно где-то исполняться в Kubernetes-кластере, который должен быть чем-то создан. Итоговая архитектура представляет собой двухслойную развертку:

    • Terraform (как пример) создаёт управляющий кластер, базовые связи IAM/OIDC и ключи KMS — ту часть инфраструктуры, которая меняется редко и требует участия человека.
    • Crossplane, работая внутри этого кластера, берет на себя всё остальное: дополнительные рабочие кластеры (в том числе в других облаках), управляемые базы данных, бакеты хранилища и т.д.

    Вы можете ставить управляющий кластер на паузу, когда не занимаетесь активными изменениями инфраструктуры. Созданные рабочие кластера, экземпляры Cloud SQL, бакеты в Object Storage — не зависят от работоспособности Crossplane. Его можно запустить, когда вам нужна сверка состояний, исправление рассинхронизаций или создание новых ресурсов.

    Но пока он на паузе, автоисправление не работает, замена секретов приостанавливается. Экономит бюджет, но скорее при личном использовании или небольших проектов.
    🍀🍀🍀🍀🍀🍀🍀🍀🍀

    #Мультиоблачность#DevOps#GitOps#IaC