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.
-
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
-
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
-
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
-
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. -
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"}')
-
Delete the Asset CR:
kubectl delete assets.rafter.kyma-project.io webpage
-
Delete the Bucket CR:
kubectl delete buckets.rafter.kyma-project.io pages