in pkg/agent/utils.go [447:486]
func getAKSKubeletConfiguration(kc map[string]string) *datamodel.AKSKubeletConfiguration {
kubeletConfig := &datamodel.AKSKubeletConfiguration{
APIVersion: "kubelet.config.k8s.io/v1beta1",
Kind: "KubeletConfiguration",
Address: kc["--address"],
StaticPodPath: kc["--pod-manifest-path"],
Authorization: datamodel.KubeletAuthorization{
Mode: datamodel.KubeletAuthorizationMode(kc["--authorization-mode"]),
},
ClusterDNS: strings.Split(kc["--cluster-dns"], ","),
CgroupsPerQOS: strToBoolPtr(kc["--cgroups-per-qos"]),
TLSCertFile: kc["--tls-cert-file"],
TLSPrivateKeyFile: kc["--tls-private-key-file"],
TLSCipherSuites: strings.Split(kc["--tls-cipher-suites"], ","),
ClusterDomain: kc["--cluster-domain"],
MaxPods: strToInt32(kc["--max-pods"]),
NodeStatusUpdateFrequency: datamodel.Duration(kc["--node-status-update-frequency"]),
NodeStatusReportFrequency: datamodel.Duration(kc["--node-status-report-frequency"]),
ImageGCHighThresholdPercent: strToInt32Ptr(kc["--image-gc-high-threshold"]),
ImageGCLowThresholdPercent: strToInt32Ptr(kc["--image-gc-low-threshold"]),
EventRecordQPS: strToInt32Ptr(kc["--event-qps"]),
PodPidsLimit: strToInt64Ptr(kc["--pod-max-pids"]),
EnforceNodeAllocatable: strings.Split(kc["--enforce-node-allocatable"], ","),
StreamingConnectionIdleTimeout: datamodel.Duration(kc["--streaming-connection-idle-timeout"]),
RotateCertificates: strToBool(kc["--rotate-certificates"]),
ServerTLSBootstrap: strToBool(kc["--rotate-server-certificates"]),
ReadOnlyPort: strToInt32(kc["--read-only-port"]),
ProtectKernelDefaults: strToBool(kc["--protect-kernel-defaults"]),
ResolverConfig: kc["--resolv-conf"],
ContainerLogMaxSize: kc["--container-log-max-size"],
}
// Serialize Image Pulls will only be set for k8s >= 1.31, currently RP doesnt pass this flag
// It will starting with k8s 1.31
if value, exists := kc["--serialize-image-pulls"]; exists {
kubeletConfig.SerializeImagePulls = strToBoolPtr(value)
}
return kubeletConfig
}