Thursday, October 29, 2020

Tutorial: Custom Resource Definition, Controller and Webhook from Scratch with Kubebuilder

Here is a tutorial that I wrote on how to create from scratch using kubebuilder a simple CRD with a controller with webhooks.

Gotta say that I had to jump multiple hoops but I documented the entire step-by-step.

This will be possibly a series of tutorials because I need to create multiple versions of the same API Group to support the work I am contributing to Project Velero.

Very well, in a nutshell, the tutorial creates the following:

RockBand CRD:
$ kubectl get crd rockbands.music.example.io NAME CREATED AT rockbands.music.example.io 2020-10-28T19:51:25Z 

Spec of the CRD:
type RockBandSpec struct {
	// +kubebuilder:validation:Optional
	Genre string `json:"genre"`
	// +kubebuilder:validation:Optional
	NumberComponents int32 `json:"numberComponents"`
	// +kubebuilder:validation:Optional
	LeadSinger string `json:"leadSinger"`
}
Webhook Mutator Logic:

- if LeadSinger is not specified, set it as "TBD". 
- if RockBand CR name is "beatles" and Lead Singer is "John", set it to "John Lennon" Webhook 

Validator Logic:

- We can't create RockBands CRs on "kube-system" namespace 
- We can't update Lead Singer as "John" if RockBand CR name is "beatles" 
- We can't update Lead Singer as "Ringo" if RockBand CR name is "beatles". 

Again, the link to the tutorial and code:

Enjoy!! And comments are appreciated!!

Tuesday, October 27, 2020

Data Platform on K8s

What is a data platform?

It is just a fancy name for components that will work together to make data usable and consumable by the business. 

 Nowadays, it makes sense to rely on Kubernetes for your data needs. The more we rely on K8s, the more cloud-native we are. 

This month I released with @geetakulkarni a VMware fling that enables any K8s cluster to run Kafka, Spark, Solr and ELK. 

 Additionally, we have a sample market data app stitching all these components together. 

The market data is provided by my friends of DevExperts with delayed market data over REST API freely available. 

You can find the link to the VMware fling here:



Wednesday, October 7, 2020

kuard on OpenShift

A quick way to onboard the handy "Kubernetes Up and Running"  kuard application on OpenShift: curl https://raw.githubusercontent....