jodevsa/wireguard-operator

Wireguard CRD does not provide a way to set resources

winston0410 opened this issue · 6 comments

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

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

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

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

Hey, yes exactly that

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

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.

@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