Change Bucket From MinIO to S3 Without Uninstalling Devtron

Table of contents

Devtron is a web based CI/CD orchestrator for Kubernetes. It integrates Ftimevarious open source tools to provide an AppOps solution, that includes Security Scanning, GitOps based deployments, Access Control, Debugging, Observability and a lot more features.

When we install Devtron with default settings using kubectl, it uses MinIO bucket as object storage. What about if we installed Devtron with MinIO and afterward wants to use S3 instead of MinIO? How can we achieve that? In this case, one approach would be to uninstall Devtron and reinstall with AWS S3 bucket. But it would be a time-consuming and inefficient way.

In this blog we will see how we can achieve the same thing without uninstalling Devtron and migrating the bucket from MinIO to AWS S3 bucket.

To perform this task, there are two prerequisites -

  • Devtron should be installed (Devtron installation)
  • Must have access to S3 on node where devtron has been installed.

The first thing we need to do is, edit the configmap devtron-cm present in devtroncd namespace. For doing this, execute the command -

kubectl edit cm devtron-cm -n devtroncd

In this configmap, we need to make some changes -

  1. BLOB_STORAGE_PROVIDER : S3
  2. DEFAULT_BUILD_LOGS_BUCKET : <Bucket_Name>
  3. DEFAULT_CACHE_BUCKET : <Bucket_Name>
  4. DEFAULT_CD_LOGS_BUCKET_REGION : <Bucket-Region>
  5. DEFAULT_CACHE_BUCKET_REGION : <Bucket_Region>

Note: Make sure that the region should be where you have created your bucket.

After doing these changes in devtron-cm configmap, we also need to do some changes in workflow-controller-configmap which is present in argo namespace. Execute the following command to achieve this -

kubectl edit cm workflow-controller-configmap -n argo

Update the values of .data.config.artifactRepository.s3 of workflow-controller-configmap with the following values -

s3:
  endpoint: s3.amazonaws.com
  bucket: <BUCKET_NAME>
  region: <AWS_REGION>
  keyFormat: devtron/{{workflow.name}}

In the s3 section, pass the name of the AWS S3 bucket in the ‘bucket’ field. Pass s3.amazonaws.com in the endpoint and in the region field pass the AWS region in which S3 bucket is present.

Now all the settings are done and we just have to delete the Devtron pod present in devtroncd namespace.

kubectl delete pod -l app=devtron -n devtroncd

And also delete the workflow-controller pod present in the argo namespace.

kubectl delete pod -l app=workflow-controller -n argo

And it's done. Now the object storage is changed from MinIO to AWS S3 without uninstalling Devtron. But since we will now use S3 bucket so MinIO bucket is not being used anymore. So we can scale down MinIo to zero by executing command :

kubectl -ndevtroncd patch sts devtron-minio --type=json -p='[{"op": "add", "path": "/spec/replicas" , "value": 0 }]'

Congratulations 🎊 With these simple steps you can easily change your object storage from MinIO to S3 without uninstalling whole Devtron stack. To know more about the open source project feel free to join our community discord server.

FAQ

How do I switch from MinIO to AWS S3 in Devtron without uninstalling it?

You can switch from MinIO to AWS S3 in Devtron by editing the devtron-cm and workflow-controller-configmap configmaps to update the storage settings. After making the changes, simply restart the Devtron and workflow-controller pods. This avoids the need to uninstall and reinstall Devtron.

What configurations need to be changed to use S3 with Devtron?

You need to update the devtron-cm configmap in the devtroncd namespace with S3 bucket details and set BLOB_STORAGE_PROVIDER to S3. Additionally, update the S3 configuration in workflow-controller-configmap in the argo namespace with your AWS endpoint, bucket name, and region.

Is it safe to delete MinIO after migrating Devtron to AWS S3?

Yes, once Devtron is fully using AWS S3 for object storage, you can safely scale down the MinIO StatefulSet to zero replicas using a patch command. This helps save resources since MinIO is no longer in use.

Do I need to reinstall Devtron to change its object storage from MinIO to S3?

No, you don't need to reinstall Devtron. By editing the relevant configmaps and restarting the necessary pods, you can migrate from MinIO to AWS S3 seamlessly without downtime or redeployment.

Related articles