https://pulumi.com logo
#kubernetes
Title
# kubernetes
r

red-lighter-44012

01/28/2021, 2:29 PM
I managed to patch the deployed service and set
spec.loadBalancerIP
after the deployment, but I am trying to do this in the helm chart.
b

better-actor-92669

01/28/2021, 3:26 PM
Try something like this
Copy code
def fix_service_namespace_rapid(obj):
    if obj["kind"] == "Service" and obj["apiVersion"] == "v1":
        try:
            obj["metadata"]["namespace"] = traefik_namespace_name_rapid
        except KeyError:
            pass
r

red-lighter-44012

01/28/2021, 3:44 PM
So you are suggesting that I run this on the service after it has been deployed
b

better-actor-92669

01/28/2021, 3:47 PM
I suggest using something that is called "transformations"
Copy code
traefik_chart_options_rapid = helm_v3.ChartOpts(
    chart='traefik',
    namespace=traefik_namespace_name_rapid,
    values=parse_yaml_file(traefik_values_file_rapid),
    fetch_opts=traefik_chart_fetch_options_rapid,
    transformations=[
        fix_service_namespace_rapid,
    ],
)
r

red-lighter-44012

01/28/2021, 4:00 PM
ah so still in the helm chart. yeah, I will give it a try
3 Views