Skip to content

Spin up a complete internal developer platform with only Docker required as a dependency.

License

Notifications You must be signed in to change notification settings

cnoe-io/idpbuilder

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Oct 26, 2023
2ff688c · Oct 26, 2023

History

31 Commits
Oct 25, 2023
Oct 2, 2023
Sep 28, 2023
Sep 28, 2023
Oct 26, 2023
Oct 13, 2023
Oct 24, 2023
Sep 28, 2023
Oct 24, 2023
Oct 25, 2023
Oct 25, 2023
Sep 28, 2023
Oct 2, 2023

Repository files navigation

IDP Builder

Internal development platform binary launcher.

WORK IN PROGRESS: This tool is in a pre-release stage and is under active development.

About

Spin up a complete internal developer platform using industry standard technologies like Kubernetes, Argo, and backstage with only Docker required as a dependency.

This can be useful in several ways:

  • Create a single binary which can demonstrate an IDP reference implementation.
  • Use within CI to perform integration testing.
  • Use as a local development environment for IDP engineers.

Quickstart:

Build

make

Run

./idpbuilder create --buildName localdev

You can also define the kubernetes version to image and which corresponds to the kind pre-built image. ./idpbuilder create --kubeVersion v1.27.3

If it is needed to expose some extra Ports between the docker container and the kubernetes host, they can be declared as such ./idpbuilder create --extraPorts 22:32222

It is also possible to use your own kind config file ./idpbuilder create --buildName local --kindConfig ./my-kind.yaml

NOTE: Be sure to include in your kind config the section containerdConfigPatches where the registry hostname includes the name specified with the parameter: --buildname

containerdConfigPatches:
- |-
  [plugins."io.containerd.grpc.v1.cri".registry.mirrors."localhost:5001"]
    endpoint = ["http://idpbuilder-<localBuildName>-registry:5000"]

Use

Kubernetes: kubectl get pods

Argo: https://argocd.cnoe.localtest.me:8443/

Backstage: https://backstage.cnoe.localtest.me:8443/

Architecture

The IDP builder binary is primarily composed of a wrapper around a Kubebuilder based operator and associated type called localbuild. See: api/v1alpha1/localbuild_types.go and pkg/controllers/localbuild/controller.go

However it starts out by creating a Kind cluster to register the CRD and controller for localbuild and to host the resources created by it which in turn create the basis for our IDP. You can see the steps taken to install the dependencies and stand up the localbuild controller in the CLI codebase here: pkg/build/build.go

Kind Cluster

The Kind cluster is created using the Kind library and only requires Docker be installed on the host. See: ReconcileKindCluster

Localbuild

Localbuild's reconciler steps through a number of subreconcilers to create all of the IDP components. See: Subreconcilers

The subreconcilers currently include:

GitServer

Gitserver is essentially a fileserver for the Argo apps that are packaged within this IDP builder. As you might expect, it serves the files used by the ArgoCD apps using the git protocol. You can see the container image that contains these files get built here in the GitServer Reconciler

Embedded Argo Apps

The embedded Argo apps are created by the Localbuild reconciler See: Argo Apps Then they are picked up by the ArgoCD operator which in turn connects to the GitServer to perform their gitops deployment.

The resources served by the GitServer are contained within this binary here: pkg/apps/srv

They include:

As you can imagine each of these apps are are deployed by ArgoCD to the Kind cluster created by CLI. The Argo apps can be inspected with kubectl in the argocd namespace and the resources they create can be seen in their corresponding namespaces (backstage and crossplane)

Diagram

Excalidraw diagram here:

Extending the IDP builder

In the future we hope to allow for a pluggable interface to allow for extending the IDP builder with additional argo apps. For now you simply need to add additional apps in the Embedded Apps and also add the resources they will deploy in the srv folder: pkg/apps/srv