Basically need a way to set nodeselector for Pod using GoLang API
Pod.Spec.NodeSelector["failure-domain.beta.kubernetes.io/zone"] = zone is giving out error
CodePudding user response:
You should initialize the map before setting it. something like this
pod.Spec.NodeSelector = make(map[string]string)
pod.Spec.NodeSelector["failure-domain.beta.kubernetes.io/zone"] = "zone1"