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

Update Sensor and EventSource CRDs to support Vertical Pod Autoscaler #3180

Open
fullykubed opened this issue Jun 24, 2024 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@fullykubed
Copy link

Is your feature request related to a problem? Please describe.

I want to use the Vertical Pod Autoscaler to automatically right-size the resource requests of pods created by the Sensor and EventSource CRs.

Describe the solution you'd like

Add scale.labelSelectorPath (docs) to CRDs to support the Vertical Pod Autoscaler's requirements when managing pods constrolled by a custom resource (docs).

Describe alternatives you've considered

None

Additional context

None


Message from the maintainers:

If you wish to see this enhancement implemented please add a 👍 reaction to this issue! We often sort issues this way to know what to prioritize.

@fullykubed fullykubed added the enhancement New feature or request label Jun 24, 2024
@fullykubed
Copy link
Author

For anyone stumbling on this with a similar goal, I was able to achieve autoscaling by augmenting the CRD manually:

apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: sensors.argoproj.io
spec:
  conversion:
    strategy: None
  group: argoproj.io
  names:
    kind: Sensor
    listKind: SensorList
    plural: sensors
    shortNames:
      - sn
    singular: sensor
  scope: Namespaced
  versions:
    - name: v1alpha1
      schema:
        openAPIV3Schema:
          properties:
            apiVersion:
              type: string
            kind:
              type: string
            metadata:
              type: object
            spec:
              type: object
              x-kubernetes-preserve-unknown-fields: true
              properties:
                replicas:
                  type: number
                labelSelector:
                  type: string
            status:
              type: object
              x-kubernetes-preserve-unknown-fields: true
          required:
            - metadata
            - spec
          type: object
      served: true
      storage: true
      subresources:
        status:
          properties:
            replicas:
              type: number
        scale:
          specReplicasPath: '.spec.replicas'
          statusReplicasPath: '.status.replicas'
          labelSelectorPath: '.spec.labelSelector'

Note the addition of the spec.labelSelector field which in an ideal world would be under status.labelSelector and populated by the events controller. However, for now, you can just manually specify it on the CR and the VPA will work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant