mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 11:21:47 +00:00
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:
parent
e328029255
commit
0b4e5ee3b8
@ -129,8 +129,9 @@ func createKubeProxyAddon(configMapBytes, daemonSetbytes []byte, client clientse
|
||||
if err := kuberuntime.DecodeInto(clientsetscheme.Codecs.UniversalDecoder(), daemonSetbytes, kubeproxyDaemonSet); err != nil {
|
||||
return errors.Wrap(err, "unable to decode kube-proxy daemonset")
|
||||
}
|
||||
// propagate http/https proxy env vars
|
||||
kubeproxyDaemonSet.Spec.Template.Spec.Containers[0].Env = kubeadmutil.GetProxyEnvVars()
|
||||
// Propagate the http/https proxy host environment variables to the container
|
||||
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
|
||||
return apiclient.CreateOrUpdateDaemonSet(client, kubeproxyDaemonSet)
|
||||
|
Loading…
Reference in New Issue
Block a user