Skip to content

[installer]: add explanation for configuring AWS container registry #8322

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions components/installer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,31 @@ The `container-registry-token` secret must contain a `.dockerconfigjson`
key - this can be created by using the `kubectl create secret docker-registry`
[command](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/#create-a-secret-by-providing-credentials-on-the-command-line).

### Using Amazon Elastic Container Registry (ECR)

Gitpod is compatible with any registry that implements the [Docker Registry HTTP API V2](https://docs.docker.com/registry/spec/api/)
specification. Amazon ECR does not implement this spec fully. The spec expects
that, if an image is pushed to a repository that doesn't exist, it creates the
repository before uploading the image. Amazon ECR does not do this - if the
repository doesn't exist, it will error on push.

To configure Gitpod to use Amazon, you will need to use the in-cluster
registry and configure it to use S3 storage as the backend storage.

```yaml
containerRegistry:
inCluster: true
s3storage:
bucket: <name of bucket>
certificate:
kind: secret
name: s3-storage-token
```

The secret expects to have two keys:
- `s3AccessKey`
- `s3SecretKey`

## Database

Gitpod requires an instance of MySQL 5.7 for data storage.
Expand Down
5 changes: 5 additions & 0 deletions components/installer/pkg/config/v1/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ func (v version) ClusterValidation(rcfg interface{}) cluster.ValidationChecks {
res = append(res, cluster.CheckSecret(secretName, cluster.CheckSecretRequiredData(".dockerconfigjson")))
}

if cfg.ContainerRegistry.S3Storage != nil {
secretName := cfg.ContainerRegistry.S3Storage.Certificate.Name
res = append(res, cluster.CheckSecret(secretName, cluster.CheckSecretRequiredData("s3AccessKey", "s3SecretKey")))
}

if cfg.Database.CloudSQL != nil {
secretName := cfg.Database.CloudSQL.ServiceAccount.Name
res = append(res, cluster.CheckSecret(secretName, cluster.CheckSecretRequiredData("credentials.json", "encryptionKeys", "password", "username")))
Expand Down