sparse-intern-71089
07/31/2019, 6:32 PMstale-autumn-24797
07/31/2019, 6:32 PMpublic_ip = PublicIp(
f'{env}_public_ip',
name=f'{PREFIX}-{env}-public-ip',
resource_group_name=aks_stack.get_output('rg_name'),
allocation_method='Static',
domain_name_label=f'{PREFIX}-{env}')
nginx_chart_opts = ChartOpts(f'{env}-nginx-chart-opts')
nginx_chart_opts.transformations = [lambda config_file: set_metadata_namespace(config_file, env)]
nginx_chart_opts.repo = 'stable'
nginx_chart_opts.chart = 'nginx-ingress'
nginx_chart_opts.namespace = env
nginx_chart_opts.values = \
{
'controller':
{
'service':
{
'loadBalancerIP': 'SET BELOW'
},
'replicaCount': 2
},
'rbac':
{
'create': True
}
}
def set_load_balancer_ip(ip_address):
nginx_chart_opts.values['controller']['service']['loadBalancerIP'] = ip_address
public_ip.ip_address.apply(lambda ip_address: set_load_balancer_ip(ip_address))
# Deploy the nginx ingress controller.
nginx_ingress = Chart(
f'{env}-nginx-ingress',
nginx_chart_opts,
opts=ResourceOptions(provider=custom_provider, depends_on=[public_ip]))
This does not produce an error, but the chart is deployed before the loadBalancerIP value has been written in set_load_balancer_ip (I’ve confirmed by inspecting the yaml of the deployed chart). Any thoughts on how I can ensure that set_load_balancer_ip is called before the Chart deployment?gorgeous-egg-16927
07/31/2019, 9:43 PMbitter-oil-46081
07/31/2019, 9:44 PMnginx_chart_opts.values = Output.from_input({ .... })
stale-autumn-24797
07/31/2019, 10:27 PMstale-autumn-24797
07/31/2019, 11:55 PMstale-autumn-24797
08/01/2019, 12:19 AMgorgeous-egg-16927
08/01/2019, 2:47 PMgorgeous-egg-16927
08/01/2019, 2:48 PMgorgeous-egg-16927
08/01/2019, 2:49 PMstale-autumn-24797
08/01/2019, 6:40 PMstale-autumn-24797
08/02/2019, 5:18 PMgorgeous-egg-16927
08/02/2019, 5:24 PMgorgeous-egg-16927
08/02/2019, 5:24 PMstale-autumn-24797
08/02/2019, 5:54 PMgorgeous-egg-16927
08/02/2019, 9:37 PMgorgeous-egg-16927
08/03/2019, 1:00 AM