A lightning talk from the Kubernetes dev room at Configuration Management Camp 2017. Discussion of higher level programatic interfaces and tools for Kubernetes.
Gareth Rushgrove Brian Grant, Google, Kubernetes Config SIG “We've had a few complaints that YAML is ugly, error prone, hard to read, etc. Are there any other alternatives we might want to support?
The language to represent the data should be a simple, data-only format such as JSON or YAML, and programmatic modification of this data should be done in a real programming language Gareth Rushgrove Borg, Omega, and Kubernetes, ACM Queue, Volume 14, issue 1 http://queue.acm.org/detail.cfm?id=2898444 “
(without introducing more risk) Gareth Rushgrove A REPL for Kubernetes $ ./kubeplay kubeplay (namespace="*")> pods # list pods in the cluster
kubeplay (namespace="*")> @pod = _.any # pick a random pod from the list kubeplay (namespace="*")> puts @pod.to_json # output the pod definition { "metadata": { ... }, "spec": { ... "containers": [ {
(without introducing more risk) Gareth Rushgrove Ruby based DSL @metadata = replicasets("*/").to_ruby.items.map do |k,v| v.metadata end @metadata.each do |i| puts "Name:\t#{i.name}" puts "Labels:\t#{i.labels}" puts end
(without introducing more risk) Gareth Rushgrove Terraform provider resource "kubernetes_resource" "mypod" { # Required, must link on the corresponding "kubernetes_cluster" data s cluster = "${data.kubernetes_cluster.main.cluster}" collection = "pods" name = "mypod" labels { a = "b" } }