Skip to content

Allow to use an existing OBS with flexibleengine_cce_pvc resource #1065

@MrLuje

Description

@MrLuje

Hello

I want to create a k8s PVC binded to an OBS bucket with specific lifecycle, encryption, etc
With flexibleengine_cce_pvc, you can't specify an existing OBS nor lifecycle, etc

What I'm doing now is creating the flexibleengine_cce_pvc then import the OBS as a flexibleengine_obs_bucket resource then apply more modifications.

It would be better if I can create the flexibleengine_obs_bucket then use it as an existing OBS in flexibleengine_cce_pvc creation, like web console
image

Terraform Version

1.3.2

Affected Resource(s)

  • flexibleengine_cce_pvc
  • flexibleengine_obs_bucket

Terraform Configuration Files

# Create this
resource "flexibleengine_cce_pvc" "pvc" {
  cluster_id = var.cce.cluster_id
  namespace  = var.cce.namespace
  name       = var.cce.claim_name
  annotations = {
    "everest.io/obs-volume-type" = "STANDARD"
    "csi.storage.k8s.io/fstype"  = "s3fs"
  }
  storage_class_name = "csi-obs"
  access_modes       = ["ReadWriteMany"]
  storage            = var.default_size
}

# uncomment and import the generated OBS
# resource "flexibleengine_obs_bucket" "obs" {
#   bucket   = "pvc-${flexibleengine_cce_pvc.pvc.id}"

#   encryption = var.encryption.enabled
#   kms_key_id = var.encryption.kms_key_id

#   lifecycle_rule {
#     name    = "expiration"
#     enabled = true
#     expiration {
#       days = 7
#     }
#   }
# }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions