loft-sh / loft

Namespace & Virtual Cluster Manager for Kubernetes - Lightweight Virtual Clusters, Self-Service Provisioning for Engineers and 70% Cost Savings with Sleep Mode
https://loft.sh/docs/introduction
Other
714 stars 64 forks source link

Environment variables referencing other environment variables are not expanded while using loft #157

Closed ramanNarasimhan77 closed 2 years ago

ramanNarasimhan77 commented 2 years ago

Hello,

As per Kubernetes documentation, it is possible to define interdependent environment variables

https://kubernetes.io/docs/tasks/inject-data-application/define-interdependent-environment-variables/

Based on this, we have a helm chart wherein the service port is exposed as a Generic Env using something like below:

MY_SERVICE_PORT: $(MY_CHART_MY_SERVICE_PORT)

This works fine when I installation via helm directly on the cluster.

However when I use vcluster, the Variable expansion/substitution is not happening and the value of MY_SERVICE_PORT is string $(MY_CHART_MY_SERVICE_PORT)

Using vCluster : Not Working MY_SERVICE_PORT is not set properly

$ env | grep PROXY_API_SERVICE_PORT MY_SERVICE_PORT=$(MY_CHART_MY_SERVICE_PORT) MY_CHART_MY_SERVICE_PORT=8001

Direct Installation on cluster: MY_SERVICE_PORT is set properly

$ env | grep PROXY_API_SERVICE_PORT MY_SERVICE_PORT=8001 MY_CHART_MY_SERVICE_PORT=8001

ramanNarasimhan77 commented 2 years ago

Raised in wrong github, I will close this and raise in vcluster github