Skip to main content
Skip to main content
🚧 Work in Progress

Create Object storage service

Zerops provides a S3 compatible Object storage service to store your files. Zerops Object storage is powered by MinIO, a high-performance, S3 compatible object store. MinIO is built for large scale AI/ML, data lake and database workloads.

Create Object storage service using Zerops GUI​

First, set up a project in Zerops GUI and add a runtime service. Then go to the project dashboard page and choose Add new service in the left menu in the Services block. Then add a new Object storage service:

Set a name​

Enter a unique service identifier like storage,s3 etc. Duplicate services with the same name in the same project are forbidden.

Limitations:​

maximum 25 characters must contain only lowercase ASCII letters (a-z) or numbers (0-9)

Note

The name is fixed after the service is created. It can't be changed later.

Object storage bucket​

Zerops creates one bucket automatically for each new Object storage service.

Note

Each Object storage service can only contain one bucket. If your application needs multiple buckets, add more Object storage services.

Name​

Bucket will be created with a name based on the given service name and a random prefix. The name of the bucket cannot be changed later.

Access policy​

Select one of the basic policy templates:

TemplateDescription
Public read

Allows anyone:

  • to read the bucket's location (s3:GetBucketLocation)
  • to list all bucket's objects (s3:ListBucket)
  • to get any object of the bucket (s3:GetObject)
Public objects read

Allows anyone:

  • to read the bucket's location (s3:GetBucketLocation)
  • to get any object of the bucket (s3:GetObject)
Public read write

Allows anyone:

  • to read the bucket's location (s3:GetBucketLocation)
  • to list all bucket's objects (s3:ListBucket)
  • to get any object of the bucket (s3:GetObject)
  • to create a new object in the bucket (s3:PutObject,s3:ListMultipartUploadParts, s3:AbortMultipartUpload, s3:ListBucketMultipartUploads)
  • to delete any object of the bucket (s3:DeleteObject)
Public writeAllows anyone to create objects in the bucket (PutObject action)
PrivateDenies the access to unauthenticated users.

Or you can set your own access policy in the IAM Policy JSON format.

Example:​

{
'Version': '2012-10-17',
'Statement':
[
{
'Effect': 'Allow',
'Principal': { 'AWS': ['*'] },
'Action': ['s3:GetBucketLocation', 's3:ListBucket'],
'Resource': ['arn:aws:s3:::{{.BucketName}}'],
},
{
'Effect': 'Allow',
'Principal': { 'AWS': ['*'] },
'Action': ['s3:GetObject'],
'Resource': ['arn:aws:s3:::{{.BucketName}}/*'],
},
],
}
Tip

The {{ .BucketName }} variable will be replaced by the bucket name.

The bucket's policy can be changed later in Zerops GUI.

Quota​

Set the bucket quota size in GB. The quota must be set manually. It can be changed later in Zerops GUI. Zerops doesn't support Object storage autoscaling. You can set the bucket quota from 1 to 100 GB.

image

Create Object storage using zCLI​

zCLI is the Zerops command-line tool. To create a new Object storage service via the command-line, follow these steps:

  1. Install & setup zCLI
  2. Create a project description file
  3. Create a project and an Object storage service

Create a project description file​

Zerops uses a yaml format file to describe the project infrastructure.

Example​

Create a directory my-project. Create a description.yml file inside the directory with the following content:

# basic project data
project:
# project name
name: my-project

# optional: project description
description: A project with an Object storage

# optional: project tags
tags:
- DEMO
- ZEROPS

# array of project services
services:
- # service name
hostname: upload

# service type
type: objectstorage

# Object storage size in GB
objectStorageSize: 73

# Choose object storage policy from a predefined list
objectStoragePolicy: public-write

# Or define a custom policy
objectStorageRawPolicy:

The yaml file describes your future project infrastructure. The project will contain one Object storage service named upload. The bucket quota will be set to 73 GB and the bucket access policy will be set to public-write.

Description of description.yml parameters​

