I am trying to set a fixed resource value to my kubernetes container. When I try the following:
//cont = v1.Container
log.Println("Before", cont.Resources.Requests.Memory())
cont.Resources.Requests.Memory().SetMilli(512) //new wanted value
log.Println("After", cont.Resources.Requests.Memory())
log.Println("Before", cont.Resources.Requests.Cpu())
cont.Resources.Requests.Cpu().SetScaled(2, resource.Giga) //new wanted value
log.Println("After", cont.Resources.Requests.Cpu())
I get this:
Before 0
After 0
Before 0
After 0
Why doesn't Set
update my values to the newer ones? How can I set the CPU & RAM resources properly?