SlideShare a Scribd company logo
1 of 33
Download to read offline
@stillinbeta / #Kubecon Seattle 2018
You got Database
in my Cloud!
Kubernetes Foreign Data Wrapper
for Postgres
@stillinbeta / #Kubecon Seattle 2018
Who am I?
Liz Frost
Twitter: @stillinbeta
slack.k8s.io: @liz
@stillinbeta / #Kubecon Seattle 2018
Who am I?
@stillinbeta / #Kubecon Seattle 2018
Who am I?
@stillinbeta / #Kubecon Seattle 2018
Who am I?
@stillinbeta / #Kubecon Seattle 2018
Who am I?
(Stickers are available)
@stillinbeta / #Kubecon Seattle 2018
@stillinbeta / #Kubecon Seattle 2018
...get it?
zéro un zéro
cero uno cero
零一零
@stillinbeta / #Kubecon Seattle 2018
What is a Foreign Data Wrapper?
● ODBC
● SQLite
● Cassandra
● Redis
● Hue Bulbs?
● FDWs??
● Kubernetes!
@stillinbeta / #Kubecon Seattle 2018
@stillinbeta / #Kubecon Seattle 2018
Success! Someone did the hard part for us!
github.com/dennwc/go-fdw
@stillinbeta / #Kubecon Seattle 2018
CREATE EXTENSION IF NOT EXISTS k8s_fdw;
CREATE SERVER IF NOT EXISTS kind
FOREIGN DATA WRAPPER k8s_fdw
OPTIONS (kubeconfig '/kubeconfig');
CREATE FOREIGN TABLE IF NOT EXISTS pods (
name text OPTIONS (alias 'metadata.name')
, namespace text OPTIONS (alias 'metadata.namespace')
)
SERVER kind
OPTIONS (
namespace 'kube-system'
, apiVersion 'v1'
, kind 'Pod'
);
What kid of interface do we want?
@stillinbeta / #Kubecon Seattle 2018
CREATE EXTENSION IF NOT EXISTS k8s_fdw;
CREATE SERVER IF NOT EXISTS kind
FOREIGN DATA WRAPPER k8s_fdw
OPTIONS (kubeconfig '/kubeconfig');
CREATE FOREIGN TABLE IF NOT EXISTS pods (
name text OPTIONS (alias 'metadata.name')
, namespace text OPTIONS (alias 'metadata.namespace')
)
SERVER kind
OPTIONS (
namespace 'kube-system'
, apiVersion 'v1'
, kind 'Pod'
);
What kid of interface do we want?
@stillinbeta / #Kubecon Seattle 2018
CREATE EXTENSION IF NOT EXISTS k8s_fdw;
CREATE SERVER IF NOT EXISTS kind
FOREIGN DATA WRAPPER k8s_fdw
OPTIONS (kubeconfig '/kubeconfig');
CREATE FOREIGN TABLE IF NOT EXISTS pods (
name text OPTIONS (alias 'metadata.name')
, namespace text OPTIONS (alias 'metadata.namespace')
)
SERVER kind
OPTIONS (
namespace 'kube-system'
, apiVersion 'v1'
, kind 'Pod'
);
What kid of interface do we want?
@stillinbeta / #Kubecon Seattle 2018
$ psql --user postgres < test.sql
CREATE EXTENSION
CREATE SERVER
CREATE FOREIGN TABLE
Give it a run...
@stillinbeta / #Kubecon Seattle 2018
$ psql --user postgres < test.sql
CREATE EXTENSION
CREATE SERVER
CREATE FOREIGN TABLE
ERROR: couldn't get kubeconfig: couldn't
get resource mapper: could not get api
group resources: Get
https://ec2-54-215-202-190.compute-1.amazo
naws.com:6443/api?timeout=32s: net/http:
invalid header field value "postgres:
postgres postgres [local]
SELECTx00x00x00x00x00x00x00x00x00
x00/v0.0.0 (linux/amd64)
kubernetes/$Format" for key User-Agent
oh.
@stillinbeta / #Kubecon Seattle 2018
$ psql --user postgres < test.sql
CREATE EXTENSION
CREATE SERVER
CREATE FOREIGN TABLE
name | namespace
--------------------------------+-------------
coredns-6f685fffbf-7xrtp | kube-system
coredns-6f685fffbf-nzfn7 | kube-system
etcd-master | kube-system
kube-apiserver-master | kube-system
kube-controller-manager-master | kube-system
kube-proxy-lk2mq | kube-system
kube-scheduler-master | kube-system
That’s better!
@stillinbeta / #Kubecon Seattle 2018
What about more
complicated objects?
@stillinbeta / #Kubecon Seattle 2018
How about
JSONPATH?
@stillinbeta / #Kubecon Seattle 2018
ALTER FOREIGN TABLE pods
ADD COLUMN container text
OPTIONS (alias '{.spec.containers[0].image}')
;
Let’s do that!
@stillinbeta / #Kubecon Seattle 2018@stillinbeta / #Kubecon Seattle 2018
SELECT * from PODS;
name | namespace | container
--------------------------------+-------------+--------------------------------------------
coredns-6f685fffbf-7xrtp | kube-system | k8s.gcr.io/coredns:1.2.6
coredns-6f685fffbf-nzfn7 | kube-system | k8s.gcr.io/coredns:1.2.6
etcd-master | kube-system | k8s.gcr.io/etcd:3.2.24
kube-apiserver-master | kube-system | k8s.gcr.io/kube-apiserver:v1.12.1
kube-controller-manager-master | kube-system | k8s.gcr.io/kube-controller-manager:v1.12.1
kube-proxy-lk2mq | kube-system | k8s.gcr.io/kube-proxy:v1.12.1
kube-scheduler-master | kube-system | k8s.gcr.io/kube-scheduler:v1.12.1
@stillinbeta / #Kubecon Seattle 2018
How about a map?
@stillinbeta / #Kubecon Seattle 2018
ALTER FOREIGN TABLE pods
ADD COLUMN labels jsonb
OPTIONS (alias 'metadata.labels')
;
jsonb to the rescue
@stillinbeta / #Kubecon Seattle 2018@stillinbeta / #Kubecon Seattle 2018
SELECT name, labels FROM pods;
name | labels
--------------------------------+-----------------------------------------------------------------------------------------------------
coredns-6f685fffbf-7xrtp | {"k8s-app": "kube-dns", "pod-template-hash": "6f685fffbf"}
coredns-6f685fffbf-nzfn7 | {"k8s-app": "kube-dns", "pod-template-hash": "6f685fffbf"}
etcd-master | {"tier": "control-plane", "component": "etcd"}
kube-apiserver-master | {"tier": "control-plane", "component": "kube-apiserver"}
kube-controller-manager-master | {"tier": "control-plane", "component": "kube-controller-manager"}
kube-proxy-lk2mq | {"k8s-app": "kube-proxy", "pod-template-generation": "1", "controller-revision-hash": "6cbfff58bb"}
kube-scheduler-master | {"tier": "control-plane", "component": "kube-scheduler"}
(7 rows)
@stillinbeta / #Kubecon Seattle 2018@stillinbeta / #Kubecon Seattle 2018
SELECT name, container, labels->'component' AS component FROM pods;
name | container | component
--------------------------------+--------------------------------------------+-------------------------
--
coredns-6f685fffbf-7xrtp | k8s.gcr.io/coredns:1.2.6 |
coredns-6f685fffbf-nzfn7 | k8s.gcr.io/coredns:1.2.6 |
etcd-master | k8s.gcr.io/etcd:3.2.24 | "etcd"
kube-apiserver-master | k8s.gcr.io/kube-apiserver:v1.12.1 | "kube-apiserver"
kube-controller-manager-master | k8s.gcr.io/kube-controller-manager:v1.12.1 |
"kube-controller-manager"
kube-proxy-lk2mq | k8s.gcr.io/kube-proxy:v1.12.1 |
kube-scheduler-master | k8s.gcr.io/kube-scheduler:v1.12.1 | "kube-scheduler"
@stillinbeta / #Kubecon Seattle 2018
And for my
final trick:
@stillinbeta / #Kubecon Seattle 2018
CREATE FOREIGN TABLE IF NOT EXISTS replica_sets (
name text OPTIONS (alias 'metadata.name')
, replicas bigint OPTIONS (alias 'status.replicas')
, available bigint OPTIONS (alias 'status.availableReplicas')
)
SERVER kind
OPTIONS (
namespace 'kube-system'
, apiVersion 'apps/v1'
, kind 'ReplicaSet'
);
CREATE FOREIGN TABLE IF NOT EXISTS deployments (
name text OPTIONS (alias 'metadata.name')
, replicas bigint OPTIONS (alias 'status.replicas')
, available bigint OPTIONS (alias 'status.availableReplicas')
)
SERVER kind
OPTIONS (
namespace 'kube-system'
, apiVersion 'apps/v1'
, kind 'Deployment'
);
A few more tables
@stillinbeta / #Kubecon Seattle 2018
CREATE FOREIGN TABLE IF NOT EXISTS replica_sets (
name text OPTIONS (alias 'metadata.name')
, replicas bigint OPTIONS (alias 'status.replicas')
, available bigint OPTIONS (alias 'status.availableReplicas')
)
SERVER kind
OPTIONS (
namespace 'kube-system'
, apiVersion 'apps/v1'
, kind 'ReplicaSet'
);
CREATE FOREIGN TABLE IF NOT EXISTS deployments (
name text OPTIONS (alias 'metadata.name')
, replicas bigint OPTIONS (alias 'status.replicas')
, available bigint OPTIONS (alias 'status.availableReplicas')
)
SERVER kind
OPTIONS (
namespace 'kube-system'
, apiVersion 'apps/v1'
, kind 'Deployment'
);
Just the important bits
@stillinbeta / #Kubecon Seattle 2018@stillinbeta / #Kubecon Seattle 2018
SELECT "deployments"."name" AS deployment_name
, "replica_sets"."name" as replica_name
, "pods"."name" AS pod_name
FROM deployments
JOIN replica_sets on "replica_sets"."name" LIKE "deployments"."name" || '-%'
JOIN pods on "pods"."name" LIKE "replica_sets"."name" || '-%';
deployment_name | replica_name | pod_name
-----------------+--------------------+--------------------------
coredns | coredns-6f685fffbf | coredns-6f685fffbf-7xrtp
coredns | coredns-6f685fffbf | coredns-6f685fffbf-nzfn7
@stillinbeta / #Kubecon Seattle 2018
● Column types mostly ignored
What doesn’t work?
@stillinbeta / #Kubecon Seattle 2018
● Column types mostly ignored
● If it’s a not a number, string, or map...
...just kind of give up
What doesn’t work?
@stillinbeta / #Kubecon Seattle 2018
● Column types mostly ignored
● If it’s a not a number, string, or map...
...just kind of give up
● The codebase not being a knot of
spaghetti
What doesn’t work?
@stillinbeta / #Kubecon Seattle 2018
Questions?
Concerns?
Come find me!
I’m the one with pink hair!
Twitter: @stillinbeta
slack.k8s.io: @liz
Github: github.com/liztio/k8s-fdw
Docker: liztio/k8s_fdw:master

