更新gcloud容器群集时Invalid_argument错误

发布于 2025-02-08 09:27:59 字数 1822 浏览 2 评论 0 原文

我的目标是使用GCloud命令更新作曲家DAG变量。我首先使用单个命令通过问题在此使用Google Cloud Composer中的JSON文件导入变量

我有以下错误 -

错误:( gcloud.composer.environments.run)kubectl返回了非零 状态代码。确保您遵循 可以从您的私人云作曲家环境访问您的环境 机器。

然后,我在私有IP环境部分的运行命令下遵循该说明。我得到了云外壳的公开IP,以及GKE群集名称。在提到更新GKE群集的第三步中,我运行了命令以使用以下命令获取现有_auth_nets-

gcloud container clusters describe cluster_name --zone us-central1-c \
    --format "flattened(masterAuthorizedNetworksConfig.cidrBlocks[])"

这无返回。因此,我继续运行以下命令 -

gcloud container clusters update cluster_name \
    --enable-master-authorized-networks \
    --master-authorized-networks None,34.xxx.xxx.xxx

运行上述命令,我会收到以下错误 -

错误:( gcloud.container.clusters.update)invalid_argument:(1) “ cluster.master_authorized_networks_config”的无效值 CIDR-“ 34.126.169.236”不是有效的CIDR范围。必须是 REGEX [0-9] {1,3}。[0-9] {1,3}。[0-9] {1,3}。[0-9] {1,3}/[0-9] {1,2},(用于 例如,'10 .120.0.0/14')(2) “ cluster.master_authorized_networks_config”:无效的cidr-“无”是 不是有效的CIDR范围。必须是正则匹配 [0-9] {1,3}。[0-9] {1,3}。[0-9] {1,3}。[0-9] {1,3}/[0-9] { 1,2},(用于 例如,'10 .120.0.0/14')。

有人可以帮助我如何解决错误吗?我知道IP地址是错误的。即使运行简单的云作曲家命令,我也无法这样做

gcloud composer environments run composer-env-name list_dags --location us-central1 -- --report 

My goal is to update composer dag variables using gcloud commands. I started with using single command to update one variable via question posted in this Import variables using json file in Google Cloud Composer.

I got the following error -

ERROR: (gcloud.composer.environments.run) kubectl returned non-zero
status code. Make sure you have followed
https://cloud.google.com/composer/docs/how-to/accessing/airflow-cli#private-ip
to enable access to your private Cloud Composer environment from your
machine.

I then followed that instructions under Running commands on a private IP environment section. I got my public IP of the cloud shell, and the gke cluster name. In the third step that mentions updating GKE Cluster, I ran the command to obtain EXISTING_AUTH_NETS using the following command -

gcloud container clusters describe cluster_name --zone us-central1-c \
    --format "flattened(masterAuthorizedNetworksConfig.cidrBlocks[])"

This returned None. So I went ahead and ran the following command -

gcloud container clusters update cluster_name \
    --enable-master-authorized-networks \
    --master-authorized-networks None,34.xxx.xxx.xxx

Running the above command I get the following errors -

ERROR: (gcloud.container.clusters.update) INVALID_ARGUMENT: (1)
invalid value for "cluster.master_authorized_networks_config": invalid
CIDR - "34.126.169.236" is not a valid CIDR range. Must be a match of
regex [0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}/[0-9]{1,2}, (for
example, '10.120.0.0/14') (2) invalid value for
"cluster.master_authorized_networks_config": invalid CIDR - "None" is
not a valid CIDR range. Must be a match of regex
[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}/[0-9]{1,2}, (for
example, '10.120.0.0/14').

Can someone help me how to fix the error? I understand that IP address is wrong. Even running simple cloud composer commands such as this one, I am unable to do so

gcloud composer environments run composer-env-name list_dags --location us-central1 -- --report 

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

许久 2025-02-15 09:28:00

您已经指定了一个IP地址(34.126.169.236),而不是CIDR(34.126.169.0/24)。格式相似,但表示不同的信息。第一个是一个IP地址,第二个是网络规范。

You have specified an IP address (34.126.169.236) and not a CIDR (34.126.169.0/24). The formats are similar but represent different information. The first is a single IP address, the second is a network specification.

韬韬不绝 2025-02-15 09:28:00

我也有同样的问题。只需避免指定现有的_auth_nets,并记住使用 /32的IP地址后缀IP地址。因此,要解决您的示例,那将是...

gcloud container clusters update cluster_name \
    --enable-master-authorized-networks \
    --master-authorized-networks 34.xxx.xxx.xxx/32

I had the same issue. Just avoid specifying EXISTING_AUTH_NETS and remember to suffix the IP address from dig with /32. So to fix your example it would be...

gcloud container clusters update cluster_name \
    --enable-master-authorized-networks \
    --master-authorized-networks 34.xxx.xxx.xxx/32
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文