Skip to content

Replace MinIO with Garage as S3-compatible storage backend#25

Open
RitikaSen27 wants to merge 15 commits into
52North:mainfrom
RitikaSen27:replace-minio-with-garage
Open

Replace MinIO with Garage as S3-compatible storage backend#25
RitikaSen27 wants to merge 15 commits into
52North:mainfrom
RitikaSen27:replace-minio-with-garage

Conversation

@RitikaSen27

Copy link
Copy Markdown

Summary

Replaced MinIO with Garage as the S3-compatible object storage backend due to MinIO’s shift towards paid AIStor offerings.

Changes

  • Removed MinIO Kubernetes configuration (minio.yaml)
  • Added Garage deployment configuration (garage.yaml)
  • Updated storage endpoint from MinIO (localhost:30090) to Garage (localhost:30091)
  • Ensured compatibility with existing S3-based operations (log uploads via boto3)

Details

  • Garage is used as a self-hosted, open-source, S3-compatible alternative
  • No changes were required in application logic since existing code uses standard S3 APIs
  • Environment variables were updated to point to the new Garage endpoint

Notes

  • Current Garage setup uses emptyDir (non-persistent storage), similar to previous MinIO setup
  • Bucket initialization is not yet automated and can be added in future improvements

Future Improvements

  • Add a Kubernetes job for automated bucket creation (similar to previous MinIO setup)
  • Introduce persistent storage instead of emptyDir
  • Add health checks and readiness probes for Garage deployment

@EHJ-52n

EHJ-52n commented Mar 30, 2026

Copy link
Copy Markdown
Member

Provide missing bucket initialization and health checks, or this PR will be deleted.

@RitikaSen27

Copy link
Copy Markdown
Author

Thanks for the feedback! I’ll add bucket initialization and health checks to the Garage setup and update the PR shortly.

@RitikaSen27

Copy link
Copy Markdown
Author

Thanks for the feedback! I’ve added bucket initialization and health checks to the Garage setup and updated the PR accordingly. Please let me know if anything else needs improvement.

@EHJ-52n

EHJ-52n commented Apr 9, 2026

Copy link
Copy Markdown
Member

Could you please ensure, that the functionality of the garage set-up is matching the one of minio, thank you.

Use the same ports on node level for garage, so for the user and documentation, nothing needs to be changed.

@RitikaSen27

RitikaSen27 commented Apr 12, 2026

Copy link
Copy Markdown
Author

Thanks for your suggestion regarding matching the MinIO ports.

I’ve addressed this in a separate PR to keep the changes focused and clean:
#30

This update aligns Garage with MinIO’s external ports (9000/9001 and corresponding nodePorts), so no changes are required for users or documentation.

Please let me know if any further adjustments are needed.

@EHJ-52n

EHJ-52n commented Apr 13, 2026

Copy link
Copy Markdown
Member

Please do not create a new PR requested updates. Just update this branch and the PR will be updated automatically.

@RitikaSen27

Copy link
Copy Markdown
Author

Thank you for the feedback!
I have updated this PR as requested .Please let me know if i should close the new PR that i created for this.

@EHJ-52n

EHJ-52n commented Apr 14, 2026

Copy link
Copy Markdown
Member

Could you please ensure, that the functionality of the garage set-up is matching the one of minio, thank you.

Use the same ports on node level for garage, so for the user and documentation, nothing needs to be changed.

I am missing the fulfilling of these two.

So, please

  • add code to initialize the required bucket.
  • ensure some T/WUI is available to check/see the content in the bucket.

@RitikaSen27

RitikaSen27 commented Apr 14, 2026

Copy link
Copy Markdown
Author

I will surely work on this but could you please explain a bit what is missing in the previous PR and what should i add there ?
I am not being able to understand it clearly as previously i did change the ports so now do i need to make garage behave exactly like MinIO?

@RitikaSen27

Copy link
Copy Markdown
Author

I’ve updated this PR to address the missing parts:

  • Added a bucket initialization job to ensure the required bucket is created automatically on startup
  • Exposed the Garage admin API via port 9001 (nodePort 30091) to allow inspection of bucket contents

Along with aligning the ports to match MinIO, this ensures that no changes are required for users or documentation.

Please let me know if this is okay or do i need to do something else on this.

@EHJ-52n

EHJ-52n commented Apr 17, 2026

Copy link
Copy Markdown
Member

Please reply to my questions from the review, thank you.

@RitikaSen27

Copy link
Copy Markdown
Author

Thanks for your review!

I’m currently not able to see the specific review comments or questions on this PR (in either the Conversation or Files changed tabs). Could you please point me to them or re-share them here?

I’ll address them right away.

@EHJ-52n

EHJ-52n commented Apr 20, 2026

Copy link
Copy Markdown
Member
image hope this helps.

@RitikaSen27

Copy link
Copy Markdown
Author

Review 1 -
Yes, the endpoint should remain unchanged to keep the replacement transparent.

I’ve ensured that the configuration uses the same endpoint as before, while the Garage service matches MinIO ports on the Kubernetes level.

@RitikaSen27

Copy link
Copy Markdown
Author

Review 2-
Yes, this change is unrelated to the MinIO replacement.I have a separate PR for this issue.

I’ve removed the delete_job implementation from this PR and will keep it in that separate PR dedicated to that functionality.

@RitikaSen27

Copy link
Copy Markdown
Author

Review 3-
You're right, these test changes are also related to the delete_job functionality.

I’ve removed them from this PR and will keep them only in the separate PR dedicated to that feature.

@RitikaSen27

Copy link
Copy Markdown
Author

Thank you for letting me the know the reviews. I have answered all of them and done the required changes. I hope this will be helpful.
Kindly let me know if something else needs to be done

@EHJ-52n

EHJ-52n commented Apr 24, 2026

Copy link
Copy Markdown
Member

@RitikaSen27 Thank you very much for the improvements. I added some new questions and I am looking forward to your responses!

@RitikaSen27

Copy link
Copy Markdown
Author

I apologise for the late response .

I’m still not able to see the new questions in the PR (I checked both the Conversation and Files changed tabs, including hidden/outdated comments). Could you please point me to them or re-share them?

I'll be working on them right away.

@EHJ-52n EHJ-52n left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dear @RitikaSen27,

I did not submit my review, hence you were not able to see my questions and comments.

Sorry for the delay.

Comment thread .vscode/launch.json Outdated
"PYGEOAPI_K8S_MANAGER_NAMESPACE": "default",
"PYGEOAPI_K8S_MANAGER_API_TOKEN": "do_not_use_in_production",
"PYGEOAPI_K8S_MANAGER_FINALIZER_BUCKET_ENDPOINT": "http://localhost:30090",
"PYGEOAPI_K8S_MANAGER_FINALIZER_BUCKET_ENDPOINT": "http://localhost:30091",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this changed?

Shouldn't the minio replacement happen under the hood, hence the endpoint for the manager is still the same?

Comment thread src/pygeoapi_k8s_manager/finalizer.py Outdated
jobs = k8s_batch_api.list_namespaced_job(self.namespace)
self.resource_version = jobs.metadata.resource_version
LOGGER.debug(f"resource_version received: '{self.resource_version}'.")
def delete_job(self, job_id: str, k8s_batch_api: BatchV1Api | None = None):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be part of the PR to replace minio AFAIK.

Comment thread tests/test_finalizer.py

mocked_get_logs_for_pod.assert_not_called()
mocked_upload_logs_to_s3.assert_not_called()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should not be part of the PR to replace minio.

Comment thread k8s-kind/garage.yaml Outdated
command: ["/bin/sh", "-c"]
args:
- |
sleep 10;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done sleep for a fixed amount of time, but check, if the service is available. See the removed minio init job for an example.

Comment thread k8s-kind/garage.yaml Outdated
sleep 10;
aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID;
aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY;
aws configure set default.region us-east-1;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why us-east-1? Can't this be left out or ignored, because it's not required at all?

