utils

package
v0.0.0-...-1eec114 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 19, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ResourceRequirements = map[string]corev1.ResourceRequirements{
	"noobaa-core": {
		Requests: corev1.ResourceList{
			corev1.ResourceCPU:    resource.MustParse("1"),
			corev1.ResourceMemory: resource.MustParse("4Gi"),
		},
		Limits: corev1.ResourceList{
			corev1.ResourceCPU:    resource.MustParse("1"),
			corev1.ResourceMemory: resource.MustParse("4Gi"),
		},
	},
	"noobaa-db": {
		Requests: corev1.ResourceList{
			corev1.ResourceCPU:    resource.MustParse("500m"),
			corev1.ResourceMemory: resource.MustParse("4Gi"),
		},
		Limits: corev1.ResourceList{
			corev1.ResourceCPU:    resource.MustParse("500m"),
			corev1.ResourceMemory: resource.MustParse("4Gi"),
		},
	},
	"noobaa-db-vol": {
		Requests: corev1.ResourceList{
			corev1.ResourceStorage: resource.MustParse("50Gi"),
		},
	},
	"noobaa-endpoint": {
		Requests: corev1.ResourceList{
			corev1.ResourceCPU:    resource.MustParse("1"),
			corev1.ResourceMemory: resource.MustParse("2Gi"),
		},
		Limits: corev1.ResourceList{
			corev1.ResourceCPU:    resource.MustParse("1"),
			corev1.ResourceMemory: resource.MustParse("2Gi"),
		},
	},
	"prometheus": {
		Requests: corev1.ResourceList{
			"cpu":    resource.MustParse("500m"),
			"memory": resource.MustParse("250Mi"),
		},
		Limits: corev1.ResourceList{
			"cpu":    resource.MustParse("500m"),
			"memory": resource.MustParse("250Mi"),
		},
	},
	"alertmanager": {
		Requests: corev1.ResourceList{
			"cpu":    resource.MustParse("200m"),
			"memory": resource.MustParse("200Mi"),
		},
		Limits: corev1.ResourceList{
			"cpu":    resource.MustParse("200m"),
			"memory": resource.MustParse("200Mi"),
		},
	},
	"kube-rbac-proxy": {
		Limits: corev1.ResourceList{
			"memory": resource.MustParse("30Mi"),
			"cpu":    resource.MustParse("50m"),
		},
		Requests: corev1.ResourceList{
			"memory": resource.MustParse("30Mi"),
			"cpu":    resource.MustParse("50m"),
		},
	},
}

ResourceRequirements DaemonResources map contains the default resource requirements for the various MCG daemons.

Functions

func AddAnnotation

func AddAnnotation(obj metav1.Object, key string, value string)

func AddLabel

func AddLabel(obj metav1.Object, key string, value string)

AddLabel add a label to a resource metadata.

func Contains

func Contains(slice []string, s string) bool

Contains checks whether a string is contained within a slice.

func GetResourceRequirements

func GetResourceRequirements(name string) corev1.ResourceRequirements

GetResourceRequirements returns a custom ResourceRequirements for the passed name, if found in the passed resource map. If not, it returns the default value for the given name.

func MapItems

func MapItems(source []string, transform func(string) string) []string

func Remove

func Remove(slice []string, s string) (result []string)

Remove eliminates a given string from a slice and returns the new slice.

func RemoveLabel

func RemoveLabel(obj metav1.Object, key string)

RemoveLabel removes a label from the resource metadata.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL