This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.3.5.6.4. --bind-as-files 示例
3.5.6.4.1. 使用默认 odo 链接 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
默认情况下,odo
在 kubernetes/
目录下创建清单文件来存储链接信息。使用以下命令链接后端组件和 PostgreSQL 服务:
odo link PostgresCluster/hippo --bind-as-files odo push
$ odo link PostgresCluster/hippo --bind-as-files
$ odo push
odo describe
输出示例:
之前的 odo describe
输出中的 key=value
格式是一个环境变量,现在作为一个文件被挂载。使用 cat
命令查看其中的一些文件的内容:
示例命令:
odo exec -- cat /bindings/backend-postgrescluster-hippo/password
$ odo exec -- cat /bindings/backend-postgrescluster-hippo/password
输出示例:
q({JC:jn^mm/Bw}eu+j.GX{k
q({JC:jn^mm/Bw}eu+j.GX{k
示例命令:
odo exec -- cat /bindings/backend-postgrescluster-hippo/user
$ odo exec -- cat /bindings/backend-postgrescluster-hippo/user
输出示例:
hippo
hippo
示例命令:
odo exec -- cat /bindings/backend-postgrescluster-hippo/clusterIP
$ odo exec -- cat /bindings/backend-postgrescluster-hippo/clusterIP
输出示例:
10.101.78.56
10.101.78.56