Prisma Cloud 计算:Google Cloud Registry 登录问题
7450
Created On 11/18/19 18:29 PM - Last Modified 03/02/23 02:52 AM
Symptom
客户需要担心什么?
从中推送或拉取图像GCR需要最少的烫发。
如果您在将 Defender 映像推送到注册表时遇到问题,请按照以下步骤操作。
Environment
- 软件即服务
- 自托管版本 21.04 及以上
Cause
请查看解决方案部分。
Resolution
登录:
gcloud beta auth application-default login --scopes=
https://www.googleapis.com/auth/devstorage.full_control,
[https://www.googleapis.com/auth/devstorage.read_write]
https://www.googleapis.com/auth/devstorage.full_control,
[https://www.googleapis.com/auth/devstorage.read_write]
获取访问令牌:
gcloud beta auth application-default print-access-token
验证范围是否正确:
卷曲 https://www.googleapis.com/oauth2/v1/tokeninfo?access_token=<TOKEN >
{
“发布到”:“7640850-6qr4p6g8ejuq83di341hur.apps.googleusercontent.com”,
“听众”:“7640850-6qr4p6g8ejuq83di341hur.apps.googleusercontent.com”,
“范围”:“https://www.googleapis.com/auth/devstorage.full_control https://www.googleapis.com/auth/devstorage.read_write”,
“expires_in”:355,
“access_type”:“离线”
}
{
“发布到”:“7640850-6qr4p6g8ejuq83di341hur.apps.googleusercontent.com”,
“听众”:“7640850-6qr4p6g8ejuq83di341hur.apps.googleusercontent.com”,
“范围”:“https://www.googleapis.com/auth/devstorage.full_control https://www.googleapis.com/auth/devstorage.read_write”,
“expires_in”:355,
“access_type”:“离线”
}
做码头登录:
$ sudo docker login -u oauth2accesstoken -p "<TOKEN >” https://gcr.io
您现在可以将图像推送到GCR并部署守护进程集:
使用时GKE,为了部署守护进程集,kubectl 必须连接到集群。 在继续安装之前,请确保在云外壳中设置了 gcloud 默认值,例如 PROJECT_ID、Compute Engine 区域等。
$ gcloud 配置设置项目 PROJECT_ID
$ gcloud 配置设置计算/区域 europe-west1-d
$ gcloud 配置设置容器/集群 twistlock-demo
获取 kubectl 工具的集群凭据:
$ gcloud 容器集群 get-credentials twistlock-demo
默认情况下,凭据存储在 ~/.kube/config 中。 可以通过运行来验证设置:
$ kubectl 集群信息