github.com/caos/orbos@v1.5.14-0.20221103111702-e6cd0cea7ad4/internal/operator/boom/application/applications/systemdmetricsexporter/yaml.go (about)

     1  package systemdmetricsexporter
     2  
     3  import (
     4  	"github.com/caos/orbos/internal/operator/boom/api/latest"
     5  	"github.com/caos/orbos/internal/operator/boom/application/applications/systemdmetricsexporter/yaml"
     6  	"github.com/caos/orbos/mntr"
     7  	"github.com/caos/orbos/pkg/kubernetes/k8s"
     8  	corev1 "k8s.io/api/core/v1"
     9  	"k8s.io/apimachinery/pkg/api/resource"
    10  )
    11  
    12  // var _ application.YAMLApplication = (*prometheusSystemdExporter)(nil)
    13  
    14  func (*prometheusSystemdExporter) GetYaml(_ mntr.Monitor, toolset *latest.ToolsetSpec) interface{} {
    15  
    16  	resources := &k8s.Resources{
    17  		Limits: corev1.ResourceList{
    18  			corev1.ResourceCPU:    resource.MustParse("100m"),
    19  			corev1.ResourceMemory: resource.MustParse("256Mi"),
    20  		},
    21  		Requests: corev1.ResourceList{
    22  			corev1.ResourceCPU:    resource.MustParse("50m"),
    23  			corev1.ResourceMemory: resource.MustParse("64Mi"),
    24  		},
    25  	}
    26  
    27  	spec := toolset.SystemdMetricsExporter
    28  	if spec == nil {
    29  		return yaml.Build(resources)
    30  	}
    31  
    32  	if spec.Resources != nil {
    33  		resources = spec.Resources
    34  	}
    35  
    36  	return yaml.Build(resources)
    37  }