openresty-cos
Example OpenResty Docker/Kubernetes example to access and cache private elements in IBM Cloud Object Storage with AWS Signature Version 4 support
Prerequisites:
- Free or paid IBM Cloud Kubernetes Custer
- IBM Cloud Object Storage Instance with bucket and HMAC credentials https://console.bluemix.net/docs/services/cloud-object-storage/hmac/credentials.html#using-hmac-credentials
- s3cmd installed, separate configuration not needed, everything needed will be passed by 01_s3sync.sh script http://s3tools.org/s3cmd
- copy env.local.sample to env.local
- adjust settings in env.local to match your COS and Kubernetes Settings
- execute 01_s3sync this will copy the wwwroot example page to your bucket
- execute 02_buildimages.sh this will build the Docker image and push to IBM Cloud Container Registry Service
- execute 03_deploy.sh this will generate a deploy2kube.yaml
- kubect create -f deploy2kube.yaml
- curl -I http://YOURWORKERNODEIP:31200/index.html output will contain X-Cache: MISS
- run again curl -I http://YOURWORKERNODEIP:31200/index.html output will contain X-Cache: HIT
TODO:
- Build Helmchart
- Document example