jenkins-x / enhancements

Repository containing design proposals for Jenkins X enhancements
12 stars 16 forks source link

Get more out of Kubernetes' Operator Pattern #30

Closed mgoltzsche closed 4 years ago

mgoltzsche commented 4 years ago

Currently most of the Jenkins X logic is implemented in the jx binary which is called everywhere. This results in the following problems:

Therefore I propose to establish best practices and an iterative approach to move logic from the jx CLI into k8s controllers following the Operator Pattern.

salaboy commented 4 years ago

@mgoltzsche my two cent.. this is easier said than done. The JX CLI tools is a Go binary as far as I am aware, and it encapsulates a lot of API calls to different Kubernetes components. It is not like the Operator/Controller pattern is not being leverage, it is more like most of the magix happens inside this binary and that is reused all over the place.. this avoid having services which expose APIs just to call other services (like the k8s apis or tekton) that are already there..

I will leave the experts to express their opinions here... but from an outsider point of view , the jx cli can be modularized.. but i believe that I would also keep the jx services to the minimum..

salaboy commented 4 years ago

@mgoltzsche can you give specific examples:

not all processes are modeled using a CRD: therefore some information can only be derived by joining multiple resources. Instead there should be a denormalized CRD for every business process to support simply k8s API queries and extension.

I am interested in that one ..

mgoltzsche commented 4 years ago

@salaboy examples: