Skip to content

Latest commit

 

History

History
90 lines (65 loc) · 2.21 KB

README.md

File metadata and controls

90 lines (65 loc) · 2.21 KB

Rafter

Overview

This example illustrates how to use Rafter to store static webpages.

By default, MinIO stores all resources on a cluster, but it also allows you to use different cloud providers. Read Rafter tutorials for more information.

Prerequisites

Installation

  1. Export a GitHub webpage URL of a ready-to-use webpage sources.

    Example:

    export GH_WEBPAGE_URL=https://github.com/kyma-project/examples/archive/master.zip
  2. Apply a Bucket custom resource (CR):

    cat <<EOF | kubectl apply -f -
    apiVersion: rafter.kyma-project.io/v1beta1
    kind: Bucket
    metadata:
      name: pages
      namespace: default
    spec:
      region: "us-east-1"
      policy: readonly
    EOF
  3. Apply an Asset CR:

    cat <<EOF | kubectl apply -f -
    apiVersion: rafter.kyma-project.io/v1beta1
    kind: Asset
    metadata:
      name: webpage
      namespace: default
    spec:
      source:
        url: ${GH_WEBPAGE_URL}
        mode: package
        filter: /rafter/webpage/
      bucketRef:
        name: pages
    EOF
  4. Check the value of the phase field:

    kubectl get assets.rafter.kyma-project.io webpage -o jsonpath='{.status.phase}'

    You should get a result exactly like this one:

    Ready
    

    Note: If the state is Pending, wait for a few seconds and try again.

  5. Export and merge the values of the baseUrl field and the path to the index.html file from the Asset CR, and then open it in a default web browser:

    open $(kubectl get assets.rafter.kyma-project.io webpage -o jsonpath='{.status.assetRef.baseUrl}{"/examples-master/rafter/webpage/index.html"}')

Cleanup

  1. Delete the Asset CR:

    kubectl delete assets.rafter.kyma-project.io webpage
  2. Delete the Bucket CR:

    kubectl delete buckets.rafter.kyma-project.io pages