noobaa

NooBaa is a highly customizable and dynamic data gateway for Kubernetes (S3-compatible)

View on GitHub

Standalone noobaa-core

noobaa-core provides a standalone program that packages multiple core commands. Each command exposes a different core capability from the project. This form of packaging is meant for portability and ease of use during dev/test. Perhaps in the future this will become useful for deploying data services in production too.

Contents:

Build from source

Requirements:

Build commands:

npm install
npm run build:native
npm run build:core

Outputs:

Notes:

Examples:

Start the standalone nsfs program exposing a folder from the filesystem:

noobaa-core nsfs .

Then use S3 http access to the standalone endpoint (no authentication is needed).

List buckets (dirs under .)

curl -s 'http://localhost:6001'

Get object (read file)

$ curl -s 'http://localhost:6001/src/core/index.js' | head -1
/* Copyright (C) 2020 NooBaa */

Put object (write file)

$ echo "world" | curl -X PUT -d @- 'http://localhost:6001/src/hello'
$ cat src/hello
world
$ curl -X DELETE 'http://localhost:6001/src/hello'

List objects from the “src” dir with a prefix “core/”

$ curl -s 'http://localhost:6001/src?delimiter=/&prefix=core/' | xmllint --format -
<?xml version="1.0" encoding="UTF-8"?>
<ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
  <Name>src</Name>
  <Prefix>core/</Prefix>
  <Delimiter>/</Delimiter>
  <MaxKeys>1000</MaxKeys>
  <IsTruncated>false</IsTruncated>
  <Contents>
    <Key>core/index.js</Key>
    <LastModified>2021-01-19T10:50:11.000Z</LastModified>
    <ETag>"inode-77401967-mtime-1611053411748.1716"</ETag>
    <Size>1477</Size>
    <Owner>
      <ID>123</ID>
      <DisplayName>NooBaa</DisplayName>
    </Owner>
    <StorageClass>STANDARD</StorageClass>
  </Contents>
  <Contents>
    <Key>core/nscache.js</Key>
    <LastModified>2021-01-19T10:50:11.000Z</LastModified>
    <ETag>"inode-77401968-mtime-1611053411749.4114"</ETag>
    <Size>3974</Size>
    <Owner>
      <ID>123</ID>
      <DisplayName>NooBaa</DisplayName>
    </Owner>
    <StorageClass>STANDARD</StorageClass>
  </Contents>
  <Contents>
    <Key>core/nsfs.js</Key>
    <LastModified>2021-01-19T10:50:11.000Z</LastModified>
    <ETag>"inode-77401969-mtime-1611053411750.2307"</ETag>
    <Size>3976</Size>
    <Owner>
      <ID>123</ID>
      <DisplayName>NooBaa</DisplayName>
    </Owner>
    <StorageClass>STANDARD</StorageClass>
  </Contents>
</ListBucketResult>