This repository contains code for automating various preliminary steps on Garage deployed on a Kubernetes Cluster before you can use it through Garage's Administration APIs. These steps are:
- Node discovery and configuration for each of the nodes
- Creation of Buckets and Access Keys
- Access Keys to be saved as a Kubernetes Secret
- Permissions and accesses to be granted to the Access Keys
The following is required to start using this repository:
- Kubernetes Cluster - Any kubernetes cluster can do, tested out with my self hosted kubernetes cluster
- Garage - Any garage cluster can do, tested out with my garage module
- PNPM - default package manager for this project, documentation for the same is here
Step 1: Install all dependencies in the project using PNPM by running the command: pnpm i
Step 2: Setup a configuration file to be used to map out your garage installation, there is an example configuration file present in the repository which can be used as a reference
Step 3: Run the following commands to set up your environment variables prior to execution of the script
# EXPORT THE PATH WHERE THE CONFIGURATION FILE IS PRESENT
export CONFIGURATOR_JSON="path/to/configurator.json"
# GARAGE ADMIN TOKEN TO INTERACT WITH THE ADMINISTRATION API
export GARAGE_ADMIN_TOKEN="token"
# RUN IN A TEST CONTEXT RATHER IN CLUSTER CONTEXT, REQUIRED FOR KUBERNETES CLIENT AUTHENTICATION
export EXECUTION_MODE="testing"
# (OPTIONAL) IF YOUR GARAGE IS BEHIND A PROXY UTILIZING SELF SIGNED/CUSTOM CA
export NODE_EXTRA_CA_CERTS=ca.crtStep 4: Run the script by running the following command: pnpm run:dev