Comment thread k8s-kind/garage.yaml Outdated
aws --endpoint-url=http://garage:9000 s3 mb s3://pygeoapi || true;
envFrom:
- secretRef:
name: garage-credentials No newline at end of file

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add empty line at EOF.

Comment thread tests/test_finalizer.py Outdated
import datetime
import os
from unittest.mock import MagicMock, patch
from unittest.mock import MagicMock, ANY

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this still here?

Comment thread src/pygeoapi_k8s_manager/finalizer.py Outdated
self.resource_version = jobs.metadata.resource_version
LOGGER.debug(f"resource_version received: '{self.resource_version}'.")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this still here?

Comment thread src/pygeoapi_k8s_manager/finalizer.py Outdated
V1Job,
V1Pod,
)
from tests.test_manager import job_id

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this still here?

@EHJ-52n

EHJ-52n commented Jun 10, 2026

Copy link
Copy Markdown
Member

@RitikaSen27 are you willing to update this PR as requested? Looking forward to your updates.

@RitikaSen27

Copy link
Copy Markdown
Author

Hi,

Thank you for following up. I appreciate the review and the detailed feedback.

Unfortunately, I am currently in the middle of my university examinations and won't be able to work on the requested changes for a few weeks. Given this, I understand if you prefer to close the PR for now.

Once my exams are over, I'd be happy to revisit the issue and submit a new PR that addresses all the review comments and project requirements.

Thank you for your time and feedback.

@RitikaSen27

Copy link
Copy Markdown
Author

Hi,

My exams are over now, thanks for waiting. I'll address all the open review comments and push the fixes to this branch shortly.

@RitikaSen27

Copy link
Copy Markdown
Author

Hi,

I've pushed updates addressing all the outstanding review comments:

  • Replaced the fixed sleep 10 in the Garage init job with a loop that checks if the service is actually available before proceeding
  • Removed the unnecessary aws configure set default.region us-east-1 line
  • Added the missing newline at the end of garage.yaml
  • Removed the leftover delete_job-related code in finalizer.py and test_finalizer.py (unused import and stray code)

All existing tests still pass. Please let me know if anything else needs adjusting.

Thanks again for your patience and the thorough review!

@EHJ-52n

EHJ-52n commented Jun 25, 2026

Copy link
Copy Markdown
Member
  • Please update the kind image to the latest version available for v1.33 and verify, if everything is working fine by providing the output of each command of the ./k8s-kind/README.md.

  • Fix the merge conflicts

  • Ensure this error is fixed, by testing your proposal:

    (⎈|kind-pygeoapi-k8s-manager:N/A)~/Code/pygeoapi_k8s-manager/k8s-kind 
    (RitikaSen27-replace-minio-with-garage|✚1) kubectl apply -k .
    
    error: accumulating resources: accumulation err='accumulating resources from 
    'minio.yaml': evalsymlink failure on '~/Code/pygeoapi_k8s-manager/k8s-kind/minio.yaml'
     : lstat ~/Code/pygeoapi_k8s-manager/k8s-kind/minio.yaml: no such file or directory': 
     must build at directory: not a valid directory: evalsymlink failure on 
     '~/Code/pygeoapi_k8s-manager/k8s-kind/minio.yaml' : lstat 
     ~/Code/pygeoapi_k8s-manager/k8s-kind/minio.yaml: no such file or directory
    

@RitikaSen27

Copy link
Copy Markdown
Author

Hi,

Pushed fixes for the latest review:

  • Resolved the merge conflict with upstream/main (tests/test_finalizer.py), all tests pass
  • Fixed kustomization.yaml to point at garage.yaml instead of the deleted minio.yaml — verified kubectl apply -k . now succeeds with no errors
  • Also fixed a leftover bug in manager.yaml where the bucket endpoint/credentials were still set to MinIO's values instead of Garage's
  • Bumped the kind node image to v1.33.12 (latest v1.33 patch)

Still working on full Garage bucket/key automation and the complete README verification with command output — will follow up with that shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants