kubeadm: fix an issue with the kube-proxy container env. variables
3993c42431 introduced the propagation of *_PROXY
host env. variables to the kube-proxy container.
To allow The NODE_NAME variable to be properly updated by the downward
API make, sure we preserve the existing variables when adding *_PROXY.
This commit is contained in:
@@ -129,8 +129,9 @@ func createKubeProxyAddon(configMapBytes, daemonSetbytes []byte, client clientse
|
|||||||
if err := kuberuntime.DecodeInto(clientsetscheme.Codecs.UniversalDecoder(), daemonSetbytes, kubeproxyDaemonSet); err != nil {
|
if err := kuberuntime.DecodeInto(clientsetscheme.Codecs.UniversalDecoder(), daemonSetbytes, kubeproxyDaemonSet); err != nil {
|
||||||
return errors.Wrap(err, "unable to decode kube-proxy daemonset")
|
return errors.Wrap(err, "unable to decode kube-proxy daemonset")
|
||||||
}
|
}
|
||||||
// propagate http/https proxy env vars
|
// Propagate the http/https proxy host environment variables to the container
|
||||||
kubeproxyDaemonSet.Spec.Template.Spec.Containers[0].Env = kubeadmutil.GetProxyEnvVars()
|
env := &kubeproxyDaemonSet.Spec.Template.Spec.Containers[0].Env
|
||||||
|
*env = append(*env, kubeadmutil.GetProxyEnvVars()...)
|
||||||
|
|
||||||
// Create the DaemonSet for kube-proxy or update it in case it already exists
|
// Create the DaemonSet for kube-proxy or update it in case it already exists
|
||||||
return apiclient.CreateOrUpdateDaemonSet(client, kubeproxyDaemonSet)
|
return apiclient.CreateOrUpdateDaemonSet(client, kubeproxyDaemonSet)
|
||||||
|
|||||||
Reference in New Issue
Block a user