Change Bucket From MinIO to S3 Without Uninstalling Devtron

3 years ago   •   2 min read

By Shubham Kumar

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.

Spread the word

Keep reading