Event recorder for Kluster and routines to handle Objects from Queue | Writing K8S Operator - Part 5

preview_player
Показать описание
In this video we continued writing the Kluster operator that we have been writing in some of the previous videos. We, specifically, implemented two functionalities
- Wait for a k8s cluster to get create in DigitalOcean and update the status of the Kluster resource
- Generating events

Apart from that we also talked about what happens if we just use one go routine to handle the objects from the work queue that we maintain.

GitHub repo for this Project:

Ekspose Playlist:

Ekspose GitHub Repo:

Krius: GitHub Repo:

Kluster Playlist:

Web:

00:00 Introduction
00:35 What we have done already
01:59 Agenda
02:46 What has already been done
05:06 Wait for cluster creation
19:31 Update the status to be running
24:50 Cluster status update failed
25:50 Resolve previous failure
28:33 Test again
30:35 Summary till now
32:05 What are Event recorders
34:14 Implementing event recorder for Kluster
44:10 Testing events for Kluster
45:47 Failures and fixes for event recorder
47:04 Testing events again
47:51 Handling delete of Kluster
49:23 Concurrency issue with Operator
51:28 Like, Share and Subscribe
Рекомендации по теме
Комментарии
Автор

Hi Vivek! Just now, I started with part 1 of this segment and you are already here with part 5 :)...Your explanations are on point and precise..kudos man!

manibharathi
Автор

Very nice explanation @Vivek as usual. Thanks for creating such videos.

bagulm
Автор

Thanks a lot for creating this series.

prayagsingh
Автор

Hi @vivek! I wanted to say, Thanks alot for your walkthroughs and explanation of building controllers, also going over the shared informers and so on. Is there a possibility that you can add unit/integration testing to these concepts as well? thanks a bunch

simeonpoot
Автор

Hello Vivek sir, can i use kubernetes on windows machine?

abhishrai
Автор

Hi Vivek, may I ask if there is a way to combine the ekspose controller and the kluster controller together? For example, is there a way to detect which cloud resource is created and therefore handle the events accordingly based on the type of the cloud resources? Since I completed your tutorial for ekspose. I am thinking if these two can merge in some way. Thanks!

siqistechroad
Автор

Hi Vivek Ji, can I know how
1. How to get the raw events on create/update/delete service?
2. Is Informar the best way to get those events?
3. On actual object update on API cluster the informer will also update the respective object in cache?

sachinshingare
Автор

delete method with finalizer would be dope

jwalitpatel
Автор

Hello Vivek. Thank you for the another great explanation.
47:51 min you explains how to delete the cluster from DO.

I am trying to implement it - the question is object was deleted then how to get clusterID for passing to DO api.
Here is my code snippet:
ctx := context.Background()
//_, err = c.client.AppsV1().Deployments(ns).Get(ctx, name, metav1.GetOptions{})
_, err = c.klient.ViveksinghV1alpha1().Klusters(ns).Get(ctx, name, metav1.GetOptions{})
if apierrors.IsNotFound(err) {
// get the latest version of kluster
k, err := c.klient.ViveksinghV1alpha1().Klusters(ns).Get(context.Background(), name, metav1.GetOptions{})
if err != nil {
log.Printf("error genning cluster ID %s", err.Error())
return false
}

log.Printf("Object deleted ... \n Should call DO delete API for a cluster ID %s !!", k.Status.KlusterID)
}
Please advise.

oruchovets