Set ProviderID when running kubemark node

Kubemark is very useful tool for exercising various solutions requiring to run
many nodes on a small set of physical nodes. E.g. for development and testing
of cluster autoscaler where some use cases might require tens or hundreds
of nodes to be scalled up and down. Using kubemark saves computation
resources.

As part of integration of cluster-api project into cluster-autoscaler project,
the autoscaler uses the ProviderID field to index nodes through informer.
Setting the ProviderID field even by Kubemark allows to autoscale cluster
made of hollow nodes.
This commit is contained in:
Jan Chaloupka 2019-01-26 10:34:52 +01:00
parent c6d0cdf309
commit 145dcaf92c

View File

@ -17,6 +17,7 @@ limitations under the License.
package kubemark
import (
"fmt"
"time"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@ -121,6 +122,7 @@ func GetHollowKubeletConfig(
f.MaxPerPodContainerCount = 2
f.RegisterNode = true
f.RegisterSchedulable = true
f.ProviderID = fmt.Sprintf("kubemark://%v", nodeName)
// Config struct
c, err := options.NewKubeletConfiguration()