:title: Customizing store-gateway
:description: Learn how to tune custom Deis settings.

.. _store_gateway_settings:

Customizing store-gateway
=========================
The following settings are tunable for the :ref:`store` component's gateway service.

Dependencies
------------
Requires: :ref:`store-daemon <store_daemon_settings>`, :ref:`store-monitor <store_monitor_settings>`

Required by: :ref:`database <database_settings>`, :ref:`registry <registry_settings>`

Considerations: none

Settings set by store-gateway
-----------------------------
The following etcd keys are set by the store-gateway component, typically in its /bin/boot script.

==================================        =================================================================================
setting                                   description
==================================        =================================================================================
/deis/store/defaultPoolsConfigured        set once the gateway configures the default storage pools on first boot
/deis/store/gatewayKeyring                keyring for the gateway user to access the Ceph cluster (generated by Ceph)
/deis/store/gateway/accessKey             S3 API access used to access store-gateway (generated by Ceph)
/deis/store/gateway/host                  IP address of the host running store-gateway
/deis/store/gateway/port                  port used by the store-gateway service (default: 8888)
/deis/store/gateway/secretKey             S3 API secret key used to access store-gateway (generated by Ceph)
==================================        =================================================================================

Settings used by store-gateway
------------------------------
The following etcd keys are used by the store-gateway component.

====================================      =================================================================================================
setting                                   description
====================================      =================================================================================================
/deis/store/adminKeyring                  keyring for an admin user to access the Ceph cluster (set by store-monitor)
/deis/store/fsid                          Ceph filesystem ID (set by store-monitor)
/deis/store/hosts/*                       deis-monitor hosts (set by store-monitor)
/deis/store/monKeyring                    keyring for the monitor to access the Ceph cluster (set by store-monitor)
/deis/store/monSetupComplete              set when the Ceph cluster setup is complete (set by store-monitor)
/deis/store/monSetupLock                  host of store-monitor that completed setup (set by store-monitor)
/deis/store/minSize                       minimum number of store-daemons necessary for the cluster to accept writes (set by store-monitor)
/deis/store/pgNum                         number of Ceph placement groups for the storage pools (set by store-monitor)
/deis/store/size                          number of replicas for data stored in Ceph (set by store-monitor)
====================================      =================================================================================================

Using a custom store-gateway image
----------------------------------
You can use a custom Docker image for the store-gateway component instead of the image
supplied with Deis:

.. code-block:: console

    $ deisctl config store-gateway set image=myaccount/myimage:latest

This will pull the image from the public Docker registry. You can also pull from a private
registry:

.. code-block:: console

    $ deisctl config store-gateway set image=registry.mydomain.org:5000/myaccount/myimage:latest

Be sure that your custom image functions in the same way as the `stock store-gateway image`_ shipped with
Deis. Specifically, ensure that it sets and reads appropriate etcd keys.

.. _`stock store-gateway image`: https://github.com/deis/deis/tree/master/store/gateway
