我正在学习如何使用Pulumi,我想知道我是否可以正确配置pulumi以将图像推送到GCR。我在index.ts
const appImage = new docker.Image("ledgerImage", {
imageName: 'us.gcr.io/qwil-build/ledger',
build: "../../",
});
运行pulumi preview
时,我看到图像已成功构建:
2:51PM /Users/paymahn/qwil/ledger/pulumi/infra pulumi ⬆ ⬇ ◼
❮❮❮ pulumi preview
Previewing update (qwil/dev):
Type Name Plan Info
+ pulumi:pulumi:Stack ledger-dev create 1 message
+ ├─ docker:image:Image ledgerImage create
+ ├─ gcp:compute:Address cloud-sql-private-ip create
+ ├─ kubernetes:core:Service ledger create
+ ├─ gcp:servicenetworking:Connection private_vpc create
+ ├─ gcp:sql:DatabaseInstance ledger_db create
+ ├─ gcp:sql:SslCert clientCert create
+ ├─ gcp:sql:User master create
+ ├─ kubernetes:core:Secret ledger-db-tls create
+ └─ kubernetes:extensions:Deployment ledger create 1 warning
Diagnostics:
pulumi:pulumi:Stack (ledger-dev):
kubernetes:extensions:Deployment (ledger):
warning: extensions/v1beta1/Deployment is not supported by Kubernetes 1.16+ clusters. Use apps/v1/Deployment instead.
Resources:
+ 10 to create
Permalink: https://app.pulumi.com/qwil/ledger/dev/previews/3f96f06f-ba49-4f52-91db-2884389a6b62
但是,当我访问永久链接时,在映像构建步骤的最后,在“差异日志”视图中看到以下输出:Successfully pushed to docker
。当我访问我们的私人GCR存储区时,看不到图片的任何更新/新推送。
我的问题是:
答案 0 :(得分:2)
对您的问题:
Image
资源将构建图像并返回目标图像名称,而无需推送。在正常更新期间,它将执行相同的操作,并标记并推送图像。这是一个推送到GCR的docker映像的示例,昨天才为我工作:https://github.com/pulumi/examples/pull/519/files#diff-982498c859f8161c992d7246993ab441R48-R53