Bangalore Kubernetes May 2019

Hrishikesh Shinde talked about "Intro to sample controller"

He introduced to following github repositories
Go clients for talking to a kubernetes cluster. It implements watch.
Scheme, typing, encoding, decoding, and conversion packages for Kubernetes and Kubernetes-like API objects. It is used for filter.
Schema of the external API types that are served by the Kubernetes API server. 
Golang code-generators used to implement Kubernetes-style API types.

Hrishikesh further explained his own code repository.
Build replicaset kind of k8s object. Build controller from scratch to demonstrate  KuberBuilder or Operator SDK frameworks

We need to develop boiler plate code at path /pkg/apis/demo/v1alpha1/
1. doc.go
2. register.go
3. types.go

The controller takes 3 actions

1. Check for desire state
2. Strive for desire state
3. Update about resourse status using AvailableReplicaStatus variable. 

Controller uses various data structures (modules) like informer, listers, reflect etc. 

Hrishikesh suggested books like and others. 

Slide deck

Nikhil Tomas talked about "Intro to operator SDK"

I have updated my blog "K8s Operator" with useful details. 

- quick start:

- user guide:

Slide deck

Suraj Narwade gave valuable tips about CKA examNeependra Khare also added some more points. 

One need to focus on concepts and tasks, by studying them four to five times. 

Also study 4 to 5 times the course
Kubernetes - the hard way

Practise, Practise and Practise
Use GCP, AWS, minkube on Linux box or online like Katacoda and CloudYuga
Also refer my blog : Kubernetes Practicals 

There will be only one termianl. So better get familar with tmux

They suggested book : Kubernetes up and runningdive into the future of infrastructure

At begining of exam set alias for various frequently used kubectl commands. 
Also set auto completion of commands
Few useful blogs/URLs

Suraj's slide deck

Neependra mentioned about upcomign webinar from CloudYuga

Meetup Reference

Python : collections module

Python has general purpose data types like dict, list, set, tuple. Collections module has following additional useful datatype

1. namedtuple

Useful to contruct objects

2. Counter

It works with string, list, and sentence. Sentence should be split with ' ' to convert into list of words. 


c = Counter(list)

c.values() gives only count. So sum(c.values()) givestotal of all counts 
c.most_common() sort based on frequency and return list of tuples
c.most_common()[0][0] gives the item with maximum occurance
c.most_common()[:-2:-1] gives the item with maximum occurance
c.most_common()[:-n-1:-1]  gives the item with n least common elements 
c.substract(d) Here is d is another Counter. The result will be frequency for each element will be substraced as per its frequency in d. 

3. defaultdict(object)
It gives default empty dictionary. 

4. OrderedDict

OrderedDict(sorted(d.items(), key=lambda t: t[0])) to sort with key
OrderedDict(sorted(d.items(), key=lambda t: t[1])) to sort with value

5. deque

To add : append(), appendleft()
To remove : pop() , popleft()
to count: count()
To insert as specific index i : insert(i, x)

6. ChainMap
This is to join 2 dict as a list with 2 elements as dict

Open Container Initiative

1. Image specification

An OCI Image is an ordered collection of root filesystem changes and the corresponding execution parameters for use within a container runtime

1.1 manifest
It contains metadata (annotation = key, value pair) about the contents and dependencies of the image 
JSON file

1.2 image index (optional)
For platform specific version of image

1.3 image layout

1.4 file system layers

1.5 configuration
JSON file

1.6 conversion

1.7 descriptor 


2. Distribution specification

It describes the API that might be used by a registry to distribute images, to easily 
- share, 
- search, 
- obtain and 
- verify 
container image

It is implemented by Docker Registry and

3. Runtime Specification

It aims to specify the configuration, execution environment, and lifecycle of a container.
aims to specify the configuration, execution environment, and lifecycle of a container.

runc is Runtime specification OCI implementation 


3.1 create command
3.2 create runtime environment using config.json
3.3 start command
3.4 pre-start hook
3.5 user program specified by process
3.6 post-start hook
3.7 exit due to exit, error, kill, crash
3.8 delete
3.9 destroy container. undo create
3.10 post-stop hook

CRI = Container Runtime Interface = protocol buffers + gRPC APIs + Libraries

Virtual Machine

Operating System level virtualization / containers /  virtual private servers / virtual environments (VEs) / partitions / jails

  • Docker, 
  • Solaris Containers, 
  • OpenVZ, 
  • Linux-VServer, 
  • LXC, 
  • AIX Workload Partitions, 
  • Parallels Virtuozzo Containers, and 
  • iCore Virtual Accounts.
with lx zones on Solaris, one can run old Solaris and Linux inside lx zones container.

Hardware-assisted virtualization 
  • KVM, 
  • VMware Workstation, 
  • VMware Fusion, 
  • Hyper-V, 
  • Windows Virtual PC, 
  • Xen, 
  • Parallels Desktop for Mac, 
  • Oracle VM Server for SPARC, 
  • VirtualBox and 
  • Parallels Workstation.
Process Virtual Machine / application virtual machine / Managed Runtime Environment (MRE)

  • Java JRE Java Runetime Environment : JVM
  • .NET framework CLR Common Language Runetime : Parrot Virtual Machine
System Virtual Machine
  • using hypervisor