Getting Started with Contributing to d1-fleet in controlplaneio-fluxcd

The controlplaneio-fluxcd/d1-fleet project is an open-source initiative that aims to provide a GitOps continuous delivery solution for managing Kubernetes clusters. As a developer interested in contributing to this project, this guide will walk you through the necessary steps to get started.

Prerequisites

Before diving into the contribution process, ensure you have the following prerequisites in place:

  1. Familiarity with Git and GitHub: You should be comfortable with using Git for version control and GitHub for managing repositories.
  2. Kubernetes knowledge: A solid understanding of Kubernetes concepts, such as manifests, pods, and services, is essential.
  3. Development environment: Set up your development environment with the required tools, such as kubectl, make, and flux.

Building the Application

To build the application, use the following command:

make

This command generates the binary of the application for the platform team.

Bootstrapping Clusters with Flux

To bootstrap the staging and production clusters with Flux, use the following command:

flux bootstrap github

This command initializes the Flux configuration in the Git repository and sets up the Flux controller in the Kubernetes cluster.

Applying Kubernetes Manifests

To apply Kubernetes manifests, use the following command:

kubectl apply -f <file>.yaml

Replace <file>.yaml with the path to the YAML file containing the Kubernetes manifest.

Monitoring the Reconciliation Process

To monitor the reconciliation process, use the following command:

watch flux get kustomizations --all-namespaces

This command displays the status of all the Kustomizations in all namespaces.

Merging Changes

To merge changes from the main branch to the production branch, follow these steps:

  1. Checkout the production branch:
git checkout production <branch>
  1. Merge changes from the main branch:
git merge main
  1. Push the changes to the production branch:
git push origin production <branch>

Creating Secrets

To create secrets for various purposes, use the following commands:

  • Create a GitHub secret for the Flux bot account:
flux create secret git flux-system
  • Create a GitHub secret for the Flux bot account for tenant components:
flux create secret git flux-apps
  • Create a Kubernetes Image Pull Secret for the enterprise registry in the flux-system namespace:
flux create secret oci flux-enterprise-auth
  • Create a GitHub secret for a specific purpose:
flux create secret git <secret-name>

Replace <secret-name> with the desired name for the secret.

Copying Images

To copy images from the ControlPlane registry to your organization’s registry, use the crane copy command:

crane copy <image>:<tag> <new-registry>/<new-image>:<tag>

Replace <image>:<tag> with the source image and tag, and <new-registry>/<new-image>:<tag> with the destination registry, image, and tag.

Port Forwarding and Accessing Grafana

To start port forwarding for Grafana and access the dashboard in the browser, use the following commands:

kubectl port-forward service/grafana 3000:3000

Then, open your web browser and navigate to http://localhost:3000.

CI/CD Configurations

The project uses various CI/CD configurations to ensure a smooth development and deployment process. These configurations include:

  • GitHub Actions: For continuous integration and continuous delivery.
  • Flux: For GitOps continuous delivery.

For more information on these configurations, refer to the following resources:

By following these steps and guidelines, you’ll be well on your way to contributing to the controlplaneio-fluxcd/d1-fleet project. Happy coding!