Answers: <p>Environment vars at the time of kubeadm init are not deployed to all pods. There are no pods at that time anyway, you have just created a kubemaster.</p>
  <p>When you want to put NO_PROXY into pods/deployments you have to do that the usual way with env on the container.</p>
  <pre><code>   env:
      - name: NODE_NAME
        valueFrom:
          fieldRef:
            fieldPath: spec.nodeName     
  </code></pre>
  
Answers: CC BY-SA 4.0
Answers: 2021-06-03T15:43:49.037Z
Answers: It's populated to various pods such as the kube-apiserver pod. I had to install cert manager using helm. I was facing a proxy issue, to fix it I had to take down the cluster, change the environment variable, and then start the cluster again. Then initialize the cluster again. There surely has to be a better way.
Answers: cricketsaturn
Answers: CC BY-SA 4.0
Answers: 2021-06-03T12:22:58.327Z
Answers: 2021-06-03T12:22:58.327Z
Answers: Serve Laurijssen
Body: <p>I created my cluster through <code>kubeadm</code>. Before the creation of the cluster I set an environment variable <code>~/.bashsrc</code>. The variable I set is <code>NO_PROXY</code>. When the cluster is created this variable gets picked up and is applied to all pods.</p>
  <p>I now want to add another entry to the <code>NO_PROXY</code> but I know that this update won't be picked up automatically by the cluster.</p>
  <p>What is the best way to update the environment variables of a kubernetes cluster?</p>
  
Tags: <kubernetes><kubeadm>
Title: How do I modify the environment variables of a Kubernetes cluster?
UserDisplayName: cricketsaturn
ThreadText: # How do I modify the environment variables of a Kubernetes cluster?
  
  (Asked by: username_0 on 2021-06-02)
  
  I created my cluster through `kubeadm`. Before the creation of the cluster I set an environment variable `~/.bashsrc`. The variable I set is `NO_PROXY`. When the cluster is created this variable gets picked up and is applied to all pods.
  
  I now want to add another entry to the `NO_PROXY` but I know that this update won't be picked up automatically by the cluster.
  
  What is the best way to update the environment variables of a kubernetes cluster?
  
  **Tags:** kubernetes, kubeadm
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-06-03. Score: 1
  
  Environment vars at the time of kubeadm init are not deployed to all pods. There are no pods at that time anyway, you have just created a kubemaster.
  
  When you want to put NO\_PROXY into pods/deployments you have to do that the usual way with env on the container.
  
  ```
     env:
      - name: NODE_NAME
        valueFrom:
          fieldRef:
            fieldPath: spec.nodeName     
  
  ```
  
  > **Comments:**
  > **username_0**: It's populated to various pods such as the kube-apiserver pod. I had to install cert manager using helm. I was facing a proxy issue, to fix it I had to take down the cluster, change the environment variable, and then start the cluster again. Then initialize the cluster again. There surely has to be a better way.  
  
  ---
  
  