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)
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.
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:
Template | Description |
---|---|
Public read | Allows anyone:
|
Public objects read | Allows anyone:
|
Public read write | Allows anyone:
|
Public write | Allows anyone to create objects in the bucket (PutObject action) |
Private | Denies 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}}/*'],
},
],
}
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.
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:
- Install & setup zCLI
- Create a project description file
- 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.
Parameter | Description | Limitations |
---|---|---|
name | The name of the new project. Duplicates are allowed. | Maximum 255 characters |
description | Optional. Description of the new project. | |
tags | Optional. 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.
Parameter | Description |
---|---|
hostname | The unique service identifier. The name of the new Object storage will be set to the hostname value. Limitations:
|
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:
|
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.
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.
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:
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.
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:
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.