That's right - order that nice pizza ๐Ÿ• with `kubectl`

Overview

pizza-controller

making kubernetes do what it was always meant to do: order pizza.

usage

First, create a secret with the credit card information (yeah, this is fine, trust me) to be used during payment:

kind: Secret
apiVersion: v1
metadata:
  name: credit-card
stringData:
  number: 123343132314232
  expiration: 12/02
  securityCode: 123
  zip: m5d0l2

then, create a PizzaCustomer, the representation of you, the customer:

kind: PizzaCustomer
apiVersion: ops.tips/v1alpha1
metadata:
  name: you
spec:
  firstName: barack
  lastName: obama
  email: [email protected]
  phone: "31241323"
  streetNumber: "20"
  streetName: King St
  city: Toronto
  state: "ON"
  zip: m5lz8j

With the PizzaCustomer object created, we can see what's the closest store available for it:

$ kubectl get pizzacustomer
NAME              CLOSEST
you               store-123

Looking at the PizzaStore object, we can check out its menu:

$ kubectl get pizzastore store-123 -o yaml
kind: PizzaStore
metadata:
  name: store-123
spec:
  address: |
    51 Niagara St
    Toronto, ON M5V1C3
  id: "10391"
  phone: 416-364-3939
  products:
    - description: Unique Lymon (lemon-lime) flavor, clear, clean and crisp with no caffeine.
      id: 2LSPRITE
      name: Sprite
      size: 2 Litre

Knowing what's available to us, we can place the order:

kind: PizzaOrder
apiVersion: ops.tips/v1
metadata:
  name: ma-pizza
spec:
  yeahSurePlaceThisOrder: true  # otherwise, it'll just calculate the price
  storeRef: {name: store-123}
  customerRef: {name: you}
  payment:
    creditCardSecretRef: {name: cc}
  items:
    - ticker: 10SCREEN
      quantity: 1

To keep track of what's going on with your pizza, check out the order's status:

$ kubectl get pizzaorder ma-pizza
NAME    PRICE      ID                     CONDITION     AGE
order   9.030000   Wlz6HcE6BPlfQNlxDAXa   OrderPlaced   68m

what's next?

are you really into ordering pizza using kubectl?

like, really? are you sure?

here's what's missing:

  • well, any .. tests ๐Ÿด
  • order tracking (it's xml-based - SOAP stuff)
  • being more flexible with non-canadian folks (it's currently hardcoded for Canada, but could easily be changed)

at the moment I got my pizza .. development finished ๐Ÿ˜… maybe you'll carry it forward?

Installation

  1. apply the manifest
git clone https://github.com/cirocosta/pizza-controller
cd pizza-controller

# using `kapp` - recommended :)
#
kapp deploy -a pizza-controller -f ./config/release.yaml


# OR .. plain old kubectl
#
kubectl apply -f ./config/release.yaml

thanks

The API part was heavily inspired by these two projects:

Thank you!

LICENSE

MIT

You might also like...
Are you programming and suddenly your stomach is rumbling? No problem, order your Ifood without leaving your favorite text editor โค๏ธ

vim-ifood Vocรช ta programando e de repente bateu aquela fome? Sem problemas, peรงa seu Ifood sem sair do seu editor de texto favorito โค๏ธ Are you progra

Loc2Midi - This project uses realtime location data to control audio effects plugins in order to simulate movement throughout a virtual soundscape Order Dominos pizza from the command line
Order Dominos pizza from the command line

Dominos pizza from the command line. Table of Contents Installation Setup Commands Config Menu Cart Order Tutorials None Pizza with Left Beef Installa

Flagr is an open source Go service that delivers the right experience to the right entity and monitors the impact.
Flagr is an open source Go service that delivers the right experience to the right entity and monitors the impact.

Flagr is an open source Go service that delivers the right experience to the right entity and monitors the impact. It provides feature flags, experimentation (A/B testing), and dynamic configuration. It has clear swagger REST APIs for flags management and flag evaluation.

kubectl-fzf provides a fast and powerful fzf autocompletion for kubectl
kubectl-fzf provides a fast and powerful fzf autocompletion for kubectl

Kubectl-fzf kubectl-fzf provides a fast and powerful fzf autocompletion for kubectl. Table of Contents Kubectl-fzf Table of Contents Features Requirem

Kubectl-explore - A kubectl plugin for fuzzy-find fields to explain.

kubectl-explore This command is a better kubectl explain with the fuzzy-finder. What kubectl-explore finds fields associated with each supported API r

Kubectl golang - kubectl krew template repo

kubectl krew template repo There's a lot of scaffolding needed to set up a good

Courier Order Provider is a service that receives signals from core server in order to emit this orders to courier groups.

Courier Order Provider Courier Order Provider is a service that receives signals(messages) from core server in order to emit this orders to courier gr

Andrews-monitor - A Go program to monitor when times were available to order for Brown's Andrews dining hall. Used during the portion of the pandemic when the dining hall was only available for online order.

Andrews Dining Hall Monitor A Go program to monitor when times were available to order for Brown's Andrews dining hall. Used during the portion of the

Limit-order-book - Limit order books keep records of orders for a given symbol to be traded

Limit Order Book Limit order books keep records of orders for a given symbol to

A pizza store design using NATS pub sub queue.
A pizza store design using NATS pub sub queue.

A pizza store design using NATS pub sub queue.

Build a circular sector polygon feature spanning the angle between two given bearings, a center point and a radius. A pizza piece! ๐Ÿ•
Build a circular sector polygon feature spanning the angle between two given bearings, a center point and a radius. A pizza piece! ๐Ÿ•

sectr ๐Ÿ• Build a circular sector polygon feature (pizza piece ๐Ÿ˜… ) spanning the angle between two given bearings, a radius and a center point. install

๐Ÿ• PizzaCoin - cryptocurrency for buying and selling pizza or another stuff
๐Ÿ• PizzaCoin - cryptocurrency for buying and selling pizza or another stuff

๐Ÿ• PizzaCoin Cryptocurrency for buying and selling pizza or another stuff Installation Compilation Windows go build -o pizzacoin.exe ./cmd/PizzaCoin/m

๐ŸŽ€ a nice lil shell for lua people made with go and lua

Hilbish ๐ŸŽ€ a nice lil shell for lua people made with go and lua It is currently in a mostly beta state but is very much usable (I'm using it right now

Style definitions for nice terminal layouts ๐Ÿ‘„
Style definitions for nice terminal layouts ๐Ÿ‘„

Lip Gloss Style definitions for nice terminal layouts. Built with TUIs in mind. Lip Gloss takes an expressive, declarative approach to terminal render

A SimpleHTTPServer written in Go, enhanced with features and with a nice design
A SimpleHTTPServer written in Go, enhanced with features and with a nice design

goshs is a replacement for Python's SimpleHTTPServer. It allows uploading and downloading via HTTP/S with either self-signed certificate or user provi

Restish is a CLI for interacting with REST-ish HTTP APIs with some nice features built-in
Restish is a CLI for interacting with REST-ish HTTP APIs with some nice features built-in

Restish is a CLI for interacting with REST-ish HTTP APIs with some nice features built-in, like always having the latest API resources, fields, and operations available when they go live on the API without needing to install or update anything.

go program that installs and customizes ohmyzsh tmux vim via various plugins and other nice to haves
go program that installs and customizes ohmyzsh tmux vim via various plugins and other nice to haves

Pimp-My-Shell Table of Contents Pimp-My-Shell Install Usage About Resources Tmux Hotkeys VIM Hotkeys Adjusting Custom Aliases Mac Fix Terminal bind ke

Ddg - DuckDuckGo terminal search that plays nice with grep and fzf
Ddg - DuckDuckGo terminal search that plays nice with grep and fzf

ddg duckduckgo terminal search for use with fzf (or grep) What? With this tool y

Owner
Ciro S. Costa
ใ€€ใ€€ใ€€ใ€€เผผ ใค แปŽอ–อˆฬžฬฉอŽฬป_แปŽอ–อˆฬžฬฉอŽฬป เผฝใค
Ciro S. Costa
๐ŸŽ€ a nice lil shell for lua people made with go and lua

Hilbish ?? a nice lil shell for lua people made with go and lua It is currently in a mostly beta state but is very much usable (I'm using it right now

Hilbis Development 267 Sep 28, 2022
Style definitions for nice terminal layouts ๐Ÿ‘„

Lip Gloss Style definitions for nice terminal layouts. Built with TUIs in mind. Lip Gloss takes an expressive, declarative approach to terminal render

Charm 5k Sep 28, 2022
go program that installs and customizes ohmyzsh tmux vim via various plugins and other nice to haves

Pimp-My-Shell Table of Contents Pimp-My-Shell Install Usage About Resources Tmux Hotkeys VIM Hotkeys Adjusting Custom Aliases Mac Fix Terminal bind ke

null 9 Aug 31, 2022
Ddg - DuckDuckGo terminal search that plays nice with grep and fzf

ddg duckduckgo terminal search for use with fzf (or grep) What? With this tool y

Cauรช Felchar 3 Apr 1, 2022
๐ŸŽ„ A Christmas tree right from your terminal!

ctree ?? A Christmas tree right from your terminal! ?? Demo โŒ› No Refresh Don't want the tree to refresh every 2 seconds? Easy! Just add the --no-refre

Matthew Gleich 37 Jan 3, 2022
Command not found? Install it right there!

Tii On most GNU/Linux systems, when a command is not found, a message showing what can be run to install the command is printed.

Ishan Goel 32 Aug 10, 2022
Pi-hole data right from your terminal. Live updating view, query history extraction and more!

Pi-CLI Pi-CLI is a command line program used to view data from a Pi-Hole instance directly in your terminal.

Reece Mercer 41 Apr 26, 2022
Contextual information about your git projects, right on the command-line

gitty gitty is a smart little CLI helper for git projects, that shows you all the relevant issues, pull requests and changes at a quick glance. It cur

Christian Muehlhaeuser 393 Sep 16, 2022
Get live cricket score right in your terminal.

cric Get cricket score right in your terminal. How to use?! Make sure you have Node.js installed on your machine and just type the following command w

Tushar Choudhari 2 Feb 4, 2022
Open Kubectl shell for the pod

Open Kubectl shell for the pod

mattn 7 Mar 5, 2022