wireguard-operator icon indicating copy to clipboard operation
wireguard-operator copied to clipboard

Wireguard CRD does not provide a way to set resources

Open winston0410 opened this issue 1 year ago • 5 comments
trafficstars

Is your feature request related to a problem? Please describe. At the moment the Wireguard CRD does not allow passing resources configuration

Describe the solution you'd like I would like to see resources section being allowed for Wireguard CRD

Describe alternatives you've considered N/A, the aforementioned solution seems to be the most direct and effective

Additional context

winston0410 avatar Jul 01 '24 13:07 winston0410

Hey, can you ellaborate more what are the resources section about? Maybe you can provide an example?

jodevsa avatar Jul 01 '24 15:07 jodevsa

Ah I think you mean something to set pod cpu and memory resources?

jodevsa avatar Jul 01 '24 15:07 jodevsa

Ah I think you mean something to set pod cpu and memory resources?

Hey, yes exactly that

winston0410 avatar Jul 01 '24 18:07 winston0410

Thanks! Can you tell me more about the use case? did you notice that wireguard uses high cpu/memory or ?

jodevsa avatar Jul 01 '24 19:07 jodevsa

Sure, my use case is I want to limit resource used by every application in my cluster. Not that I notice wireguard using a lot at the moment, but just to prevent it from using excessive memory.

Another case that I can think of is, if we are able to set cpu/memory limit, I can get those metrics with kube-state-metrics from prometheus, and set a PrometheusRule to generate an alert when say it exceed 100% of the requested memory.

winston0410 avatar Jul 01 '24 20:07 winston0410

@jodevsa Would you like to see an API like this? This would allow user to customize resources for the metrics and the agent container:

---
apiVersion: vpn.wireguard-operator.io/v1alpha1
kind: Wireguard
metadata:
  name: vpn-gateway
  namespace: wireguard
spec:
  agent:
    resources:
      limits:
        cpu: xxx
        memory: xxx
      requests:
        cpu: xxx
        memory: xxx
  metrics:
    resources:
      limits:
        cpu: xxx
        memory: xxx
      requests:
        cpu: xxx
        memory: xxx

This pattern would allow our users passing arguments into each of those containers, even though I cannot think of anything that a user would need to pass at the moment, except the resources

winston0410 avatar Jul 04 '24 12:07 winston0410