spicedb-operator
spicedb-operator copied to clipboard
[RFE] add the ability to load schema and initial dataset
I think the title is self explanatory. I envision this feature as having configmap for the schema and the initial dataset and pointing the operator to them. The operator would then load the scripts in an idempotent way (i.e. respecting possibly existing data) when the cluster starts.
This might even call for CRDs to be able to version the schema.
This should be possible now with 1.2.0:
apiVersion: authzed.com/v1alpha1
kind: SpiceDBCluster
metadata:
name: dev
spec:
config:
datastoreEngine: memory
datastoreBootstrapFiles: /etc/bootstrap/init.yaml
secretName: dev-spicedb-config
patches:
- kind: Deployment
patch:
spec:
template:
spec:
volumes:
- name: bootstrap
configMap:
name: spicedb-bootstrap
containers:
- name: dev-spicedb
volumeMounts:
- name: bootstrap
mountPath: /etc/bootstrap
---
apiVersion: v1
kind: ConfigMap
metadata:
name: spicedb-bootstrap
data:
init.yaml: |
schema: |-
definition user {}
definition document {
relation writer: user
relation reader: user
permission edit = writer
permission view = reader + edit
}
relationships: |-
document:firstdoc#writer@user:tom
document:firstdoc#reader@user:fred
document:seconddoc#reader@user:tom
I'll keep this open though; I think the idea of a separate API for this interesting.