Commit 79461874 authored by Ioannis Plakas's avatar Ioannis Plakas

New image

parent 2f3e892b
......@@ -28,6 +28,7 @@ cd first-controller
kubectl get crds
![alt text](images/empty-crds.png?raw=true)
3. Install the CRD to the cluster
......@@ -36,7 +37,9 @@ make install
The created resource is retrieved `kubectl get crd`
![Image of new crds](images/crds.png?raw=true)
4. The generated CRD is fully described in yaml format in `config/crd/bases/ubi.ubitech.eu_pgouvs.yaml` which is generated by the corresponding go type
......@@ -56,6 +59,7 @@ type PgouvStatus struct {
5. Now that the Kubernetes Cluster knows about the Custom Resource
its time to initiate one, we do that be updating the `config/samples/ubi_v1alpha1_pgouv` file (the name of file follows the GVK convention)
......@@ -74,6 +78,7 @@ In order to apply the instance of the resource `kubectl applay -f config/samples
![Created resource ](images/created.png)
6. Now that the cluster has a Custom Resource the determined logic
served with it is written in `controllers\pgouv_controller.go`
......@@ -96,6 +101,7 @@ func (r *PgouvReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) {
The reconcile logic will be called once new Events regrading the handled resource
(and the sub-Resources that owns) are detected . That's why `role-based-access-control` needs to be provided to the Controller(eg. `kubebuilder:rbac:`).
7. The difference that Reconcile Function uses in order to get to the desired state
is described in the following snippet
......@@ -116,6 +122,7 @@ is described in the following snippet
Firstly the Status of the CR is determined by retrieving the number of pods (owned by the Resource). Then the difference between `Spec` and `Status` will
determine if more Pods running the specified `Command` are needed or
Pods need to get deleted.
8. The example logic in controller :
......@@ -201,6 +208,7 @@ make run
![Created resource ](images/output.png)
11. The CR can be updated by updating the `Replicas` field on the `config/samples/ubi_v1alpha1_pgouv` and applying it to the cluster via
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment