Skip to content

Commit 442a9a9

Browse files
committed
Merge pull request #68 from arschles/s3-docs
doc(configuring-object-storage.md): add section on storing credentials & GCS
2 parents e6f9889 + f575341 commit 442a9a9

1 file changed

Lines changed: 96 additions & 7 deletions

File tree

src/installing-deis/configuring-object-storage.md

Lines changed: 96 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,109 @@ A variety of Deis components rely on an object storage system to do their work.
66
- [slugbuilder](https://github.com/deis/slugbuilder)
77
- [slugrunner](https://github.com/deis/slugrunner)
88
- [registry](https://github.com/deis/registry)
9+
- [database](https://github.com/deis/postgres)
910

10-
These components are built flexibly, so they can work out of the box with almost any system that is compatible with the [S3 API](http://docs.aws.amazon.com/AmazonS3/latest/API/APIRest.html).
11+
These components are flexible and can work out of the box with almost any system that is compatible with the [S3 API](http://docs.aws.amazon.com/AmazonS3/latest/API/APIRest.html).
1112

1213
# Minio
1314

1415
Additionally, Deis ships with a [Minio](http://minio.io) [component](https://github.com/deis/minio). This component runs as a Kubernetes service, and the components listed above are configured to automatically look for that service and use it as object storage if it's available.
1516

16-
# Telling Deis What to Use
17+
# Configuring the Deis Components
1718

18-
The Deis components determine what object storage system to use via environment variables that you set up:
19+
Every Deis component that relies on object storage relies on the following two inputs for configuration:
1920

20-
- `DEIS_MINIO_SERVICE_HOST` and `DEIS_MINIO_SERVICE_PORT` - The in-cluster Minio service
21-
- `DEIS_OUTSIDE_STORAGE_HOST` and `DEIS_OUTSIDE_STORAGE_PORT` - The external S3-compatible object storage system
21+
- One or more environment variables with host and port to describe where the object storage system is
22+
- One or more files to provide access credentials for the object storage system.
23+
- We suggest storing these values in [Kubernetes secrets](http://kubernetes.io/v1.1/docs/user-guide/secrets.html) and mounting them as volumes to each pod
24+
- See [the deis-dev chart](https://github.com/deis/charts/tree/master/deis-dev) for examples of using and mounting secrets.
2225

23-
# Limitations
26+
The subsections herein explain how to configure these two inputs for each applicable component.
2427

25-
The only currently known limitation is that [the Deis registry component](https://github.com/deis/registry) will not automatically look up the minio service, nor will it look for other storage env vars. That fix is being tracked in a [GitHub issue](https://github.com/deis/registry/issues/7) and is planned for our beta release.
28+
## [deis/builder](https://github.com/deis/builder)
29+
30+
### Environment Variables
31+
32+
The builder looks for the below environment variables to determine where the object storage system is.
33+
34+
- `DEIS_OUTSIDE_STORAGE` - The external S3-compatible object storage system. Commonly used URLs:
35+
- `s3.amazonaws.com` for Amazon S3's `us-east-1a` region
36+
- `storage.googleapis.com` for Google Cloud Storage
37+
- `DEIS_MINIO_SERVICE_HOST` and `DEIS_MINIO_SERVICE_PORT` - The in-cluster Minio service. Additional notes about these variables:
38+
- They are set automatically by Kubernetes if you run [Minio](http://minio.io) as a service in the cluster
39+
- The [Helm chart for Deis](https://github.com/deis/charts/tree/master/deis-dev) installs Minio by default, so the Builder will use Minio by default.
40+
41+
Note that if the builder finds a `DEIS_OUTSIDE_STORAGE_HOST` environment variable, it will ignore `DEIS_MINIO_SERVICE_HOST` and `DEIS_MINIO_SERVICE_PORT`. This behavior means that external object storage takes precedence over Minio.
42+
43+
The builder also uses an environment variable to determine the name of the bucket it should store build artifacts in. It uses `git` by default, but if your credentials (see below for how credentials are configured) don't have read and write access to that bucket, you'll have to specify a different one.
44+
45+
To do so, simply set the `BUCKET` environment variable to another value (`deis-builds`, for example).
46+
47+
### Credentials
48+
49+
The builder reads credentials from the below locations on the filesystem.
50+
51+
- Key: `/var/run/secrets/object/store/access-key-id`
52+
- Secret `/var/run/secrets/object/store/access-key-secret`
53+
54+
### A Note on Google Cloud Storage
55+
56+
Google Cloud Storage (GCS) can interoperate with the S3 API using a feature called [interoperability](https://cloud.google.com/storage/docs/interoperability). If you choose to use GCS for object storage, you'll have to turn on this interoperability mode. In order to do so, please follow the steps at https://cloud.google.com/storage/docs/migrating?hl=en_US#migration-simple.
57+
58+
When you're done, please set the `DEIS_OUTSIDE_STORAGE` environment variable to `storage.googleapis.com`, and ensure the keys that you created (as part of the previous paragraph) are in the correct locations on the filesystem.
59+
60+
Reminder: We recommend storing these and all other credentials as Kubernetes secrets. See the "Configuring Deis Components" section above for more details and examples.
61+
62+
## [deis/slugbuilder](https://github.com/deis/slugbuilder)
63+
64+
### Environment Variables
65+
66+
The slugbuilder looks for the below environment variables to determine where to download code from and upload slugs to.
67+
68+
- `TAR_URL` - The location of the `.tar` archive (which it will build)
69+
- `put_url` - The location this component will upload the finished slug to
70+
71+
### Credentials
72+
73+
The slugbuilder reads credentials from the below locations on the filesystem.
74+
75+
- Key: `/var/run/secrets/object/store/access-key-id`
76+
- Secret `/var/run/secrets/object/store/access-key-secret`
77+
78+
79+
## [deis/slugrunner](https://github.com/deis/slugrunner)
80+
81+
### Environment Variables
82+
83+
The slugrunner uses the `SLUG_URL` environment variable to determine where to download the slug (that it will run) from.
84+
85+
### Credentials
86+
87+
The slugrunner reads credentials from the below locations on the filesystem.
88+
89+
- Key: `/var/run/secrets/object/store/access-key-id`
90+
- Secret: `/var/run/secrets/object/store/access-key-secret`
91+
92+
## [deis/registry](https://github.com/deis/registry)
93+
94+
The registry is configured slightly differently from most of the other components. Read on for details.
95+
96+
### Environment Variables
97+
98+
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.
99+
100+
### Credentials
101+
102+
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 https://github.com/deis/charts/blob/master/deis-dev/tpl/objectstorage.toml file.
103+
104+
## [deis/database](https://github.com/deis/postgres)
105+
106+
The database is configured slightly differently from the other components. Read the two sections below for details.
107+
108+
### Environment Variables
109+
110+
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.
111+
112+
## Credentials
113+
114+
The database reads the credentials information from a `/var/run/secrets/deis/objectstore/creds/objectstorage-keyfile` file. This is generated automatically during helm generate based on the configuration options given in the https://github.com/deis/charts/blob/master/deis-dev/tpl/objectstorage.toml.

0 commit comments

Comments
 (0)