DrFaust92 / terraform-kubernetes-ebs-csi-driver

Terraform module which creates Kubernetes EBS CSI controller resources on AWS EKS.
https://registry.terraform.io/modules/DrFaust92/ebs-csi-driver/kubernetes/latest
Other
31 stars 26 forks source link

Is this project still alive? How can one migrate to the (now) official ebs addon? #119

Open albertmatyi opened 2 months ago

albertmatyi commented 2 months ago

I am using the following configuration applied via terraform:

module "ebs_csi_driver_controller" {
  source = "DrFaust92/ebs-csi-driver/kubernetes"
  version = "3.10.0"

  # data.aws_iam_openid_connect_provider.eks_oidc.url
  oidc_url                                   = module.eks.cluster_oidc_issuer_url

  # Optional
  ebs_csi_controller_role_name               = "ebs-csi-driver-controller"
  ebs_csi_controller_role_policy_name_prefix = "ebs-csi-driver-policy"
  default_fstype    = "ext4"
  enable_volume_resizing    = true
  # this would need snapshotting plugin to be installed
  enable_volume_snapshot    = false
  # tag ebs volumes w cluster name
  eks_cluster_id    = module.eks.cluster_name
  extra_create_metadata = true
  tags = {
    # this tag on EBS enables autobackup via due to Data Lifecycle Management from dlm.tf
    Snapshot = "true"
  }
}

How can one migrate to the official plugin and still maintain currently created ebs volumes/tags/etc. ?

module "eks" {
[...]
  cluster_addons = {
    [...]
    aws-ebs-csi-driver = { 
        most_recent = true 
        [... what options do I need to make it compatible with current installation/not to break existing ebs volumes/attachments]
    }
myedes-boku commented 2 hours ago

I have just performed the migration today and it was pretty straightforward. Since this module is installing the official aws-ebs-csi-driver, this uninstall section applies here as well. You just need to use terraform to destroy the installed EBS CSI driver and any dependencies this module created. After that, you just need to install the EKS addon. Just keep in mind that during the time window between the deletion of this module, and the installation of the EKS addon, it will not be possible to create new PVC or attach any volumes to new pods. I can confirm that the existing PVCs and PVs were not affected by the migration.