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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Have labels on GCP Disks and Snapshots #10612

Closed
Tracked by #7901
jenting opened this issue Jun 13, 2022 · 19 comments
Closed
Tracked by #7901

Have labels on GCP Disks and Snapshots #10612

jenting opened this issue Jun 13, 2022 · 19 comments
Assignees
Labels
team: workspace Issue belongs to the Workspace team

Comments

@jenting
Copy link
Contributor

jenting commented Jun 13, 2022

Is your feature request related to a problem? Please describe

We need to add labels to GCP Disks and Snapshots because we use labels to filter the cost.

Describe the behaviour you'd like

Make the GCP Disks and Snapshots have labels so we are able to filter the cost.

Describe alternatives you've considered

N/A

Additional context

#10186 (comment)

#7901

@jenting jenting added the team: workspace Issue belongs to the Workspace team label Jun 13, 2022
@sagor999 sagor999 self-assigned this Jun 23, 2022
@sagor999 sagor999 moved this to In Progress in 🌌 Workspace Team Jun 23, 2022
@sagor999
Copy link
Contributor

Spent some time researching how to do that and have a plan now.
There is already support for adding labels to disk via adding a parameter to storage class like so:

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: csi-gce-pd
provisioner: pd.csi.storage.gke.io
parameters:
  type: pd-balanced
  replication-type: none
  labels: cluster=preview,region=us

So for disks we can implement this by using this param and creating a storage class for each workspace class. Since each workspace class can specify its own storage class, it should work just fine.

There is no such support for VolumeSnapshotClass though, but it should not be too difficult to add support for it in gce-csi driver, so going to do that next.

@sagor999
Copy link
Contributor

Upstream PR: kubernetes-sigs/gcp-compute-persistent-disk-csi-driver#1017

@jenting
Copy link
Contributor Author

jenting commented Jul 27, 2022

Upstream PR: kubernetes-sigs/gcp-compute-persistent-disk-csi-driver#1017

Code merged, waits for the next release 🚀

@sagor999 sagor999 moved this from In Progress to Backlog in 🌌 Workspace Team Aug 1, 2022
@kylos101 kylos101 moved this from Breakdown to Scheduled in 🌌 Workspace Team Aug 8, 2022
@jenting
Copy link
Contributor Author

jenting commented Aug 25, 2022

It's good to add the cluster name to the label, so we can easily file the cluster by the label on the GCP console.

@sagor999 sagor999 moved this from Scheduled to In Progress in 🌌 Workspace Team Aug 25, 2022
@sagor999
Copy link
Contributor

This PR enables labels on disks.
Once upstream will release new gsi driver containing my fix for allowing to add labels to snapshot classes, we will do the same for snapshots. Until then I will add blocked label.

@sagor999 sagor999 moved this from In Progress to Scheduled in 🌌 Workspace Team Aug 26, 2022
@sagor999 sagor999 removed their assignment Aug 26, 2022
@kylos101
Copy link
Contributor

kylos101 commented Sep 7, 2022

@sagor999 is there an ETA for upstream to release new driver?

@sagor999
Copy link
Contributor

sagor999 commented Sep 7, 2022

Not as far as I know... :( Just have to wait, or we can build it ourselves and use our own version until then.

@kylos101
Copy link
Contributor

kylos101 commented Sep 9, 2022

@sagor999 is there a PR for which we can inquire about the release? I ask because I think @jenting did similar last time...and then the release was cut rather quickly. 🙏

@jenting
Copy link
Contributor Author

jenting commented Sep 9, 2022

@sagor999 is there a PR for which we can inquire about the release? I ask because I think @jenting did similar last time...and then the release was cut rather quickly. 🙏

kubernetes-sigs/gcp-compute-persistent-disk-csi-driver#1017 (comment)

@kylos101
Copy link
Contributor

Hi @jenting what release cycle do they generally follow, can you share a link? If none, can you reach out to Matt again?

@jenting
Copy link
Contributor Author

jenting commented Sep 28, 2022

Hi @jenting what release cycle do they generally follow, can you share a link? If none, can you reach out to Matt again?

v1.8.0-rc1 release
We could tried it at ephemeral cluster or workspace preview now 🚀

@jenting
Copy link
Contributor Author

jenting commented Sep 29, 2022

@sagor999 I have a question, if we would want to add custom labels to VolumeSnapshot, should we use the v1.8.0 release release?
Because I want to delete the VolumeSnapshot by labeling so we can remove the snapshots generated by the ephemeral cluster.

@sagor999
Copy link
Contributor

Yeah, that is the only way or build our own version of it that has that commit.
It will also require creating separate snapshot classes, similar to how I did with storageClasses (as label is specified there).

@jenting
Copy link
Contributor Author

jenting commented Sep 29, 2022

It will also require creating separate snapshot classes, similar to how I did with storageClasses (as label is specified there).

If I understand correctly, creating separate volume snapshot classes with different labels.
The volume snapshot and volume snapshot content will inherit the labels from volume snapshot classes, correct?

@sagor999
Copy link
Contributor

yup!

@jenting
Copy link
Contributor Author

jenting commented Sep 29, 2022

Yeah, that is the only way or build our own version of it that has that commit. It will also require creating separate snapshot classes, similar to how I did with storageClasses (as label is specified there).

I built it jenting/gcp-compute-persistent-disk-csi-driver:v1.8.0-rc1_linux_amd64, and I will try it tomorrow.

@sagor999
Copy link
Contributor

@jenting probably no need to build you own version of it anymore: https://github.com/kubernetes-sigs/gcp-compute-persistent-disk-csi-driver/releases/tag/v1.8.0

@jenting
Copy link
Contributor Author

jenting commented Sep 30, 2022

@jenting probably no need to build you own version of it anymore: https://github.com/kubernetes-sigs/gcp-compute-persistent-disk-csi-driver/releases/tag/v1.8.0

The container image does not released 😢
kubernetes-sigs/gcp-compute-persistent-disk-csi-driver#1056

@jenting
Copy link
Contributor Author

jenting commented Sep 30, 2022

I build our own jenting/gcp-compute-persistent-disk-csi-driver:v1.8.0

@jenting jenting self-assigned this Sep 30, 2022
@jenting jenting moved this from Scheduled to In Progress in 🌌 Workspace Team Sep 30, 2022
@jenting jenting removed the blocked label Sep 30, 2022
@jenting jenting closed this as completed Oct 3, 2022
Repository owner moved this from In Progress to Awaiting Deployment in 🌌 Workspace Team Oct 3, 2022
@kylos101 kylos101 moved this from Awaiting Deployment to In Validation in 🌌 Workspace Team Oct 5, 2022
@jenting jenting moved this from In Validation to Done in 🌌 Workspace Team Oct 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team: workspace Issue belongs to the Workspace team
Projects
No open projects
Status: Done
Development

No branches or pull requests

3 participants