k8s-pvc-tagger icon indicating copy to clipboard operation
k8s-pvc-tagger copied to clipboard

feat: --copy-labels and GCP support

Open joemiller opened this issue 1 year ago • 4 comments

This PR introduces two new features:

  1. Support for Google Cloud Platform (GCP). Set with -cloud gcp. AWS (-cloud aws) is the default if not specified.
  2. New -copy-labels flag. When used, this flag will copy the specified labels (optionally all labels with '*') from the PVC to the cloud disk volume.

GCP labels have a different set of constraints than k8s labels and AWS tags. The biggest difference is that . and / are not allowed, so a k8s label like app.kubernetes.io/name will be converted to app-kubernetes-io_name when applied to a GCP PD volume.

Also some small refactors:

  • Converted provisioner magic strings like ebs.csi.aws.com to constants like AWS_EBS_CSI
  • opportunistically converted some if/else blocks to switch statements

joemiller avatar May 17 '24 19:05 joemiller

Thanks for the contribution! I'm swamped this afternoon but I'll take a look this weekend.

mtougeron avatar May 17 '24 20:05 mtougeron

@mtougeron no problem at all. We realize it might be kind of a lot in a single PR.

still todo: I will try to update the readme soon with more info on the GCP iam that is needed.

EDIT: added GCP IAM info to readme and ./examples dir

joemiller avatar May 17 '24 21:05 joemiller

sorry, had some family issues come up over the weekend, nothing major, but it did keep me from being able to review this.

mtougeron avatar May 20 '24 21:05 mtougeron

@mtougeron I think I covered everything. LMK if there's more to address! tnx

joemiller avatar May 21 '24 13:05 joemiller

I cut the new image release but I got pulled into things today. I'll try and get the chart updates done during my lunch break as well but it might not be until tomorrow morning.

mtougeron avatar May 28 '24 20:05 mtougeron