A variety of Deis components rely on an object storage system to do their work. These components are:
These components are flexible and can work out of the box with almost any system that is compatible with the S3 API.
Additionally, Deis ships with a Minio component by default, which provides in-cluster, ephemeral object storage. This means that if the Minio server crashes, all data will be lost. Therefore, Minio should be used for development or testing only.
In our beta release, the components listed above are configured by default to automatically use the Minio service for object storage.
Every Deis component that relies on object storage relies on the following two inputs for configuration:
- An environment variable that describe what object storage system to use.
- A configuration file (objectstorage.toml) to provide access credentials for the object storage system.
- We suggest storing the contents of these files in Kubernetes secrets and mounting them as volumes to each pod.
- See the workflow-dev chart for examples of using and mounting secrets.
The subsections herein explain how to configure these two inputs for each applicable component.
The builder looks for a BUILDER_STORAGE environment variable, which it then uses as a key to look up the object storage location and authentication information in a configuration file. See below for details on that file.
The builder reads the credential information from a objectstorage-keyfile secret. This is generated automatically (as part of the helm generate command) based on the configuration options given in the objectstorage.toml file file.
If you are using the Helm Chart for Workflow, put your credentials in the objectstorage.toml file before you run helm generate. Note that you don't need to base64-encode the credentials, as Helm will do that for you. For more information, see the installation instructions for more details on using Helm.
The slugbuilder is configured and launched by the builder inside a Deis cluster, so this section only applies if you intend to run it as a standalone component.
The slugbuilder looks for the below environment variables to determine where to download code from and upload slugs to.
TAR_PATH- The location of the.tararchive (which it will build)PUT_PATH- The location this component will upload the finished slug to
Note that these environment variables are case-sensitive.
The slugbuilder reads the credential information from a objectstorage-keyfile secret. This is generated automatically (as part of the helm generate command) based on the configuration options given in the objectstorage.toml file file.
The Helm Chart for Workflow contains no manifest for the slugbuilder. As noted above, the builder handles all configuration and lifecycle management for you.
If, however, you wish to run the slugbuilder as a standalone component, you can use the objectstorage-keyfile secret to easily provide your pods with the credentials information they need. This is generated automatically (as part of the helm generate command) based on the configuration options given in the objectstorage.toml file file.
The slugrunner is configured and launched by the controller inside a Deis cluster, so this section only applies if you intend to run it as a standalone component.
The slugrunner uses the SLUG_URL environment variable to determine where to download the slug (that it will run) from.
The slugrunner reads the credential information from a objectstorage-keyfile secret. This is generated automatically (as part of the helm generate command) based on the configuration options given in the objectstorage.toml file file.
The Helm Chart for Workflow contains no manifest for the slugrunner. As noted above, the controller handles all configuration and lifecycle management for you.
If, however, you wish to run the slugrunner as a standalone component, you can use the objectstorage-keyfile secret to easily provide your pods with the credentials information they need. This is generated automatically (as part of the helm generate command) based on the configuration options given in the objectstorage.toml file file.
When the controller needs to launch or scale a new buildpack application, it uses a replication controller. Since the slugrunner needs to download the slug to run, it needs the object storage location of the slug and the object storage credentials.
The controller needs no environment variables for object storage configuration.
Since the object storage location information comes from the builder, the controller only needs access to the credentials information. The controller gets this information by accessing the minio-user secret (even if it's not using Minio as the object storage system) directly from the Kubernetes API.
No paths need to be mounted into the pod. Simply ensure that the secret exists in your Kubernetes cluster with the correct credentials.
If you are using the Helm Chart for Workflow, put your credentials in the objectstorage.toml file before you run helm generate. Note that you don't need to base64-encode the credentials, as Helm will do that for you. For more information, see the installation instructions for more details on using Helm.
The registry is configured slightly differently from most of the other components. Read on for details.
The registry looks for a REGISTRY_STORAGE environment variable, which it then uses as a key to look up the object storage location and authentication information in a configuration file. See below for details on that file.
The registry reads the credential information from a /var/run/secrets/deis/registry/creds/objectstorage-keyfile file. This is generated automatically (as part of the helm generate command) based on the configuration options given in the objectstorage.toml file file.
If you are using the Helm Chart for Workflow, put your credentials in the objectstorage.toml file before you run helm generate. Note that you don't need to base64-encode the credentials, as Helm will do that for you. For more information, see the installation instructions for more details on using Helm.
The database is configured slightly differently from the other components. Read the two sections below for details.
The database looks for a DATABASE_STORAGE environment variable, which it then uses as a key to look up the object storage location and authentication information in a configuration file. See below for the details on that file.
Depending on the value of DATABASE_STORAGE, the database will either read the credentials from a generic objectstore secret or from a minio-user secret.in /var/run/secrets/deis/objectstore/creds/ or from /var/run/secrets/deis/database/creds/. The following ways to configure the database are listed below.
If the DATABASE_STORAGE backend is configured as anything else other than "s3", the database will receive its credentials from /var/run/secrets/deis/database/creds/. This is generated based on the configuration options given in the https://github.com/deis/charts/blob/master/workflow-dev/manifests/deis-minio-secret-user.yaml file. The access key and secret key must be base64 encoded.
Connection details to minio are configured via DEIS_MINIO_SERVICE_HOST and DEIS_MINIO_SERVICE_PORT, both of which are provided by the deis-minio service.
If the DATABASE_STORAGE backend is configured as "s3", the database will receive its credentials from /var/run/secrets/deis/objectstore/creds/. This is generated automatically (as part of the helm generate command) based on the configuration options given in the https://github.com/deis/charts/blob/master/workflow-dev/tpl/objectstorage.toml file.
Google Cloud Storage (GCS) can interoperate with the S3 API using a feature called interoperability. If you choose to use GCS for object storage for database, you'll have to turn on this interoperability mode. In order to do so, please follow the steps in the GCS migration documentation.
If the DATABASE_STORAGE backend is configured as "gcs", the database will receive its credentials from /var/run/secrets/deis/database/creds/. This is generated based on the configuration options given in the https://github.com/deis/charts/blob/master/workflow-dev/manifests/deis-minio-secret-user.yaml file. The access key and secret key must be base64 encoded.
You'll also need to add two environment variables to the https://github.com/deis/charts/blob/master/workflow-dev/tpl/deis-database-rc.yaml file so the database can communicate with Google Cloud Storage instead of minio. Add these values to your spec.template.spec.containers[0].env section, then run helm generate for the settings to take effect the next time you install workflow:
- name: DEIS_MINIO_SERVICE_HOST
value: storage.googleapis.com
- name: DEIS_MINIO_SERVICE_PORT
value: "443"If you are using the Helm Chart for Workflow, you'll have to put your credentials into the below two places before you run helm generate. For more details on using Helm, see the installation instructions.
- The minio secret file (under
access-key-idandaccess-secret-key). Ensure your credentials are base64-encoded - The objectstorage.toml file. Your credentials need not be base64-encoded in this file
Note - to base64 encode your credentials for use in the minio secret file, you can use the base64 tool on most systems. Here's an example usage:
echo $MY_ACCESS_KEY | base64