Skip to content

Commit 59bd41e

Browse files
author
Keerthan Mala
committed
feat(storage): change docs to use deis-object-storage-secret.yaml for configuring the storage
1 parent d9d28f7 commit 59bd41e

1 file changed

Lines changed: 16 additions & 84 deletions

File tree

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

Lines changed: 16 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,19 @@ A variety of Deis components rely on an object storage system to do their work.
1111

1212
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).
1313

14-
Note: object storage configuration has not been standardized across all components in our beta release. As such, configuration instructions differ for each component. We plan to remediate this problem in our next release. Please see [deis/deis#4966](https://github.com/deis/deis/issues/4966) for our progress on that work.
15-
1614
## Minio
1715

1816
Additionally, Deis ships with a [Minio](http://minio.io) [component](https://github.com/deis/minio) 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**.
1917

2018
In our beta release, the components listed above are configured by default to automatically use the Minio [service][k8s-service] for object storage.
2119

22-
## Google Cloud Storage
23-
24-
[Google Cloud Storage](https://cloud.google.com/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 in the [GCS migration documentation](https://cloud.google.com/storage/docs/migrating?hl=en_US#migration-simple).
25-
26-
We recommend storing these and all other credentials as Kubernetes secrets. See the below sections for details on configuring each component for details.
27-
2820
# Configuring the Deis Components
2921

3022
Every Deis component that relies on object storage relies on the following two inputs for configuration:
3123

32-
- One or more environment variables that describe what object storage system to use
33-
- One or more files to provide access credentials for the object storage system.
34-
- We suggest storing the contents of these files in [Kubernetes secrets][k8s-secret] and mounting them as volumes to each pod
24+
- An environment variable that describe what object storage system to use.
25+
- A configuration file ([objectstorage.toml][objectstorage-toml]) to provide access credentials for the object storage system.
26+
- We suggest storing the contents of these files in [Kubernetes secrets][k8s-secret] and mounting them as volumes to each pod.
3527
- See [the workflow-dev chart](https://github.com/deis/charts/tree/master/workflow-dev) for examples of using and mounting secrets.
3628

3729
The subsections herein explain how to configure these two inputs for each applicable component.
@@ -40,37 +32,15 @@ The subsections herein explain how to configure these two inputs for each applic
4032

4133
### Environment Variables
4234

43-
The builder looks for the below environment variables to determine where the object storage system is.
44-
45-
- `DEIS_OUTSIDE_STORAGE` - The external S3-compatible object storage system. Commonly used URLs:
46-
- `s3.amazonaws.com` for [Amazon S3](https://aws.amazon.com/s3/)
47-
- `storage.googleapis.com` for [Google Cloud Storage](https://cloud.google.com/storage/)
48-
- `DEIS_MINIO_SERVICE_HOST` and `DEIS_MINIO_SERVICE_PORT` - The in-cluster Minio service. Additional notes about these variables:
49-
- They are set automatically by Kubernetes if you run [Minio](http://minio.io) as a service in the cluster
50-
- The [Helm chart for Deis](https://github.com/deis/charts/tree/master/workflow-dev) installs Minio by default, so the Builder will use Minio by default.
51-
52-
A few additional notes:
53-
54-
- If the builder finds a `DEIS_OUTSIDE_STORAGE` 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.
55-
- The builder only supports the default Amazon S3 region (`us-east-1a`) and the default Google Cloud Storage location (`us`). This is a known limitation that we plan to fix in an upcoming release
56-
- The builder 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. To do so, simply set the `BUCKET` environment variable to another value (`deis-builds`, for example)
35+
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.
5736

5837
### Credentials
5938

60-
The builder reads credentials from the below locations on the filesystem.
61-
62-
- Key: `/var/run/secrets/object/store/access-key-id`
63-
- Secret `/var/run/secrets/object/store/access-key-secret`
39+
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][objectstorage-toml] file.
6440

6541
### Helm Chart
6642

67-
If you are using the [Helm Chart for Workflow][helm-chart], put your base64-encoded credentials in the [`minio-user` secret][minio-user-secret] (under `access-key-id` and `access-secret-key`) before you `helm install`. For more information, see the [installation instructions][helm-install] for more details on using Helm.
68-
69-
Note - to base64 encode your credentials, you can use the `base64` tool on most systems. Here's an example usage:
70-
71-
```console
72-
echo $MY_ACCESS_KEY | base64
73-
```
43+
If you are using the [Helm Chart for Workflow][helm-chart], put your credentials in the [objectstorage.toml][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][helm-install] for more details on using Helm.
7444

7545
## [deis/slugbuilder](https://github.com/deis/slugbuilder)
7646

@@ -80,72 +50,38 @@ The slugbuilder is configured and launched by the builder inside a Deis cluster,
8050

8151
The slugbuilder looks for the below environment variables to determine where to download code from and upload slugs to.
8252

83-
- `TAR_URL` - The location of the `.tar` archive (which it will build)
84-
- `put_url` - The location this component will upload the finished slug to
53+
- `TAR_PATH` - The location of the `.tar` archive (which it will build)
54+
- `PUT_PATH` - The location this component will upload the finished slug to
8555

8656
Note that these environment variables are case-sensitive.
8757

8858
### Credentials
8959

90-
The slugbuilder reads credentials from the below locations on the filesystem.
91-
92-
- Key: `/var/run/secrets/object/store/access-key-id`
93-
- Secret `/var/run/secrets/object/store/access-key-secret`
60+
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][objectstorage-toml] file.
9461

9562
### Helm Chart
9663

9764
The [Helm Chart for Workflow][helm-chart] contains no manifest for the slugbuilder. As noted above, the builder handles all configuration and lifecycle management for you.
9865

99-
If, however, you wish to run the slugbuilder as a standalone component, you can use the [`minio-user` secret][minio-user-secret] to easily provide your pods with the credentials information they need. To do so, put your base64-encoded credentials in the [`minio-user` secret][minio-user-secret] (under `access-key-id` and `access-secret-key`) before you `helm install`. For more information, see the [installation instructions][helm-install] for more details on using Helm.
100-
101-
Note - to base64 encode your credentials, you can use the `base64` tool on most systems. Here's an example usage:
102-
103-
```console
104-
echo $MY_ACCESS_KEY | base64
105-
```
66+
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][objectstorage-toml] file.
10667

10768
## [deis/slugrunner](https://github.com/deis/slugrunner)
10869

109-
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 standlone component.
70+
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.
11071

11172
### Environment Variables
11273

11374
The slugrunner uses the `SLUG_URL` environment variable to determine where to download the slug (that it will run) from.
11475

11576
### Credentials
11677

117-
The slugrunner reads credentials from the below locations on the filesystem.
118-
119-
- Key: `/var/run/secrets/object/store/access-key-id`
120-
- Secret: `/var/run/secrets/object/store/access-key-secret`
78+
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][objectstorage-toml] file.
12179

12280
### Helm Chart
12381

12482
The [Helm Chart for Workflow][helm-chart] contains no manifest for the slugrunner. As noted above, the controller handles all configuration and lifecycle management for you.
12583

126-
If, however, you wish to run the slugrunner as a standalone component, you can use the [`minio-user` secret][minio-user-secret] to easily provide your pods with the credentials information they need. To do so, put your base64-encoded credentials information into the `access-key-id` and `access-secret-key` fields, and mount the secret like this:
127-
128-
Under the `spec.template.spec.volumes` section:
129-
130-
```yaml
131-
- name: minio-user
132-
secret:
133-
secretName: minio-user
134-
```
135-
136-
Under the `spec.template.spec.containers[0].volumeMounts` section:
137-
138-
```yaml
139-
- name: minio-user
140-
mountPath: /var/run/secrets/object/store
141-
readOnly: true
142-
```
143-
144-
Note - to base64 encode your credentials, you can use the `base64` tool on most systems. Here's an example usage:
145-
146-
```console
147-
echo $MY_ACCESS_KEY | base64
148-
```
84+
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][objectstorage-toml] file.
14985

15086
## [deis/controller](https://github.com/deis/controller)
15187

@@ -163,13 +99,7 @@ No paths need to be mounted into the pod. Simply ensure that the secret exists i
16399

164100
### Helm Chart
165101

166-
If you are using the [Helm Chart for Workflow][helm-chart], put your base64-encoded credentials in the [`minio-user` secret][minio-user-secret] (under `access-key-id` and `access-secret-key`) before you `helm install`. For more information, see the [installation instructions][helm-install] for more details on using Helm.
167-
168-
Note - to base64 encode your credentials, you can use the `base64` tool on most systems. Here's an example usage:
169-
170-
```console
171-
echo $MY_ACCESS_KEY | base64
172-
```
102+
If you are using the [Helm Chart for Workflow][helm-chart], put your credentials in the [objectstorage.toml][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][helm-install] for more details on using Helm.
173103

174104
## [deis/registry](https://github.com/deis/registry)
175105

@@ -211,6 +141,8 @@ If the `DATABASE_STORAGE` backend is configured as "s3", the database will recei
211141

212142
### Google Cloud Storage (Interoperability Mode)
213143

144+
[Google Cloud Storage](https://cloud.google.com/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 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](https://cloud.google.com/storage/docs/migrating?hl=en_US#migration-simple).
145+
214146
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.
215147

216148
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:

0 commit comments

Comments
 (0)