Pulumi:如何忽略对先前部署的资源所做的更改?

问题描述

在我的一个Pulumi Azure堆栈中,我使用Application Gateway Ingress Router for Kubernetes

创建了一个Azure应用网关路由器和一个Azure Kubernetes服务群集。

我的最初AppGW部署将由Application Gateway入口路由器在幕后进行修改-在我们在Kubernetes集群中创建其他Ingress Kubernetes资源时添加新的设置和绑定。

如果我曾经在包含AppGW路由器的堆栈上运行pulumi refresh命令,则Pulumi将获取Ingress资源所做的所有更改,并在随后的{{1} }操作-破坏了我们所有的DNS和路由。

如何在Kubernetes中编程我的AppGW资源以忽略这些后续更改?以下是到目前为止我使用pulumi up字段尝试过的操作:

CustomresourceOptions.IgnoreChanges

但是,设置完这些值之后,当我尝试运行var applicationGateway = new ApplicationGateway("appgateway",new ApplicationGatewayArgs() { Name = "aks-appgateway",ResourceGroupName = resourceGroup.Name,Sku = new ApplicationGatewaySkuArgs() { Capacity = 2,Name = "Standard_v2",Tier = "Standard_v2",},GatewayIpConfigurations = new ApplicationGatewayGatewayIpConfigurationArgs[] { new ApplicationGatewayGatewayIpConfigurationArgs { Name = "appGatewayIpConfig",subnetId = appGateWaysubnet.Id,} },FrontendPorts = new ApplicationGatewayFrontendPortArgs[] { new ApplicationGatewayFrontendPortArgs { Name = "httpPort",Port = 80 },new ApplicationGatewayFrontendPortArgs { Name = "httpsPort",Port = 443 },FrontendIpConfigurations = new[] { new ApplicationGatewayFrontendIpConfigurationArgs() { Name = "aksFrontEndIp",PublicIpAddressId = appGatewayIp.Id,BackendHttpSettings = new[] { new ApplicationGatewayBackendHttpSettingArgs() { Name = "HttpRouting",CookieBasedAffinity = "disabled",Port = 80,Protocol = "Http",RequestTimeout = 60 } },BackendAddresspools = new ApplicationGatewayBackendAddresspoolArgs() { Name = "aks-backend" },EnableHttp2 = true,HttpListeners = new[] { new ApplicationGatewayHttpListenerArgs() { Name = "aks-HttpListener",// need to match the values declared earlier FrontendIpConfigurationName = "aksFrontEndIp",FrontendPortName = "httpPort",Protocol = "Http" },new ApplicationGatewayHttpListenerArgs() { Name = "aks-HttpsListener",FrontendPortName = "httpsPort",Protocol = "Https",SslCertificateName = "sdkbin-ssl" } },RequestRoutingRules = new ApplicationGatewayRequestRoutingRuleArgs() { BackendAddresspoolName = "aks-backend",HttpListenerName = "aks-HttpListener",BackendHttpSettingsName = "HttpRouting",RuleType = "Basic",Name = "aks-routing" },SslCertificates = new ApplicationGatewaySslCertificateArgs() { Name = "sdkbin-ssl",keyvaultSecretId = config.RequireSecret("tlsSecret") },Identity = new ApplicationGatewayIdentityArgs { IdentityIds = gatewayIdentity.Id },new CustomresourceOptions() { Protect = IsProtected,IgnoreChanges = new List<string>() { "httpListeners","probes","backendAddresspools","backendHttpSettings","frontendPorts","tags" } }) ; // ignore changes 时出现以下错误

pulumi up

忽略这些字段的更改似乎会导致所有这些错误-那么,最好的方法是什么?不放弃Kubernetes对我在Pulumi中的Application Gateway路由器所做的更改?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)