mirror of
https://github.com/rancher/rke.git
synced 2025-09-16 06:59:25 +00:00
Add docker config file environment variables for kubelet
This commit is contained in:
committed by
Alena Prokharchyk
parent
8f47078988
commit
d451683abb
@@ -31,6 +31,10 @@ const (
|
||||
DefaultToolsEntrypoint = "/opt/rke-tools/entrypoint.sh"
|
||||
DefaultToolsEntrypointVersion = "0.1.13"
|
||||
LegacyToolsEntrypoint = "/opt/rke/entrypoint.sh"
|
||||
|
||||
KubeletDockerConfigEnv = "RKE_KUBELET_DOCKER_CONFIG"
|
||||
KubeletDockerConfigFileEnv = "RKE_KUBELET_DOCKER_FILE"
|
||||
KubeletDockerConfigPath = "/var/lib/kubelet/config.json"
|
||||
)
|
||||
|
||||
func GeneratePlan(ctx context.Context, rkeConfig *v3.RancherKubernetesEngineConfig, hostsInfoMap map[string]types.Info) (v3.RKEPlan, error) {
|
||||
@@ -346,6 +350,17 @@ func (c *Cluster) BuildKubeletProcess(host *hosts.Host, prefixPath string) v3.Pr
|
||||
c.Services.Kubelet.ExtraEnv,
|
||||
fmt.Sprintf("%s=%s", CloudConfigSumEnv, getCloudConfigChecksum(c.CloudProvider)))
|
||||
}
|
||||
if len(c.PrivateRegistriesMap) > 0 {
|
||||
kubeletDcokerConfig, _ := docker.GetKubeletDockerConfig(c.PrivateRegistriesMap)
|
||||
c.Services.Kubelet.ExtraEnv = append(
|
||||
c.Services.Kubelet.ExtraEnv,
|
||||
fmt.Sprintf("%s=%s", KubeletDockerConfigEnv,
|
||||
b64.StdEncoding.EncodeToString([]byte(kubeletDcokerConfig))))
|
||||
|
||||
c.Services.Kubelet.ExtraEnv = append(
|
||||
c.Services.Kubelet.ExtraEnv,
|
||||
fmt.Sprintf("%s=%s", KubeletDockerConfigFileEnv, path.Join(prefixPath, KubeletDockerConfigPath)))
|
||||
}
|
||||
// check if our version has specific options for this component
|
||||
serviceOptions := c.GetKubernetesServicesOptions()
|
||||
if serviceOptions.Kubelet != nil {
|
||||
|
Reference in New Issue
Block a user