# Objects Not Stored in Database

**URL:** <https://discourse.getcockpit.com/t/objects-not-stored-in-database/994>\
**Category:** Support\
**Created:** [August 29, 2019, 10:00am UTC](https://discourse.getcockpit.com/t/objects-not-stored-in-database/994 "2019-08-29T10:00:46Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![James](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@James](https://discourse.getcockpit.com/u/James)\
**Post date:** [August 29, 2019, 10:00am UTC](https://discourse.getcockpit.com/t/objects-not-stored-in-database/994/1 "2019-08-29T10:00:46Z")

</div>

I’m trying to setup Cockpit on docker/kubernetes. I’ve configured it to use MongoDB for storage, however objects such as Singletons, Collections and Forms are still being written to the filesystem instead.

Is this the intended behaviour? The ideal setup for running in docker would be to write all data to an external database and all assets to cloud storage.

---

<div class="post-metadata">

**Author:** ![pauloamgomes](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/pauloamgomes/32/48_2.png) [@pauloamgomes](https://discourse.getcockpit.com/u/pauloamgomes)\
**Post date:** [September 1, 2019, 11:28pm UTC](https://discourse.getcockpit.com/t/objects-not-stored-in-database/994/2 "2019-09-01T23:28:30Z")

</div>

By default the cockpit data structures (collections, singletons, forms) are saved in the filesystem (contents are saved in database).

---

<div class="post-metadata">

**Author:** ![Blistok](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/blistok/32/212_2.png) [@Blistok](https://discourse.getcockpit.com/u/Blistok)\
**Post date:** [September 3, 2019, 5:49pm UTC](https://discourse.getcockpit.com/t/objects-not-stored-in-database/994/3 "2019-09-03T17:49:21Z")

</div>

@pauloamgomes Do we have a good pattern for doing containerized deployments? This seems to be a bit of struggle. Perhaps support for `storage/` location on s3 bucket (or other external storage) might be a good start.

---

<div class="post-metadata">

**Author:** ![artur](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/artur/32/4_2.png) [@artur](https://discourse.getcockpit.com/u/artur)\
**Post date:** [September 4, 2019, 11:31am UTC](https://discourse.getcockpit.com/t/objects-not-stored-in-database/994/4 "2019-09-04T11:31:13Z")

</div>

schemas for collections, singletons etc should always be stored in a version control system (eg git) and placed correctly during a build/deploy task.

another option would be mounted folders to have persisted storage

---

<div class="post-metadata">

**Author:** ![James](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@James](https://discourse.getcockpit.com/u/James)\
**Post date:** [September 4, 2019, 11:53am UTC](https://discourse.getcockpit.com/t/objects-not-stored-in-database/994/5 "2019-09-04T11:53:03Z")

</div>

Thanks for the replies all.

The solution that we’re using on our production installation is a persistent disk to hold the storage data.

Correct me if I’m wrong but there’s no way to automatically commit data structures to a vcs when they are modified in Cockpit, this would surely have to be done manually after every change. Of course the structures could easily be restored during the build phase as we’re having to copy our config to the image with a custom docker file.

The more ‘container’ way to do things would be to store the config values in environment variables, all assets in cloud storage (s3/gcs), and all other data in the database. With this setup the stock image could easily be setup in an environment like Kubernetes.

---

<div class="post-metadata">

**Author:** ![artur](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/artur/32/4_2.png) [@artur](https://discourse.getcockpit.com/u/artur)\
**Post date:** [September 4, 2019, 4:34pm UTC](https://discourse.getcockpit.com/t/objects-not-stored-in-database/994/6 "2019-09-04T16:34:16Z")

</div>

Isn’t there a s3 volume mount plugin for docker? 🤔

---

<div class="post-metadata">

**Author:** ![James](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@James](https://discourse.getcockpit.com/u/James)\
**Post date:** [September 5, 2019, 9:19am UTC](https://discourse.getcockpit.com/t/objects-not-stored-in-database/994/7 "2019-09-05T09:19:08Z")

</div>

There is, but it only supports the storage of assets such as images/thumbs as far as I know. 🙁

In a container setup this means that a mounted volume is still needed, which is overkill for what is being stored.

---

<div class="post-metadata">

**Author:** ![domhdp](https://avatars.discourse-cdn.com/v4/letter/d/e47774/32.png) [@domhdp](https://discourse.getcockpit.com/u/domhdp)\
**Post date:** [February 4, 2020, 2:13am UTC](https://discourse.getcockpit.com/t/objects-not-stored-in-database/994/8 "2020-02-04T02:13:48Z")

</div>

Hi James, you could probably use a Kubernetes configmap mounted into the container. Then you could update the schema saving functionality to update the configmap? This is something I would be interested in too
