This operator is managing a pool of pods, each running a storage agent that can accept reads and writes from\to a persistent volume(PV). In this exercise the pods are running a simulated agent that is "connected" to a central storage system which uses the pool as a storage backing store.
The PV pool is defined using a PvPool CRD.
- All build and deploy commands are defined in the
Makefile. - Deploy the operator - this will run an operator deployment in your cluster
make deploy IMG=kfirpayne/pv-pool-operator:v1.0.1
When a creation or update of a PV pool CR is recognized, the pv-pool operator reconcile loop is triggered.
The operator deploys these resources for each pv-pool
- Service - A
ClusterIPservice to expose the storage agents pods - Statefulset - Manages the storage-agents pods. each pod is mounted with a PV (using a PVC).)
On each run of the reconcile loop the operator is updating the Status of the pv-pool CR (you can look at the CR description with kubectl get pvpool pvpool-1 -o yaml)
Once the pv pool is reconciled the Status is set to Ready
- You can view the used storage percentage of the pool in the
PvPoolStatus - Management of scaling up and scaling down of the pods in the cluster.
When scaling down, adecommissioningprocess is initiated on the appropriate pods, when thedecommissioningprocess is finished the pods will terminate.
Scaling down and up cannot happen simultaneously, thus the operator will finish one operation of scaling before stating the second one.