kubernetes-sigs / sig-windows-tools

Repository for tools and artifacts related to the sig-windows charter in Kubernetes. Scripts to assist kubeadm and wincat and flannel will be hosted here.
Apache License 2.0
123 stars 123 forks source link

How to use host's environment variables in the hostprocess container #363

Open IndCheung opened 4 months ago

IndCheung commented 4 months ago

I created a Flannel container using the hostprocess mode, but I found that after Flannel starts, it will call Powershell to execute some commands. However, the hostprocess container seems to not be able to share environment variables with the host, so executing the Powershell command in Flanneldexe reported an error. How do you solve this problem?

Note: I used the following base image to build the image: https://github.com/microsoft/windows-host-process-containers-base-image

jsturtevant commented 4 months ago

you can use the Pod specs Environment variables to map in environment variables needed