Skip to content

Latest commit

 

History

History
79 lines (49 loc) · 2.1 KB

deployment_guide.md

File metadata and controls

79 lines (49 loc) · 2.1 KB

Kubernetes Deployment

Setting Up the Namespace

Our service is hosted within the image-service namespace on Kubernetes. Typically, you’ll be in your personal test namespace identified by your fedid. Switch to the image-service namespace using:

kubectl config set-context --current --namespace=image-service

Deployment Process

Ensure that all necessary YAML files are correctly applied. Start by deploying the sealed secret containing the NAS S3 credentials:

kubectl apply -f k8s/sealedthumbor-secret.yaml

If issues arise with the sealed secret, create and seal a new one by following the guidelines available in the Secrets Guide

Next, set up the persistent volume to store the image cache:

kubectl apply -f k8s/pv-pvc.yaml

Then, deploy the service and deployment configurations:

kubectl apply -f k8s/service.yaml

kubectl apply -f k8s/deployment.yaml

This deployment uses images from the Google Cloud Registry. Ensure you have the necessary permissions and settings configured as specified in the Container Registry guide.

Finally, apply the ingress to make the service accessible externally:

kubectl apply -f k8s/ingress.yaml

Managing Cache and Storage

There are two cron jobs: one purges the cache and the other manages storage deletion from the NAS S3 Bucket. These can be triggered through the Kubernetes dashboard, and the schedule configured through the respective YAML.

To deploy the Expired Image Deleter please apply the following yaml:

kubectl apply -f k8s/delete-expired.yaml

To view the cache, first find your pod:

kubectl get pods

Then, access the pod's shell:

kubectl exec -it <pod_name> -- /bin/bash

Find the cache directory:

find /data/thumbor/storage

To manage cache purging, clone the CronCachePurger repository and apply the relevant YAML:

git clone https://github.com/LambdaLightSource/CronCachePurger

kubectl apply -f cronjob.yaml