Wednesday, January 13, 2021

kuard on OpenShift

A quick way to onboard the handy "Kubernetes Up and Running" kuard application on OpenShift:

curl https://raw.githubusercontent.com/brito-rafa/kuard/deployment-kuard/deployments/deploy-kuard-openshift.sh | sh -

You can find the YAML and source code of the script here:

Great application to test blue-green deployments and ingress controller traffic.

Tuesday, November 3, 2020

Second Part of Tutorial: Coding the Support of Multiple K8s API Groups

In the previous post, I showed you how to create a CRD from scratch along with validators and mutators.

Now it is time to show how to enable multiple versions of the same CRD with different schemas and provide full compatibility across them.

You can see the entire code here that I used kubebuilder to scaffold it.

$ kubebuilder create api --group music --version v1alpha1 --kind RockBand --resource=true --controller=false

$ kubebuilder create webhook --group music --version v1alpha1 --kind RockBand --conversion
The trick is leveraging the annotation struct for the conversion back and forth of the releases, as shown ConvertFrom and ConvertTo functions.




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

Tuesday, April 14, 2020

Kubernetes API Groups

One piece of Kubernetes DNA is the Object API convention on Kind, Resource Lists and API Groups.

Recently, I gave a presentation about Kubernetes API Groups on Data Protection WG targeting the support of multiple API Group versions aiming the *transparent* migration of workloads across different clusters running *different* Kubernetes versions. This is a piece of work that I am contributing to Project Velero.

Slides:
https://docs.google.com/presentation/d/1PszHcfRs_o02Azsb98pdg_o-w19i88bgc9pcOA92_TM/edit?ts=5e822888#slide=id.g829b865cd1_2_12

Video:
https://www.youtube.com/watch?v=S2o7znJS_9w&list=PL69nYSiGNLP336DulLgPdlWJ_gzRz1iL5&index=7

Sunday, December 1, 2019

OpenShift Best Practices on the VMWare SDDC

Please read if you are running OpenShift (or any Enterprise Kubernetes really) on-premises in production: 45 pages of fun.


The VMware blog entry has the full verbiage and includes Enterprise PKS best practice as well:
https://blogs.vmware.com/apps/2019/11/best-practices-for-enterprise-kubernetes-on-the-vmware-sddc.html

kuard on OpenShift

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