More Related Content

What's hot

GCPUG meetup 201610 - Dataflow Introduction
GCPUG meetup 201610 - Dataflow IntroductionGCPUG meetup 201610 - Dataflow Introduction
GCPUG meetup 201610 - Dataflow IntroductionSimon Su
 
Data integration with embulk
Data integration with embulkData integration with embulk
Data integration with embulkTeguh Nugraha
 
CODAIT/Spark-Bench
CODAIT/Spark-BenchCODAIT/Spark-Bench
CODAIT/Spark-BenchEmily Curtin
 
High Performance, High Reliability Data Loading on ClickHouse
High Performance, High Reliability Data Loading on ClickHouseHigh Performance, High Reliability Data Loading on ClickHouse
High Performance, High Reliability Data Loading on ClickHouseAltinity Ltd
 
Embulk - 進化するバルクデータローダ
Embulk - 進化するバルクデータローダEmbulk - 進化するバルクデータローダ
Embulk - 進化するバルクデータローダSadayuki Furuhashi
 
Docker in Action
Docker in ActionDocker in Action
Docker in ActionSimon Su
 
Autoscaling Your Kubernetes Workloads (Sponsored by Datadog) - AWS Summit Sydney
Autoscaling Your Kubernetes Workloads (Sponsored by Datadog) - AWS Summit SydneyAutoscaling Your Kubernetes Workloads (Sponsored by Datadog) - AWS Summit Sydney
Autoscaling Your Kubernetes Workloads (Sponsored by Datadog) - AWS Summit SydneyAmazon Web Services
 
Monitoring Spark Applications
Monitoring Spark ApplicationsMonitoring Spark Applications
Monitoring Spark ApplicationsTzach Zohar
 
Cncf event driven autoscaling with keda
Cncf   event driven autoscaling with kedaCncf   event driven autoscaling with keda
Cncf event driven autoscaling with kedaJurajHantk
 
Create API for your Databases
Create API for your DatabasesCreate API for your Databases
Create API for your DatabasesCédrick Lunven
 
Big data lambda architecture - Streaming Layer Hands On
Big data lambda architecture - Streaming Layer Hands OnBig data lambda architecture - Streaming Layer Hands On
Big data lambda architecture - Streaming Layer Hands Onhkbhadraa
 
Kubernetes Service Catalog & Open Service Broker for Azure
Kubernetes Service Catalog & Open Service Broker for AzureKubernetes Service Catalog & Open Service Broker for Azure
Kubernetes Service Catalog & Open Service Broker for AzureJulien Corioland
 
How to Live in a Post-Spring-Cloud-Netflix World - Olga Maciaszek-Sharma & Ja...
How to Live in a Post-Spring-Cloud-Netflix World - Olga Maciaszek-Sharma & Ja...How to Live in a Post-Spring-Cloud-Netflix World - Olga Maciaszek-Sharma & Ja...
How to Live in a Post-Spring-Cloud-Netflix World - Olga Maciaszek-Sharma & Ja...VMware Tanzu
 
Prometheus Monitoring Mixins (Berlin CNCB Meetup)
Prometheus Monitoring Mixins (Berlin CNCB Meetup)Prometheus Monitoring Mixins (Berlin CNCB Meetup)
Prometheus Monitoring Mixins (Berlin CNCB Meetup)Kausal
 
MapReduce with Scalding @ 24th Hadoop London Meetup
MapReduce with Scalding @ 24th Hadoop London MeetupMapReduce with Scalding @ 24th Hadoop London Meetup
MapReduce with Scalding @ 24th Hadoop London MeetupLandoop Ltd
 
FlutterでGraphQLを扱う
FlutterでGraphQLを扱うFlutterでGraphQLを扱う
FlutterでGraphQLを扱うIgaHironobu
 
Introducing Scylla Manager: Cluster Management and Task Automation
Introducing Scylla Manager: Cluster Management and Task AutomationIntroducing Scylla Manager: Cluster Management and Task Automation
Introducing Scylla Manager: Cluster Management and Task AutomationScyllaDB
 

What's hot (20)

GCPUG meetup 201610 - Dataflow Introduction
GCPUG meetup 201610 - Dataflow IntroductionGCPUG meetup 201610 - Dataflow Introduction
GCPUG meetup 201610 - Dataflow Introduction
 
Data integration with embulk
Data integration with embulkData integration with embulk
Data integration with embulk
 
More kibana
More kibanaMore kibana
More kibana
 
CODAIT/Spark-Bench
CODAIT/Spark-BenchCODAIT/Spark-Bench
CODAIT/Spark-Bench
 
High Performance, High Reliability Data Loading on ClickHouse
High Performance, High Reliability Data Loading on ClickHouseHigh Performance, High Reliability Data Loading on ClickHouse
High Performance, High Reliability Data Loading on ClickHouse
 
Embulk - 進化するバルクデータローダ
Embulk - 進化するバルクデータローダEmbulk - 進化するバルクデータローダ
Embulk - 進化するバルクデータローダ
 
Docker in Action
Docker in ActionDocker in Action
Docker in Action
 
Rails cantrips
Rails cantripsRails cantrips
Rails cantrips
 
Autoscaling Your Kubernetes Workloads (Sponsored by Datadog) - AWS Summit Sydney
Autoscaling Your Kubernetes Workloads (Sponsored by Datadog) - AWS Summit SydneyAutoscaling Your Kubernetes Workloads (Sponsored by Datadog) - AWS Summit Sydney
Autoscaling Your Kubernetes Workloads (Sponsored by Datadog) - AWS Summit Sydney
 
Monitoring Spark Applications
Monitoring Spark ApplicationsMonitoring Spark Applications
Monitoring Spark Applications
 
Cncf event driven autoscaling with keda
Cncf   event driven autoscaling with kedaCncf   event driven autoscaling with keda
Cncf event driven autoscaling with keda
 
Scala+data
Scala+dataScala+data
Scala+data
 
Create API for your Databases
Create API for your DatabasesCreate API for your Databases
Create API for your Databases
 
Big data lambda architecture - Streaming Layer Hands On
Big data lambda architecture - Streaming Layer Hands OnBig data lambda architecture - Streaming Layer Hands On
Big data lambda architecture - Streaming Layer Hands On
 
Kubernetes Service Catalog & Open Service Broker for Azure
Kubernetes Service Catalog & Open Service Broker for AzureKubernetes Service Catalog & Open Service Broker for Azure
Kubernetes Service Catalog & Open Service Broker for Azure
 
How to Live in a Post-Spring-Cloud-Netflix World - Olga Maciaszek-Sharma & Ja...
How to Live in a Post-Spring-Cloud-Netflix World - Olga Maciaszek-Sharma & Ja...How to Live in a Post-Spring-Cloud-Netflix World - Olga Maciaszek-Sharma & Ja...
How to Live in a Post-Spring-Cloud-Netflix World - Olga Maciaszek-Sharma & Ja...
 
Prometheus Monitoring Mixins (Berlin CNCB Meetup)
Prometheus Monitoring Mixins (Berlin CNCB Meetup)Prometheus Monitoring Mixins (Berlin CNCB Meetup)
Prometheus Monitoring Mixins (Berlin CNCB Meetup)
 
MapReduce with Scalding @ 24th Hadoop London Meetup
MapReduce with Scalding @ 24th Hadoop London MeetupMapReduce with Scalding @ 24th Hadoop London Meetup
MapReduce with Scalding @ 24th Hadoop London Meetup
 
FlutterでGraphQLを扱う
FlutterでGraphQLを扱うFlutterでGraphQLを扱う
FlutterでGraphQLを扱う
 
Introducing Scylla Manager: Cluster Management and Task Automation
Introducing Scylla Manager: Cluster Management and Task AutomationIntroducing Scylla Manager: Cluster Management and Task Automation
Introducing Scylla Manager: Cluster Management and Task Automation
 

Similar to You got database in my cloud (short version)

You got database in my cloud!
You got database  in my cloud!You got database  in my cloud!
You got database in my cloud!Liz Frost
 
Kubernetes + Python = ❤ - Cloud Native Prague
Kubernetes + Python = ❤ - Cloud Native PragueKubernetes + Python = ❤ - Cloud Native Prague
Kubernetes + Python = ❤ - Cloud Native PragueHenning Jacobs
 
使用 Prometheus 監控 Kubernetes Cluster
使用 Prometheus 監控 Kubernetes Cluster 使用 Prometheus 監控 Kubernetes Cluster
使用 Prometheus 監控 Kubernetes Cluster inwin stack
 
Pivotal Greenplum 次世代マルチクラウド・データ分析プラットフォーム
Pivotal Greenplum 次世代マルチクラウド・データ分析プラットフォームPivotal Greenplum 次世代マルチクラウド・データ分析プラットフォーム
Pivotal Greenplum 次世代マルチクラウド・データ分析プラットフォームMasayuki Matsushita
 
Kubernetes Architecture and Introduction – Paris Kubernetes Meetup
Kubernetes Architecture and Introduction – Paris Kubernetes MeetupKubernetes Architecture and Introduction – Paris Kubernetes Meetup
Kubernetes Architecture and Introduction – Paris Kubernetes MeetupStefan Schimanski
 
MySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELKMySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELKYoungHeon (Roy) Kim
 
Build Your Own CaaS (Container as a Service)
Build Your Own CaaS (Container as a Service)Build Your Own CaaS (Container as a Service)
Build Your Own CaaS (Container as a Service)HungWei Chiu
 
Kubernetes - Starting with 1.2
Kubernetes  - Starting with 1.2Kubernetes  - Starting with 1.2
Kubernetes - Starting with 1.2William Stewart
 
GitOps - Operation By Pull Request
GitOps - Operation By Pull RequestGitOps - Operation By Pull Request
GitOps - Operation By Pull RequestKasper Nissen
 
XebiCon'18 - Passage à l'échelle de mes applications Kafka-Streams
XebiCon'18 - Passage à l'échelle de mes applications Kafka-StreamsXebiCon'18 - Passage à l'échelle de mes applications Kafka-Streams
XebiCon'18 - Passage à l'échelle de mes applications Kafka-StreamsPublicis Sapient Engineering
 
OSDN: Serverless technologies with Kubernetes
OSDN: Serverless technologies with Kubernetes OSDN: Serverless technologies with Kubernetes
OSDN: Serverless technologies with Kubernetes Provectus
 
What is serveless?
What is serveless? What is serveless?
What is serveless? Provectus
 
KubeFuse - A File-System for Kubernetes
KubeFuse - A File-System for KubernetesKubeFuse - A File-System for Kubernetes
KubeFuse - A File-System for KubernetesBart Spaans
 
Monitoring infrastructure with prometheus
Monitoring infrastructure with prometheusMonitoring infrastructure with prometheus
Monitoring infrastructure with prometheusShahnawaz Saifi
 
Kube Your Enthusiasm
Kube Your EnthusiasmKube Your Enthusiasm
Kube Your EnthusiasmVMware Tanzu
 
Kube Your Enthusiasm - Paul Czarkowski
Kube Your Enthusiasm - Paul CzarkowskiKube Your Enthusiasm - Paul Czarkowski
Kube Your Enthusiasm - Paul CzarkowskiVMware Tanzu
 
Istio Playground
Istio PlaygroundIstio Playground
Istio PlaygroundQAware GmbH
 
Kubernetes Architecture and Introduction
Kubernetes Architecture and IntroductionKubernetes Architecture and Introduction
Kubernetes Architecture and IntroductionStefan Schimanski
 
[Hands-on] Kubernetes | Nov 18, 2017
[Hands-on] Kubernetes | Nov 18, 2017[Hands-on] Kubernetes | Nov 18, 2017
[Hands-on] Kubernetes | Nov 18, 2017Oracle Korea
 
Cutting the Kubernetes Monorepo in pieces
Cutting the Kubernetes Monorepo in piecesCutting the Kubernetes Monorepo in pieces
Cutting the Kubernetes Monorepo in piecesStefan Schimanski
 

Similar to You got database in my cloud (short version) (20)

You got database in my cloud!
You got database  in my cloud!You got database  in my cloud!
You got database in my cloud!
 
Kubernetes + Python = ❤ - Cloud Native Prague
Kubernetes + Python = ❤ - Cloud Native PragueKubernetes + Python = ❤ - Cloud Native Prague
Kubernetes + Python = ❤ - Cloud Native Prague
 
使用 Prometheus 監控 Kubernetes Cluster
使用 Prometheus 監控 Kubernetes Cluster 使用 Prometheus 監控 Kubernetes Cluster
使用 Prometheus 監控 Kubernetes Cluster
 
Pivotal Greenplum 次世代マルチクラウド・データ分析プラットフォーム
Pivotal Greenplum 次世代マルチクラウド・データ分析プラットフォームPivotal Greenplum 次世代マルチクラウド・データ分析プラットフォーム
Pivotal Greenplum 次世代マルチクラウド・データ分析プラットフォーム
 
Kubernetes Architecture and Introduction – Paris Kubernetes Meetup
Kubernetes Architecture and Introduction – Paris Kubernetes MeetupKubernetes Architecture and Introduction – Paris Kubernetes Meetup
Kubernetes Architecture and Introduction – Paris Kubernetes Meetup
 
MySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELKMySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELK
 
Build Your Own CaaS (Container as a Service)
Build Your Own CaaS (Container as a Service)Build Your Own CaaS (Container as a Service)
Build Your Own CaaS (Container as a Service)
 
Kubernetes - Starting with 1.2
Kubernetes  - Starting with 1.2Kubernetes  - Starting with 1.2
Kubernetes - Starting with 1.2
 
GitOps - Operation By Pull Request
GitOps - Operation By Pull RequestGitOps - Operation By Pull Request
GitOps - Operation By Pull Request
 
XebiCon'18 - Passage à l'échelle de mes applications Kafka-Streams
XebiCon'18 - Passage à l'échelle de mes applications Kafka-StreamsXebiCon'18 - Passage à l'échelle de mes applications Kafka-Streams
XebiCon'18 - Passage à l'échelle de mes applications Kafka-Streams
 
OSDN: Serverless technologies with Kubernetes
OSDN: Serverless technologies with Kubernetes OSDN: Serverless technologies with Kubernetes
OSDN: Serverless technologies with Kubernetes
 
What is serveless?
What is serveless? What is serveless?
What is serveless?
 
KubeFuse - A File-System for Kubernetes
KubeFuse - A File-System for KubernetesKubeFuse - A File-System for Kubernetes
KubeFuse - A File-System for Kubernetes
 
Monitoring infrastructure with prometheus
Monitoring infrastructure with prometheusMonitoring infrastructure with prometheus
Monitoring infrastructure with prometheus
 
Kube Your Enthusiasm
Kube Your EnthusiasmKube Your Enthusiasm
Kube Your Enthusiasm
 
