Version: v1.0
在应用程序中配置数据或环境
vela 提供 config 命令用于管理配置数据。
vela config set
$ vela config set test a=b c=dreading existing config data and merging with user inputconfig data saved successfully ✅
vela config get
$ vela config get testData:a: bc: d
vela config del
$ vela config del testconfig (test) deleted successfully
vela config ls
$ vela config set test a=b$ vela config set test2 c=d$ vela config lsNAMEtesttest2
在应用程序中配置环境变量
可以在应用程序中将配置数据设置为环境变量。
$ vela config set demo DEMO_HELLO=helloworld
将以下内容保存为 vela.yaml 到当前目录中:
name: testappservices:env-config-demo:image: heroku/nodejs-hello-worldconfig: demo
然后运行:
$ vela upParsing vela.yaml ...Loading templates ...Rendering configs for service (env-config-demo)...Writing deploy config to (.vela/deploy.yaml)Applying deploy configs ...Checking if app has been deployed...App has not been deployed, creating a new deployment...✅ App has been deployed 🚀🚀🚀Port forward: vela port-forward testappSSH: vela exec testappLogging: vela logs testappApp status: vela status testappService status: vela status testapp --svc env-config-demo
检查环境变量:
$ vela exec testapp -- printenv | grep DEMO_HELLODEMO_HELLO=helloworld