Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to pass root key crn or support account_id in kms_config of ibm_container_vpc_cluster #4745

Open
Aashiq-J opened this issue Aug 9, 2023 · 7 comments
Labels
enhancement service/Kubernetes Service Issues related to Kubernetes Service Issues

Comments

@Aashiq-J
Copy link
Contributor

Aashiq-J commented Aug 9, 2023

Community Note

  • Please vote on this issue by adding a 馃憤 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

image

This is a feature request which is already available when deploying through UI.

https://registry.terraform.io/providers/IBM-Cloud/ibm/1.55.0/docs/resources/container_vpc_cluster#kms_config

According to the above terraform documentation, the only possible way to enable cluster encryption is by passing the instance_id and the key crk_id that means the kms has to be from the same account as the cluster. But from the UI we have two option either pass the instance and key details or pass the key crn.

We have a use case of using the a common kms in another account for all the encryption.

The boot volume encryption supports passing kms from another account using the kms_account_id variable.
https://registry.terraform.io/providers/IBM-Cloud/ibm/1.56.0/docs/resources/container_vpc_cluster#kms_account_id
We require a similar functionality for kms_config which is used for cluster encryption.

New or Affected Resource(s)

  • ibm_container_vpc_cluster

Potential Terraform Configuration

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key.

References

  • #0000
@ocofaigh
Copy link

@Aashiq-J Aashiq-J reopened this Aug 18, 2023
@ocofaigh
Copy link

NOTE:

The provider does support passing an account ID for the encryption of the worker nodes boot volumes:
image

HOWEVER, the IBM provider does not support passing an account ID in the cluster encryption block. It only supports:

  kms_config {
      instance_id = "12043812-757f-4e1e-8436-6af3245e6a69"
      crk_id = "0792853c-b9f9-4b35-9d9e-ffceab51d3c1"
      private_endpoint = false
  }

From the UI, all that is required is to pass the Key CRN, which can be from any account, so I'm guessing its parsing the account ID from that. The provider needs to support this too.

@Aashiq-J Aashiq-J changed the title Ability to pass root key crn to the ibm_container_vpc_cluster for kms_config and boot volume encryption Ability to pass root key crn or support account_id in kms_config of ibm_container_vpc_cluster Aug 18, 2023
@ocofaigh
Copy link

ocofaigh commented Aug 18, 2023

Looking at the api (https://cloud.ibm.com/apidocs/kubernetes/containers-v1-v2#createkmsconfig), it supports optionally passing accountID. So I think the change to the provider code should be straightforward. In resource_ibm_container_cluster.go update the ResourceIBMContainerCluster function to support optionally passing an account_id value in the kms_config map and then pass the value as part of the call to kmsAPI.EnableKms

@ocofaigh
Copy link

@hasan4791 Is this something you or your team could help with?

@ocofaigh
Copy link

Looks like the feature is in https://github.com/IBM-Cloud/terraform-provider-ibm/releases/tag/v1.60.0-beta1

@z0za
Copy link
Contributor

z0za commented Dec 4, 2023

@Aashiq-J the feature was released as part of https://github.com/IBM-Cloud/terraform-provider-ibm/releases/tag/v1.60.0

@ocofaigh
Copy link

ocofaigh commented Dec 5, 2023

Thanks, we are rolling it out to our module terraform-ibm-modules/terraform-ibm-base-ocp-vpc#301

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement service/Kubernetes Service Issues related to Kubernetes Service Issues
Projects
None yet
Development

No branches or pull requests

3 participants