Kube Your Enthusiasm - Paul Czarkowski
Kube Your Enthusiasm - Paul CzarkowskiKube Your Enthusiasm - Paul Czarkowski
Kube Your Enthusiasm - Paul Czarkowski
 
Istio Playground
Istio PlaygroundIstio Playground
Istio Playground
 
Kubernetes Architecture and Introduction
Kubernetes Architecture and IntroductionKubernetes Architecture and Introduction
Kubernetes Architecture and Introduction
 
[Hands-on] Kubernetes | Nov 18, 2017
[Hands-on] Kubernetes | Nov 18, 2017[Hands-on] Kubernetes | Nov 18, 2017
[Hands-on] Kubernetes | Nov 18, 2017
 
Cutting the Kubernetes Monorepo in pieces
Cutting the Kubernetes Monorepo in piecesCutting the Kubernetes Monorepo in pieces
Cutting the Kubernetes Monorepo in pieces
 

Recently uploaded

Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorTier1 app
 
Mastering Project Planning with Microsoft Project 2016.pptx
Mastering Project Planning with Microsoft Project 2016.pptxMastering Project Planning with Microsoft Project 2016.pptx
Mastering Project Planning with Microsoft Project 2016.pptxAS Design & AST.
 
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxThe Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxRTS corp
 
Best Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITBest Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITmanoharjgpsolutions
 
Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldRoberto Pérez Alcolea
 
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingOpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingShane Coughlan
 
Understanding Plagiarism: Causes, Consequences and Prevention.pptx
Understanding Plagiarism: Causes, Consequences and Prevention.pptxUnderstanding Plagiarism: Causes, Consequences and Prevention.pptx
Understanding Plagiarism: Causes, Consequences and Prevention.pptxSasikiranMarri
 
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited CatalogueRonisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogueitservices996
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...Bert Jan Schrijver
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolsosttopstonverter
 
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shardsChristopher Curtin
 
