Security - Custom Resource Definition & Custom Controllers Flashcards

1
Q

What is the job of a controller?

A
  • create and continously monitor the status of created objects
  • change the objects on the cluster according to the changes defined by us
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a Custom Resource Definition (CRD) used for?

A
  • used for the definition of custom resources to be used in Kubernetes
  • need to be specified and configured for the resource to be creatable
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How does a CRD look like?

A
apiVersion: apiextensions.k8s.io
kind: CustomResourceDefinition
metadata:
  name: flighttickets.flights.com
spec:
  scope: Namespaced/Or not
	group: flights.com (group that is provided in the api-Version, like apps/ for Deployments)
	names: 
	  kind: FlightTicket
		singular: flightticket
		plural: flighttickets (used by api-resources)
		shortNames:
		  - ft
	versions:
	  - name: v1
	    served: true
			storage: true
	    
			schema: (what kind of fields are included) 
			  openAPIV3Schema:
				  type: object
					properties:
					  spec: 
						  type: object
							properties:
							  from:
								  type: string
							  to: 
								  type: string
								number:
								  type: integer
									minimum: 1
									maximum: 10
			  
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Why do we need a Custom controller for Custom resources?

A

Because without, the resource will just sit there with data.
Nothing will happen with it and it does not do anything by itself.
- to monitor the status of objects in etcd
- to perform actions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a controller?

A
  • any process or code that runs in a loop
  • and is continuously the kubernetes cluster and listening to events of specific objects being changed
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the advantage of Go for programming controllers?

A
  • provides support for other libraries like shared informers that provide caching and queing mechanisms that can help controllers easily
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How do you start creating custom controllers?

A
  • using github repo kubernetes/sample-controller
  • modify controller.go with custom code
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the use-case of the Operator Framework?

A
  • packaging a Custom Controller and a Custom Resource Definition together and deploy them as a single entity
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What happens if you create a operator, based on the operator framework?

A
  • creates the custom resource definition and the resources
  • deploys the custom controller as a deployment
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Where are Operators available?

A

operatorhub.io

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly