GithubHelp home page GithubHelp logo

rahul1804 / how-to-write-a-reconciler-using-k8s-controller-runtime Goto Github PK

View Code? Open in Web Editor NEW

This project forked from scottrigby/how-to-write-a-reconciler-using-k8s-controller-runtime

0.0 1.0 0.0 14.7 MB

How To Write a Reconciler Using k8s Controller-Runtime!

License: Apache License 2.0

Shell 4.49% Go 87.02% Makefile 7.39% Dockerfile 1.10%

how-to-write-a-reconciler-using-k8s-controller-runtime's Introduction

Tutorial: How To Write a Reconciler Using K8s Controller-Runtime!

Open in Gitpod

Git repo for talk at KubeCon NA 2022. Scott Rigby, Somtochi Onyekwere, Niki Manoledaki & Soulé Ba, Weaveworks; Amine Hilaly, Amazon Web Services. https://sched.co/182Hg

This tutorial walks you through building your own controller using controller runtime, the set of common libraries on which core controllers are built. We'll use Kubebuilder, a framework for building APIs using custom resource definitions (CRDs). We'll also explain lesser-documented best practices and conventions for writing controllers that the community has developed through trial and error learning, through projects such as Flux and Cluster API.

How this repo is organized

Since we'll be building a controller with reconcilers, we'll need something to reconcile.

For this, we've built a simple API for submitting KubeCon CFP proposals, using CRDs.

Local Dev

Fork this repository, then clone it:

git clone [email protected]:<your username>/how-to-write-a-reconciler-using-k8s-controller-runtime.git

Dependencies:

For the local dev setup, there are a few options:

  1. GitPod. GitPod is the preferred method, to ensure all users are running in the same environment regardless of their local machine OS. Please click on the button "Open in Gitpod" at the top of this README. Click through the default settings until you arrive at a page that looks like VSCode. Then, wait while the dependencies load (approximately ~6 minutes).

  2. Vagrant. As a backup, there is a Vagrantfile with instructions here.

  3. DIY. If you have all the required dependencies, you can go ahead and spinup a dev environment:

cd cfp
make docker-build
make setup-kind
make dev-deploy
export KUBECONFIG=/tmp/cfp-api-test-kubeconfig

Step-By-Step Guide

Once the dev env setup is ready, each step will use a git tag.

There are 7 steps, which match to 7 tags:

Screen Shot 2022-10-26 at 4 07 05 PM

To move from one tag to another, checkout the tag and create a new branch from it.

For example, move to the first step:

git checkout tags/s1 -b s1

Then, run the tests:

make test

And so on for each step!

how-to-write-a-reconciler-using-k8s-controller-runtime's People

Contributors

a-hilaly avatar scottrigby avatar somtochiama avatar souleb avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.