[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf
[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf
[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdfSteve Caron
 
Osi security architecture in network.pptx
Osi security architecture in network.pptxOsi security architecture in network.pptx
Osi security architecture in network.pptxVinzoCenzo
 
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics
 
Pros and Cons of Selenium In Automation Testing_ A Comprehensive Assessment.pdf
Pros and Cons of Selenium In Automation Testing_ A Comprehensive Assessment.pdfPros and Cons of Selenium In Automation Testing_ A Comprehensive Assessment.pdf
Pros and Cons of Selenium In Automation Testing_ A Comprehensive Assessment.pdfkalichargn70th171
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecturerahul_net
 
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...kalichargn70th171
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesKrzysztofKkol1
 
Zer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdfZer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdfmaor17
 
Introduction to Firebase Workshop Slides
Introduction to Firebase Workshop SlidesIntroduction to Firebase Workshop Slides
Introduction to Firebase Workshop Slidesvaideheekore1
 

Recently uploaded (20)

Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryError
 
Mastering Project Planning with Microsoft Project 2016.pptx
Mastering Project Planning with Microsoft Project 2016.pptxMastering Project Planning with Microsoft Project 2016.pptx
Mastering Project Planning with Microsoft Project 2016.pptx
 
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxThe Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
 
Best Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITBest Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh IT
 
Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository world
 
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingOpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
 
Understanding Plagiarism: Causes, Consequences and Prevention.pptx
Understanding Plagiarism: Causes, Consequences and Prevention.pptxUnderstanding Plagiarism: Causes, Consequences and Prevention.pptx
Understanding Plagiarism: Causes, Consequences and Prevention.pptx
 
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited CatalogueRonisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogue
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration tools
 
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards
 
[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf
[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf
[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf
 
Osi security architecture in network.pptx
Osi security architecture in network.pptxOsi security architecture in network.pptx
Osi security architecture in network.pptx
 
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
 
Pros and Cons of Selenium In Automation Testing_ A Comprehensive Assessment.pdf
Pros and Cons of Selenium In Automation Testing_ A Comprehensive Assessment.pdfPros and Cons of Selenium In Automation Testing_ A Comprehensive Assessment.pdf
Pros and Cons of Selenium In Automation Testing_ A Comprehensive Assessment.pdf
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecture
 
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
 
Zer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdfZer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdf
 
Introduction to Firebase Workshop Slides
Introduction to Firebase Workshop SlidesIntroduction to Firebase Workshop Slides
Introduction to Firebase Workshop Slides
 

You got database in my cloud (short version)

  • 1. @stillinbeta / #Kubecon Seattle 2018 You got Database in my Cloud! Kubernetes Foreign Data Wrapper for Postgres
  • 2. @stillinbeta / #Kubecon Seattle 2018 Who am I? Liz Frost Twitter: @stillinbeta slack.k8s.io: @liz
  • 3. @stillinbeta / #Kubecon Seattle 2018 Who am I?
  • 4. @stillinbeta / #Kubecon Seattle 2018 Who am I?
  • 5. @stillinbeta / #Kubecon Seattle 2018 Who am I?
  • 6. @stillinbeta / #Kubecon Seattle 2018 Who am I? (Stickers are available)
  • 7. @stillinbeta / #Kubecon Seattle 2018
  • 8. @stillinbeta / #Kubecon Seattle 2018 ...get it? zéro un zéro cero uno cero 零一零
  • 9. @stillinbeta / #Kubecon Seattle 2018 What is a Foreign Data Wrapper? ● ODBC ● SQLite ● Cassandra ● Redis ● Hue Bulbs? ● FDWs?? ● Kubernetes!
  • 10. @stillinbeta / #Kubecon Seattle 2018
  • 11. @stillinbeta / #Kubecon Seattle 2018 Success! Someone did the hard part for us! github.com/dennwc/go-fdw
  • 12. @stillinbeta / #Kubecon Seattle 2018 CREATE EXTENSION IF NOT EXISTS k8s_fdw; CREATE SERVER IF NOT EXISTS kind FOREIGN DATA WRAPPER k8s_fdw OPTIONS (kubeconfig '/kubeconfig'); CREATE FOREIGN TABLE IF NOT EXISTS pods ( name text OPTIONS (alias 'metadata.name') , namespace text OPTIONS (alias 'metadata.namespace') ) SERVER kind OPTIONS ( namespace 'kube-system' , apiVersion 'v1' , kind 'Pod' ); What kid of interface do we want?
  • 13. @stillinbeta / #Kubecon Seattle 2018 CREATE EXTENSION IF NOT EXISTS k8s_fdw; CREATE SERVER IF NOT EXISTS kind FOREIGN DATA WRAPPER k8s_fdw OPTIONS (kubeconfig '/kubeconfig'); CREATE FOREIGN TABLE IF NOT EXISTS pods ( name text OPTIONS (alias 'metadata.name') , namespace text OPTIONS (alias 'metadata.namespace') ) SERVER kind OPTIONS ( namespace 'kube-system' , apiVersion 'v1' , kind 'Pod' ); What kid of interface do we want?
  • 14. @stillinbeta / #Kubecon Seattle 2018 CREATE EXTENSION IF NOT EXISTS k8s_fdw; CREATE SERVER IF NOT EXISTS kind FOREIGN DATA WRAPPER k8s_fdw OPTIONS (kubeconfig '/kubeconfig'); CREATE FOREIGN TABLE IF NOT EXISTS pods ( name text OPTIONS (alias 'metadata.name') , namespace text OPTIONS (alias 'metadata.namespace') ) SERVER kind OPTIONS ( namespace 'kube-system' , apiVersion 'v1' , kind 'Pod' ); What kid of interface do we want?
  • 15. @stillinbeta / #Kubecon Seattle 2018 $ psql --user postgres < test.sql CREATE EXTENSION CREATE SERVER CREATE FOREIGN TABLE Give it a run...
  • 16. @stillinbeta / #Kubecon Seattle 2018 $ psql --user postgres < test.sql CREATE EXTENSION CREATE SERVER CREATE FOREIGN TABLE ERROR: couldn't get kubeconfig: couldn't get resource mapper: could not get api group resources: Get https://ec2-54-215-202-190.compute-1.amazo naws.com:6443/api?timeout=32s: net/http: invalid header field value "postgres: postgres postgres [local] SELECTx00x00x00x00x00x00x00x00x00 x00/v0.0.0 (linux/amd64) kubernetes/$Format" for key User-Agent oh.
  • 17. @stillinbeta / #Kubecon Seattle 2018 $ psql --user postgres < test.sql CREATE EXTENSION CREATE SERVER CREATE FOREIGN TABLE name | namespace --------------------------------+------------- coredns-6f685fffbf-7xrtp | kube-system coredns-6f685fffbf-nzfn7 | kube-system etcd-master | kube-system kube-apiserver-master | kube-system kube-controller-manager-master | kube-system kube-proxy-lk2mq | kube-system kube-scheduler-master | kube-system That’s better!
  • 18. @stillinbeta / #Kubecon Seattle 2018 What about more complicated objects?
  • 19. @stillinbeta / #Kubecon Seattle 2018 How about JSONPATH?
  • 20. @stillinbeta / #Kubecon Seattle 2018 ALTER FOREIGN TABLE pods ADD COLUMN container text OPTIONS (alias '{.spec.containers[0].image}') ; Let’s do that!
  • 21. @stillinbeta / #Kubecon Seattle 2018@stillinbeta / #Kubecon Seattle 2018 SELECT * from PODS; name | namespace | container --------------------------------+-------------+-------------------------------------------- coredns-6f685fffbf-7xrtp | kube-system | k8s.gcr.io/coredns:1.2.6 coredns-6f685fffbf-nzfn7 | kube-system | k8s.gcr.io/coredns:1.2.6 etcd-master | kube-system | k8s.gcr.io/etcd:3.2.24 kube-apiserver-master | kube-system | k8s.gcr.io/kube-apiserver:v1.12.1 kube-controller-manager-master | kube-system | k8s.gcr.io/kube-controller-manager:v1.12.1 kube-proxy-lk2mq | kube-system | k8s.gcr.io/kube-proxy:v1.12.1 kube-scheduler-master | kube-system | k8s.gcr.io/kube-scheduler:v1.12.1
  • 22. @stillinbeta / #Kubecon Seattle 2018 How about a map?
  • 23. @stillinbeta / #Kubecon Seattle 2018 ALTER FOREIGN TABLE pods ADD COLUMN labels jsonb OPTIONS (alias 'metadata.labels') ; jsonb to the rescue
  • 24. @stillinbeta / #Kubecon Seattle 2018@stillinbeta / #Kubecon Seattle 2018 SELECT name, labels FROM pods; name | labels --------------------------------+----------------------------------------------------------------------------------------------------- coredns-6f685fffbf-7xrtp | {"k8s-app": "kube-dns", "pod-template-hash": "6f685fffbf"} coredns-6f685fffbf-nzfn7 | {"k8s-app": "kube-dns", "pod-template-hash": "6f685fffbf"} etcd-master | {"tier": "control-plane", "component": "etcd"} kube-apiserver-master | {"tier": "control-plane", "component": "kube-apiserver"} kube-controller-manager-master | {"tier": "control-plane", "component": "kube-controller-manager"} kube-proxy-lk2mq | {"k8s-app": "kube-proxy", "pod-template-generation": "1", "controller-revision-hash": "6cbfff58bb"} kube-scheduler-master | {"tier": "control-plane", "component": "kube-scheduler"} (7 rows)
  • 25. @stillinbeta / #Kubecon Seattle 2018@stillinbeta / #Kubecon Seattle 2018 SELECT name, container, labels->'component' AS component FROM pods; name | container | component --------------------------------+--------------------------------------------+------------------------- -- coredns-6f685fffbf-7xrtp | k8s.gcr.io/coredns:1.2.6 | coredns-6f685fffbf-nzfn7 | k8s.gcr.io/coredns:1.2.6 | etcd-master | k8s.gcr.io/etcd:3.2.24 | "etcd" kube-apiserver-master | k8s.gcr.io/kube-apiserver:v1.12.1 | "kube-apiserver" kube-controller-manager-master | k8s.gcr.io/kube-controller-manager:v1.12.1 | "kube-controller-manager" kube-proxy-lk2mq | k8s.gcr.io/kube-proxy:v1.12.1 | kube-scheduler-master | k8s.gcr.io/kube-scheduler:v1.12.1 | "kube-scheduler"
  • 26. @stillinbeta / #Kubecon Seattle 2018 And for my final trick:
  • 27. @stillinbeta / #Kubecon Seattle 2018 CREATE FOREIGN TABLE IF NOT EXISTS replica_sets ( name text OPTIONS (alias 'metadata.name') , replicas bigint OPTIONS (alias 'status.replicas') , available bigint OPTIONS (alias 'status.availableReplicas') ) SERVER kind OPTIONS ( namespace 'kube-system' , apiVersion 'apps/v1' , kind 'ReplicaSet' ); CREATE FOREIGN TABLE IF NOT EXISTS deployments ( name text OPTIONS (alias 'metadata.name') , replicas bigint OPTIONS (alias 'status.replicas') , available bigint OPTIONS (alias 'status.availableReplicas') ) SERVER kind OPTIONS ( namespace 'kube-system' , apiVersion 'apps/v1' , kind 'Deployment' ); A few more tables
  • 28. @stillinbeta / #Kubecon Seattle 2018 CREATE FOREIGN TABLE IF NOT EXISTS replica_sets ( name text OPTIONS (alias 'metadata.name') , replicas bigint OPTIONS (alias 'status.replicas') , available bigint OPTIONS (alias 'status.availableReplicas') ) SERVER kind OPTIONS ( namespace 'kube-system' , apiVersion 'apps/v1' , kind 'ReplicaSet' ); CREATE FOREIGN TABLE IF NOT EXISTS deployments ( name text OPTIONS (alias 'metadata.name') , replicas bigint OPTIONS (alias 'status.replicas') , available bigint OPTIONS (alias 'status.availableReplicas') ) SERVER kind OPTIONS ( namespace 'kube-system' , apiVersion 'apps/v1' , kind 'Deployment' ); Just the important bits
  • 29. @stillinbeta / #Kubecon Seattle 2018@stillinbeta / #Kubecon Seattle 2018 SELECT "deployments"."name" AS deployment_name , "replica_sets"."name" as replica_name , "pods"."name" AS pod_name FROM deployments JOIN replica_sets on "replica_sets"."name" LIKE "deployments"."name" || '-%' JOIN pods on "pods"."name" LIKE "replica_sets"."name" || '-%'; deployment_name | replica_name | pod_name -----------------+--------------------+-------------------------- coredns | coredns-6f685fffbf | coredns-6f685fffbf-7xrtp coredns | coredns-6f685fffbf | coredns-6f685fffbf-nzfn7
  • 30. @stillinbeta / #Kubecon Seattle 2018 ● Column types mostly ignored What doesn’t work?
  • 31. @stillinbeta / #Kubecon Seattle 2018 ● Column types mostly ignored ● If it’s a not a number, string, or map... ...just kind of give up What doesn’t work?
  • 32. @stillinbeta / #Kubecon Seattle 2018 ● Column types mostly ignored ● If it’s a not a number, string, or map... ...just kind of give up ● The codebase not being a knot of spaghetti What doesn’t work?
  • 33. @stillinbeta / #Kubecon Seattle 2018 Questions? Concerns? Come find me! I’m the one with pink hair! Twitter: @stillinbeta slack.k8s.io: @liz Github: github.com/liztio/k8s-fdw Docker: liztio/k8s_fdw:master