Coder Social home page Coder Social logo

hansemerkur / rgwoperator Goto Github PK

View Code? Open in Web Editor NEW
1.0 4.0 2.0 28 KB

Operator for managing S3 resources on a Ceph RadosGW installation via Kubernetes Custom Resources

License: Apache License 2.0

Dockerfile 1.17% Mustache 6.18% Python 92.65%
ceph kubernetes radosgw s3

rgwoperator's Introduction

rgw-operator

Operator for managing S3 resources on a Ceph RadosGW installation via Kubernetes Custom Resources.

Operator RGW User

Creating an initial S3 user on the Ceph RadosGW, which will be used to create all resources via the operator.

$ radosgw-admin user create --uid=operator --display-name="Kubernetes Operator" --gen-access-keys
$ radosgw-admin --id admin caps add --caps="buckets=*;users=*;usage=*;metadata=*" --uid=operator

Ceph User

New RadosGW users, which will be used to logicially separate entities, can be created via the following CRD:

apiVersion: s3.hanse-merkur.de/v1alpha1
kind: User
metadata:
  name: operator-test
  annotations:
    # The `allow-deletion` annotation enables the actual deletion of the Ceph User, aside from the resource itself
    s3.hanse-merkur.de/allow-deletion: "true"
    # `allow-import` allows the import of existing Ceph users under the management of the resource
    s3.hanse-merkur.de/allow-import: "true"
    # `skip-tenant` unsets the operator configured tenant as prefix for the Ceph user
    s3.hanse-merkur.de/skip-tenant: "true"
spec:
  # Unless `skip-tenant` is set the user will be named <tenant>-<userId>
  userId: operator-test
  # Free form text field for contact information
  contactName: Operator Test
  # Enable quotas for the user globally. Applied to all buckets
  quotas:
    enabled: true
    maxObjects: 1000000
    maxSize: 1024000
    maxBuckets: 10

Created Ceph users have to be unique, if using the tenant unique to the operator installation.

Access Keys

Access Keys allow the access to the Bucket and other S3 functionality. The resource, unlike the User, is namespaced as it can access a Secret containing the access and secret keys. Access Keys are unique and can be auto-generated or use existing Kubernetes secrets.

apiVersion: s3.hanse-merkur.de/v1alpha1
kind: AccessKey
metadata:
  name: operator-test
  namespace: default
spec:
  # References the User resource created by the previous YAML
  owner: operator-test
  # Free form text field for general descriptions
  description: Access key for operator-test
  # Name of the secret created or existing in the same namespace as the AccessKey resource
  secretName: operator-test
  # Using jinja2 the resoluting secret can optionally be modified to be application specific as seen in this example
  template:
    metadata:
      labels:
        hansemerkur.de/owned-by: some-group
      annotations:
        hansemerkur.de/cleanup: none
    data:
      credentials: |
        [default]
        aws_secret_key_id={{ data.aws_access_key_id }}
        aws_secret_access_key={{ data.aws_secret_access_key }}

Buckets

Buckets are namespaced resources and use the implied AccessKey to create and update the Bucket in Ceph.

apiVersion: s3.hanse-merkur.de/v1alpha1
kind: Bucket
metadata:
  name: operator-test
  namespace: default
  annotations:
    # The `allow-deletion` annotation enables the actual deletion of the Ceph Bucket, aside from the resource itself
    s3.hanse-merkur.de/allow-deletion: "true"
    # Without the `force-deletion` annotation the bucket will never be deleted as long as it still contains objects
    s3.hanse-merkur.de/force-deletion: "true"
    # `allow-import` allows the import of an existing bucket under the management of the resource
    s3.hanse-merkur.de/allow-import: "true"
spec:
  bucketName: operator-test
  # References the previously created AccessKey
  ownerAccessKey: operator-test
  # A selection of private, public or custom bucket policy. In case of custom the customBucketPolicy field is expected
  bucketPolicy: private
  # Optional standard AWS bucket policy format in JSON
  #customBucketPolicy: "{}"
  # Optional AWS Lifecycle Policy in JSON format
  lifeCyclePolicy: |
    {
      "Rules": [
        {
          "Status": "Enabled",
          "Expiration": {
            "Days": 31
          },
          "ID": "ExpireSnapshots"
        }
      ]
    }
  # Optional bucket quotas
  quotas:
    enabled: true
    maxObjects: 100000
    maxSize: 102400

Software Frameworks used

rgwoperator's People

Contributors

ro-hm avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

ro-hm devsecteam

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.