Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFE] add the ability to load schema and initial dataset #115

Open
raffaelespazzoli opened this issue Nov 30, 2022 · 2 comments
Open

[RFE] add the ability to load schema and initial dataset #115

raffaelespazzoli opened this issue Nov 30, 2022 · 2 comments

Comments

@raffaelespazzoli
Copy link

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.

@ensonic
Copy link
Contributor

ensonic commented Jan 31, 2023

This might even call for CRDs to be able to version the schema.

@ecordell
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants