Object Storage

Loki Operator supports AWS S3, Azure, GCS, Minio, OpenShift Data Foundation and Swift for LokiStack object storage.

AWS S3

Requirements

Installation

  • Deploy the Loki Operator to your cluster.

  • Create an Object Storage secret with keys as follows:

    kubectl create secret generic lokistack-dev-s3 \
      --from-literal=bucketnames="<BUCKET_NAME>" \
      --from-literal=endpoint="<AWS_BUCKET_ENDPOINT>" \
      --from-literal=access_key_id="<AWS_ACCESS_KEY_ID>" \
      --from-literal=access_key_secret="<AWS_ACCESS_KEY_SECRET>" \
      --from-literal=region="<AWS_REGION_YOUR_BUCKET_LIVES_IN>"
    

    where lokistack-dev-s3 is the secret name.

  • Create an instance of LokiStack by referencing the secret name and type as s3:

    spec:
      storage:
        secret:
          name: lokistack-dev-s3
          type: s3
    

Azure

Requirements

Installation

  • Deploy the Loki Operator to your cluster.

  • Create an Object Storage secret with keys as follows:

    kubectl create secret generic lokistack-dev-azure \
      --from-literal=container="<AZURE_CONTAINER_NAME>" \
      --from-literal=environment="<AZURE_ENVIRONMENTs>" \
      --from-literal=account_name="<AZURE_ACCOUNT_NAME>" \
      --from-literal=account_key="<AZURE_ACCOUNT_KEY>"
    

    where lokistack-dev-azure is the secret name.

  • Create an instance of LokiStack by referencing the secret name and type as azure:

    spec:
      storage:
        secret:
          name: lokistack-dev-azure
          type: azure
    

Google Cloud Storage

Requirements

  • Create a project on Google Cloud Platform.
  • Create a bucket under same project.
  • Create a service account under same project for GCP authentication.

Installation

  • Deploy the Loki Operator to your cluster.

  • Copy the service account credentials received from GCP into a file name key.json.

  • Create an Object Storage secret with keys bucketname and key.json as follows:

    kubectl create secret generic lokistack-dev-gcs \
      --from-literal=bucketname="<BUCKET_NAME>" \
      --from-file=key.json="<PATH/TO/KEY.JSON>"
    

    where lokistack-dev-gcs is the secret name, <BUCKET_NAME> is the name of bucket created in requirements step and <PATH/TO/KEY.JSON> is the file path where the key.json was copied to.

  • Create an instance of LokiStack by referencing the secret name and type as gcs:

    spec:
      storage:
        secret:
          name: lokistack-dev-gcs
          type: gcs
    

Minio

Requirements

Installation

  • Deploy the Loki Operator to your cluster.

  • Create an Object Storage secret with keys as follows:

    kubectl create secret generic lokistack-dev-minio \
      --from-literal=bucketname="<BUCKET_NAME>" \
      --from-literal=endpoint="<MINIO_BUCKET_ENDPOINT>" \
      --from-literal=access_key_id="<MINIO_ACCESS_KEY_ID>" \
      --from-literal=access_key_secret="<MINIO_ACCESS_KEY_SECRET>"
    

    where lokistack-dev-minio is the secret name.

  • Create an instance of LokiStack by referencing the secret name and type as s3:

    spec:
      storage:
        secret:
          name: lokistack-dev-minio
          type: s3
    

OpenShift Data Foundation

Requirements

Installation

  • Deploy the Loki Operator to your cluster.

  • Create an Object Storage secret with keys as follows:

    kubectl create secret generic lokistack-dev-odf \
      --from-literal=bucketname="<BUCKET_NAME>" \
      --from-literal=endpoint="https://s3.openshift-storage.svc" \
      --from-literal=access_key_id="<ACCESS_KEY_ID>" \
      --from-literal=access_key_secret="<ACCESS_KEY_SECRET>"
    

    where lokistack-dev-odf is the secret name. You can copy the values for BUCKET_NAME, ACCESS_KEY_ID and ACCESS_KEY_SECRET from your ObjectBucketClaim’s accompanied secret.

  • Create an instance of LokiStack by referencing the secret name and type as s3:

    spec:
      storage:
        secret:
          name: lokistack-dev-odf
          type: s3
    

Swift

Requirements

Installation

  • Deploy the Loki Operator to your cluster.

  • Create an Object Storage secret with keys as follows:

    kubectl create secret generic lokistack-dev-swift \
      --from-literal=auth_url="<SWIFT_AUTH_URL>" \
      --from-literal=username="<SWIFT_USERNAMEClaim>" \
      --from-literal=user_domain_name="<SWIFT_USER_DOMAIN_NAME>" \
      --from-literal=user_domain_id="<SWIFT_USER_DOMAIN_ID>" \
      --from-literal=user_id="<SWIFT_USER_ID>" \
      --from-literal=password="<SWIFT_PASSWORD>" \
      --from-literal=domain_id="<SWIFT_DOMAIN_ID>" \
      --from-literal=domain_name="<SWIFT_DOMAIN_NAME>" \
      --from-literal=container_name="<SWIFT_CONTAINER_NAME>" \
    

    where lokistack-dev-swift is the secret name.

  • Optionally you can provide project specific data and/or a region as follows:

    kubectl create secret generic lokistack-dev-swift \
      --from-literal=auth_url="<SWIFT_AUTH_URL>" \
      --from-literal=username="<SWIFT_USERNAMEClaim>" \
      --from-literal=user_domain_name="<SWIFT_USER_DOMAIN_NAME>" \
      --from-literal=user_domain_id="<SWIFT_USER_DOMAIN_ID>" \
      --from-literal=user_id="<SWIFT_USER_ID>" \
      --from-literal=password="<SWIFT_PASSWORD>" \
      --from-literal=domain_id="<SWIFT_DOMAIN_ID>" \
      --from-literal=domain_name="<SWIFT_DOMAIN_NAME>" \
      --from-literal=container_name="<SWIFT_CONTAINER_NAME>" \
      --from-literal=project_id="<SWIFT_PROJECT_ID>" \
      --from-literal=project_name="<SWIFT_PROJECT_NAME>" \
      --from-literal=project_domain_id="<SWIFT_PROJECT_DOMAIN_ID>" \
      --from-literal=project_domain_name="<SWIFT_PROJECT_DOMAIN_name>" \
      --from-literal=region="<SWIFT_REGION>" \
    
  • Create an instance of LokiStack by referencing the secret name and type as swift:

    spec:
      storage:
        secret:
          name: lokistack-dev-swift
          type: swift