cluster-api-provider-aws icon indicating copy to clipboard operation
cluster-api-provider-aws copied to clipboard

Configurable garbage collection

Open richardcase opened this issue 3 years ago • 4 comments

/kind feature /help

Describe the solution you'd like As a follow-up to #3518 it would be good to allow users to configure the garbage collection. Specifically, it would be good to expose this configuration:

  • Selecting clusters where GC will be applied via label selectors on the Cluster.
  • Selecting which GC tasks will be done (i.e. services, pvc)

Anything else you would like to add: In my head i am thinking there is an option CRD or config map that if it exists it will contain this configuration. As an an example

kind: AWSGarbageCollectorConfig
spec:
  clusterSelector:
     matchLabels:
         mycompany/envtype: non-prod
  cleanupTasks:
     services: true
     pvc: false

Environment:

  • Cluster-api-provider-aws version:
  • Kubernetes version: (use kubectl version):
  • OS (e.g. from /etc/os-release):

richardcase avatar Jun 20 '22 15:06 richardcase

@richardcase: This request has been marked as needing help from a contributor.

Guidelines

Please ensure that the issue body includes answers to the following questions:

  • Why are we solving this issue?
  • To address this issue, are there any code changes? If there are code changes, what needs to be done in the code and what places can the assignee treat as reference points?
  • Does this issue have zero to low barrier of entry?
  • How can the assignee reach out to you for help?

For more details on the requirements of such an issue, please see here and ensure that they are met.

If this request no longer meets these requirements, the label can be removed by commenting with the /remove-help command.

In response to this:

/kind feature /help

Describe the solution you'd like As a follow-up to #3518 it would be good to allow users to configure the garbage collection. Specifically, it would be good to expose this configuration:

  • Selecting clusters where GC will be applied via label selectors on the Cluster.
  • Selecting which GC tasks will be done (i.e. services, pvc)

Anything else you would like to add: In my head i am thinking there is an option CRD or config map that if it exists it will contain this configuration. As an an example

kind: AWSGarbageCollectorConfig
spec:
 clusterSelector:
    matchLabels:
        mycompany/envtype: non-prod
 cleanupTasks:
    services: true
    pvc: false

Environment:

  • Cluster-api-provider-aws version:
  • Kubernetes version: (use kubectl version):
  • OS (e.g. from /etc/os-release):

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

k8s-ci-robot avatar Jun 20 '22 15:06 k8s-ci-robot

/priority important-longterm /triage accepted

richardcase avatar Jun 20 '22 15:06 richardcase

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Sep 18 '22 16:09 k8s-triage-robot

/remove-lifecycle stale

richardcase avatar Sep 20 '22 08:09 richardcase

The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle stale
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Feb 08 '23 04:02 k8s-triage-robot

/remove-lifecycle stale

richardcase avatar Feb 08 '23 11:02 richardcase

/assign @Atharva-Shinde

Ankitasw avatar Mar 24 '23 09:03 Ankitasw

/unassign Atharva-Shinde

richardcase avatar Jul 22 '23 05:07 richardcase

/help

richardcase avatar Jul 22 '23 05:07 richardcase

Discussed in today's office hours.

Selecting which GC tasks will be done (i.e. services, pvc)

This is not possible today, and so needs a solution. We agreed that we could address this using an annotation, and agreed to implement this.

Selecting clusters where GC will be applied via label selectors on the Cluster.

We considered two approaches: (1) a Custom Resource with a list of configurations, each configuration scoped to a set of clusters using selectors (2) a Custom Resource that holds exactly one configuration, and an AWSCluster.Spec.GCConfigurationRef field that refers to this Resource. If the Resource is mutable, changing it affects all referring clusters.

We also agreed that the "selecting clusters" problem is not urgent, and that it can be addressed by setting/updating annotations on many AWSCluster resources, even if that requires the user to do more work than updating one Custom Resource.

dlipovetsky avatar Aug 21 '23 17:08 dlipovetsky