The PizzaCustomer
CRD represents a customer who might want to place an
order at Dominos.
In its spec, one fills the fields that will let Dominos know of your personal information, address, and a reference to a secret where credit card details can be found.
kind: PizzaCustomer
apiVersion: ops.tips/v1alpha1
spec:
address: etcetc
name: bla
The reconciler has the responsability of finding stores nearby the customer so that orders can be placed for it later on.
status:
conditions:
- type: Ready
status: "True"
reason: StoresFound
closestStoreRef: { name: store-123 }
So ultimately, it's a state machine like so:
where:
Ready
implies that stores have been found and orders for that customer can be placedErrored
implies something went wrong
A PizzaStore
object represents a physical Dominos location where one can
order food from.
kind: PizzaStore
apiVersion: ops.tips/v1alpha1
spec:
name: bla
products:
- code: 10SCREEN
name: ""
description: ""
It's not supposed to be created by humans - PizzaStore
objects are created by the controller.
With a PizzaOrder
object, you declare the intention to have food from a
Dominos store by filling three fields:
spec.storeRef
: reference to aPizzaStore
objectspec.customerRef
: reference to aPizzaCustomer
objectspec.products
: set of products to order from that store
kind: PizzaOrder
apiVersion: ops.tips/v1alpha1
spec:
storeRef: { name: store-123 }
customerRef: { name: customer-1 }
serviceType: carryout
products:
- code: 10SCREEN
quantity: 1
payment:
creditCardSecretRef:
name: credit-card
under the hood, the reconciler is working on the following state machine: