• Stars
    star
    114
  • Rank 301,628 (Top 7 %)
  • Language
    Go
  • Created over 3 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

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

More Repositories

1

cr

Runs your tasks at maximum concurrency
Go
692
star
2

asciinema-edit

asciinema casts post-production tools
Go
303
star
3

qcode-decoder

QR Code decoder using Lazar Laszlo's decoder
JavaScript
241
star
4

gupload

Upload files with gRPC and/or HTTP2
Go
176
star
5

sample-grafana

Automatic Grafana dashboard initialisation example
Shell
119
star
6

dmesg_exporter

A "dmesg" prometheus exporter - metrics from the kernel messages ring buffer
Go
55
star
7

observer-c

A pure C implementation of the Observer Pattern
C
46
star
8

gulp-converter-tjs

Converts old/new type of OpenCV HaarCascade xml data to trackingJs' internal format.
JavaScript
37
star
9

xfsvol

Local Docker Volumes with XFS Project Quota
Go
28
star
10

sample-rpc-go

An Example of Go RPC Client and Server
Go
27
star
11

stress

Single-purpose tools to stress resources
C
27
star
12

react-piano-tiles

A reconstruction of the Piano Tiles mobile game (although not currently optimized for mobile).
JavaScript
25
star
13

go-monero

Monero's p2p and RPC in go
Go
24
star
14

pidpath

Retrieves the absolute path to the executable of a running process
Go
21
star
15

monero-exporter

Prometheus exporter for monero metrics.
Go
21
star
16

rawdns

A records resolver from scratch - raw UDP packets
Go
21
star
17

monero-operator

A Kubernetes-native way of deploying Monero nodes and even whole networks: express your intention and let Kubernetes run it for you.
Go
17
star
18

react-matrix

Represents, with SVG, a given Matrix
JavaScript
13
star
19

site-blocker

Chrome extension to block some websites.
JavaScript
12
star
20

alpine-envsubst

Minimal Docker Alpine:3.6 container with envsubst
Shell
11
star
21

grafana-sync

Keeps your Grafana dashboards in sync
Go
11
star
22

auto53

Automatic Route53 updates based on EC2 Autoscaling state changes
Go
11
star
23

hstatic

An incomplete and small example http server in C - wip
C
10
star
24

l7

Minimal HTTP 1.1 Proxy & Load-balancer
Go
9
star
25

chicken-gun

stressing your system, a chicken at a time
Rust
9
star
26

sample-aws-networking

Example of AWS networking setup using Terraform
HCL
9
star
27

tinyc

Tiny container runtime
C
8
star
28

transparencia

Um wrapper javascript sobre a API do transparencia.gov.br
JavaScript
8
star
29

sample-docker-registry-aws

Sample of how to deploy a Docker registry backed by S3 in AWS EC2 using IAM roles to grant temporary credentials
HCL
8
star
30

ng-formatphone-br

Angular Filter and Directive for formatting Brazillian phones
JavaScript
8
star
31

l4

Minimal TCP proxy
Go
8
star
32

flight_recorder

A Prometheus exporter for gathering Concourse information from the PostgresSQL DB.
Go
8
star
33

pipeline2dot

concourse pipeline dependencies as dot graphs
Go
8
star
34

cartorio

A read-only container image registry
Rust
8
star
35

react-tree

JavaScript
7
star
36

example-docker-ansible

A minimal ready to use Docker Ansible role with Vagrant provisioning set
Ruby
7
star
37

hello-world-lkm

A "hello-world" loadable kernel module
C
7
star
38

go-sample-udp

Sample UDP Server and Client in Go
Go
7
star
39

drwho

concurrent recursive whois resolution
Go
7
star
40

slirunner

Concourse SLI probes runner
Go
6
star
41

sample-nginx-http2

NGINX HTTP2 Server Push example
Go
6
star
42

sdns

Minimal A and NS record resolver
Go
6
star
43

lighty-sqlinj-demo

CVE-2014-2323 exploit demonstration
C
6
star
44

hello-swagger

Example Hello World Swagger API
Go
6
star
45

efs-locks-sample

Sample showing how easy it is to get to the EFS locks quota
HCL
6
star
46

dind

A dockerized Docker machine (dind) with SSH and GIT
Shell
5
star
47

travis-triggerer

A single drop-in script to trigger travis-ci builds from other builds.
Shell
5
star
48

mylinux

Personal Linux machine configuration
Shell
5
star
49

syslog-send

Send syslog messages using go's log/syslog package
Go
5
star
50

utea

Toy WebGL 3D Engine
JavaScript
5
star
51

paypal-expresscheckout-python

A simple sdk for perfoming ExpressCheckout with Python
Python
5
star
52

concourse-arm

Concourse on ARMv7 and Arm64
Dockerfile
5
star
53

GCM_sample_APP

Aplicativo exemplo de uma aplicação GCM a ser utilizada com o testador http://apresentae.appspot.com/gcm_testing.
Java
5
star
54

sample-collect-docker-metrics

Example of how to integrate Prometheus, Grafana and Docker Daemon metrics
Shell
5
star
55

talks

Content from my talks :))
JavaScript
4
star
56

hugo-utils

Extra tools for managing Hugo websites.
Go
4
star
57

matrix-snake

Snake game on javascript Matrices!
JavaScript
4
star
58

devents

Docker Events Collector
Go
4
star
59

memman

A MMU simulator in C
C
3
star
60

ApresentAE

Source code for https://apresentae.appspot.com , the webpage where i put all my presentations stuff.
JavaScript
3
star
61

go-mod-dep-source-finder

Get direct links to your Go dependencies sources.
Go
3
star
62

nfsvol

Docker Volume Plugin for managing NFS storage - WIP
Go
3
star
63

ingress_ipvs_exporter

Exports Docker's ingress IPVS metrics
Go
3
star
64

storage-utils-js

Some utils for webstorage
JavaScript
3
star
65

perfer

A wrapper on top of `perf` and `flamegraphs` to generate flamegraphs on demand.
Go
3
star
66

execsnoopvis

visualize system-wide process execution
Go
3
star
67

yarenderer

yet another rendering engine in c++
C++
3
star
68

containerd-install

a "minimal" containerd install (ubuntu)
Makefile
3
star
69

docker-ubuntu

Ubuntu-based docker image with base minimum systemd and SSH
Shell
3
star
70

angular-tutorial-following

A project that follows the official AngularJS Tutorial but with a lot of comments
JavaScript
3
star
71

similar-to

A deepEqual a like that doesn't checks values. It's all about similarity :)
JavaScript
2
star
72

llb

[wip] The low-level load balancer
C
2
star
73

estaleiro

building container images with bill of materials
Go
2
star
74

concourse-crds

A set of custom resource definitions that aim at controlling Concourse.
Go
2
star
75

docker-ec2-metadata-block

Example of EC2 Metadata service blocking for Docker container
HCL
2
star
76

concourse-worker-health-checker

A sidecar that introduces minimum load into a Concourse worker to probe its health
Go
2
star
77

oklog-docker-plugin

OKLog forwarder that sends your container logs to OKLog ingestors
Go
2
star
78

humanb

Bytes to Human bytes
JavaScript
2
star
79

yaspm

yet another serialport manager
JavaScript
2
star
80

gyr

Go
2
star
81

expose-edns

Exposes docker embedded DNS
Shell
2
star
82

pasquale

Checks for spelling errors in a given sentence
JavaScript
2
star
83

poliglota

Translates a given text to a given language.
JavaScript
2
star
84

heapvis

visualizing heap profile diffs over time
Go
2
star
85

stacksearch

discover callstacks in which functions of interest are called.
Go
2
star
86

yascm

A toy scheme compiler
C++
2
star
87

slowhttp

A slow HTTP static server for simulating slow (but constant) responses from a server.
Go
1
star
88

ootb-tce

Shell
1
star
89

influx-stresser

Hits influxdb with a bunch of batch requests
Go
1
star
90

yahttp-parser

A naive C++ HTTP parser implementation using Bison and Flex
HTML
1
star
91

vai

Single script that wraps a list of scripts in a directory as a CLI
Shell
1
star
92

yairc

simplistic irc client and server
C
1
star
93

scm-controller

Go
1
star
94

intro-prometheus-talk

a very quick intro to prometheus (lightning!)
1
star
95

dagger-notes

nothing to see here - wip
Dockerfile
1
star
96

certgen

Utility for generating certificates with SAN set
Shell
1
star
97

yacss-parser

Yet Another toy CSS parser
C++
1
star
98

buildkit-task

Shell
1
star
99

iot-sdk-python

Minimum SDK for the IoT device provided by Telefonica
Python
1
star
100

when-to-buf

Pair of executables for checking use of buffers when doing networking
C
1
star