The project: section is required. Only one project can be defined.

ParameterDescriptionLimitations
nameThe name of the new project. Duplicates are allowed.Maximum 255 characters
descriptionOptional. Description of the new project.
tagsOptional. One or more string tags. Tags do not have a functional meaning, they only provide better orientation in projects.

At least one service in services: section is required. You can create a project with multiple services. The example above contains only Object storage service but you can create a description.yml with different types of services.

ParameterDescription
hostname

The unique service identifier.

Limitations:
  • duplicate services with the same name in the same project are forbidden
  • maximum 25 characters
  • must contain only lowercase ASCII letters (a-z) or numbers (0-9)
type

Specifies the Object storage type objectstorage and version.


Set type: objectstorage

Limitations:

Currently objectstorage or object-storage is available.

objectStorageSize

The size of the bucket quota in GB.

Limitations:

Set a whole number between 1 and 100.

objectStoragePolicy

Optional. Either objectStoragePolicy or objectStorageRawPolicy is required.

Set one of allowed values:

  • public-read
  • public-objects-read
  • public-read-write
  • public-write
  • private

Read more about the basic policy templates.

objectStorageRawPolicy

Optional. Either objectStoragePolicy or objectStorageRawPolicy is required.

Set your own access policy in the IAM Policy JSON format.

The {{ .BucketName }} variable will be replaced by the bucket name.

Zerops creates one bucket automatically for each new Object storage service.

Note

Each Object storage service can only contain one bucket. If your application needs multiple buckets, add more Object storage services.

Bucket will be created with a name based on the given service name and a random prefix. The name of the bucket cannot be changed later.

Create a project based on the description.yml​

When you have your description.yml ready, use the zcli project project-import command to create a new project and the service infrastructure.

Usage:
zcli project project-import importYamlPath [flags]

Flags:
-h, --help the project import command.
--orgId string If you have access to more than one organization, you must specify the org ID for which the
project is to be created.
--workingDie string Sets a custom working directory. Default working directory is the current directory. (default "./")

Zerops will create a project and one or more services based on the description.yml content.

Maximum size of the description.yml file is 100 kB.

You don't specify the project name in the zcli project project-import command, because the project name is defined in the description.yml.

If you have access to more than one client, you must specify the client ID for which the project is to be created. The clientID is located in the Zerops GUI under the client name on the project dashboard page.

image

Add Object service to an existing project​

Create a directory my-project if it doesn't exist. Create an import.yml file inside the my-project directory with following content:

# array of project services
services:
- # service name
hostname: upload

# service type
type: objectstorage

# Object storage size in GB
objectStorageSize: 73

# Choose object storage policy from a predefined list
objectStoragePolicy: public-write

# Or define a custom policy
objectStorageRawPolicy:

The yaml file describes the list of one or more services that you want to add to your existing project. In the example above, one Object storage service named upload will be created. The bucket quota will be set to 73 GB and the bucket access policy will be set to public-write.

The content of the services: section of import.yml is identical to the [project description file]. The import.yml never contains the project: section because the project already exists.

When you have your import.yml ready, use the zcli project service-import command to add one or more services to your existing Zerops project.

Usage:
zcli project service-import importYamlPath [flags]

Flags:
-h, --help the project service import command.
--projectId string If you have access to more than one project, you must specify the project ID for which the
command is to be executed.

zCLI commands are interactive, when you press enter after zcli project service-import importYamlPath, you will be given a list of your projects to choose from.

Maximum size of the import.yml file is 100 kB.

Example​

Create a directory my-project if it doesn't exist. Create an import.yml file inside the my-project directory with following content:

# array of project services
services:
-
# service name
hostname: storage
# service type
type: objectstorage

The yaml file describes the list of one or more services that you want to add to your existing project. In the example above, one Object storage service in the single container mode with default auto scaling configuration will be added to your project. Hostname of the new service will be set to storage.

The content of the services: section of import.yml is identical to the project description file. The import.yml never contains the project: section because the project already exists.