func()

in pkg/agent/datamodel/types.go [1612:1647]


func (config *NodeBootstrappingConfiguration) GetOrderedKubeproxyConfigStringForPowershell() string {
	kubeproxyConfig := config.KubeproxyConfig
	if kubeproxyConfig == nil {
		// https://kubernetes.io/docs/reference/command-line-tools-reference/kube-proxy/.
		// --metrics-bind-address ipport     Default: 127.0.0.1:10249.
		// The IP address with port for the metrics server to serve on
		// (set to '0.0.0.0:10249' for all IPv4 interfaces and '[::]:10249' for all IPv6 interfaces).
		// Set empty to disable.
		// This only works with Windows provisioning package v0.0.15+.
		// https://github.com/Azure/aks-engine/blob/master/docs/topics/windows-provisioning-scripts-release-notes.md#v0015
		kubeproxyConfig = map[string]string{"--metrics-bind-address": "0.0.0.0:10249"}
	}

	if _, ok := kubeproxyConfig["--metrics-bind-address"]; !ok {
		kubeproxyConfig["--metrics-bind-address"] = "0.0.0.0:10249"
	}

	// override kube proxy configuration with the customzied ones.
	kubeProxyCustomConfiguration := config.ContainerService.Properties.GetComponentWindowsKubernetesConfiguration(ComponentkubeProxy)
	if kubeProxyCustomConfiguration != nil {
		customConfig := kubeProxyCustomConfiguration.Config
		for k, v := range customConfig {
			kubeproxyConfig[k] = v
		}
	}
	keys := []string{}
	for key := range kubeproxyConfig {
		keys = append(keys, key)
	}
	sort.Strings(keys)
	var buf bytes.Buffer
	for _, key := range keys {
		buf.WriteString(fmt.Sprintf("\"%s=%s\", ", key, kubeproxyConfig[key]))
	}
	return strings.TrimSuffix(buf.String(), ", ")
}