Using Kubernetes as a datastore for SPIRE
Moto Ishizawa
@summerwind SPIFFE Meetup Tokyo #1
Slide 2
Slide 2 text
Moto Ishizawa
@summerwind
Slide 3
Slide 3 text
No content
Slide 4
Slide 4 text
I would like to use SPIRE server on Kubernetes…
SQL database !
Slide 5
Slide 5 text
• SPIRE's datastore is pluggable and interchangeable
• We already have a data storage to run Kubernetes cluster (It’s you, etcd!)
• kube-apiserver has a function to aggregate data by labels
No, wait...
Slide 6
Slide 6 text
Kubernetes Cluster
SPIRE Agent
SPIRE Agent
‘k8s’ datastore plugin for SPIRE
• https://github.com/summerwind/spire-plugin-datastore-k8s
• This plugin enables to use Kubernetes as a data store for SPIRE server
• Store SPIRE’s data as Custom Resources in Kubernetes
• It's still experimental, but it works!
SPIRE Server SPIRE Agent
kube-apiserver
Request SVID
Store data
Slide 7
Slide 7 text
Using ‘k8s’ datastore plugin on minikube (1)
Start your Kubernetes cluster with minikube.
$ minikube start \
--extra-config=apiserver.authorization-mode=RBAC \
--extra-config=apiserver.service-account-signing-key-file=/var/lib/minikube/certs/sa.key \
--extra-config=apiserver.service-account-key-file=/var/lib/minikube/certs/sa.pub \
--extra-config=apiserver.service-account-issuer=api \
--extra-config=apiserver.service-account-api-audiences=api,spire-server
Slide 8
Slide 8 text
Using ‘k8s’ datastore plugin on minikube (2)
Create CustomResourceDefinition resources.
$ curl -L https://github.com/summerwind/spire-plugin-datastore-k8s/releases/latest/
download/crd.yaml | kubectl apply -f -
Slide 9
Slide 9 text
Using ‘k8s’ datastore plugin on minikube (3)
Installing SPIRE server and SPIRE agents to your cluster.
$ curl -L https://raw.githubusercontent.com/summerwind/spire-plugin-datastore-k8s/master/
manifests/examples/spire-server.yaml | kubectl apply -f -
$ curl -L https://raw.githubusercontent.com/summerwind/spire-plugin-datastore-k8s/master/
manifests/examples/spire-agent.yaml | kubectl apply -f -