Jul 25, 2019 · kubectldoes not provide any such facility to pass environment variables on the fly. Like @Pampy mentioned, other way would be by using ConfigMaps and Secrets. In case you are going to use same resource specs in two different environments, I would suggest to go with Helm.. To begin with, I would like to take a very basic example with --set where we are going to set the replicatCount=2. Here is the command to install helloworld. helm install --set replicaCount=2 helloworld-1 world. bash. This command will set the replicaCount to 2. You can verify it using the following command -. kubectl get deployment. Kubectl Provider. This provider is the best way of managing Kubernetes resources in Terraform, by allowing you to use the thing Kubernetes loves best - yaml! This core of this provider is the kubectl_manifest resource, allowing free-form yaml to be processed and applied against Kubernetes. This yaml object is then tracked and handles creation. Kubernetes 101 : Passing environment variables - The downwardAPI -. ConfigMaps and secrets for example are suitable for passing data about application and their environment. But for the variables that are not know before the pod starts, like the pod's IP address or name for example, we need to use another "medium" called the downwardAPI..