bland-lamp-16797
06/10/2020, 3:21 PMerror: apiVersion "extensions/v1beta1/Deployment" was removed in Kubernetes 1.16. Use "apps/v1/Deployment" instead.
billowy-army-68599
bland-lamp-16797
06/10/2020, 3:51 PMhelm
it works fine
stable/nginx-ingressBut when i try same version with pulumi Chart it fails... I'm trying to figure out
transformations
, maybe that is easiest...error: resource b81-system/b81-nginx-ingress-default-backend was not successfully created by the Kubernetes API server : Deployment.apps "b81-nginx-ingress-default-backend" is invalid: [spec.selector: Required value, spec.template.metadata.labels: Invalid value: map[string]string{"app":"nginx-ingress", "component":"default-backend", "release":"b81"}:does not match templateselector
]labels
billowy-army-68599
bland-lamp-16797
06/10/2020, 4:03 PMdef remove_beta(obj):
print(obj)
if obj['kind'] == "Deployment" and obj['apiVersion'] == "extensions/v1beta1":
obj['apiVersion'] = "apps/v1"
return obj
billowy-army-68599
bland-lamp-16797
06/10/2020, 4:04 PMfrom pulumi_kubernetes.helm.v2 import Chart, ChartOpts
billowy-army-68599
requirements.txt
?bland-lamp-16797
06/10/2020, 4:05 PMbillowy-army-68599
bland-lamp-16797
06/10/2020, 4:06 PMpulumi-kubernetes
right now just to make sure it's up to datedef helm_chart(provider, name, chart, version, repo='stable', namespace=None):
def remove_beta(obj):
print(obj)
if obj['kind'] == "Deployment" and obj['apiVersion'] == "extensions/v1beta1":
obj['apiVersion'] = "apps/v1"
return obj
helm = Chart(name, config=ChartOpts(
repo=repo,
chart=chart,
version=version,
namespace=namespace,
transformations=[remove_beta]
), opts=ResourceOptions(provider=provider))
return helm
nginx_ingress = gke.helm_chart(k8s_provider, 'b81', 'nginx-ingress', '0.30.0', namespace=b81_namespace.metadata['name'])
helm repo add stable <https://kubernetes-charts.storage.googleapis.com>
billowy-army-68599
bland-lamp-16797
06/10/2020, 4:11 PMbillowy-army-68599
kubectl
do you have locally? which version of helm? can you include that info in the issuebland-lamp-16797
06/10/2020, 4:14 PMbillowy-army-68599
bland-lamp-16797
06/10/2020, 4:36 PMcreamy-potato-29402
06/10/2020, 7:53 PM.spec.selector
.bland-lamp-16797
06/10/2020, 7:55 PMcreamy-potato-29402
06/10/2020, 7:55 PM.spec.selector
to be present.bland-lamp-16797
06/10/2020, 7:56 PMcreamy-potato-29402
06/10/2020, 7:56 PMbland-lamp-16797
06/10/2020, 7:57 PMhelm
manually it works...creamy-potato-29402
06/10/2020, 7:57 PMbland-lamp-16797
06/10/2020, 7:57 PMcreamy-potato-29402
06/10/2020, 7:58 PMbland-lamp-16797
06/10/2020, 8:02 PMcreamy-potato-29402
06/10/2020, 8:06 PMbland-lamp-16797
06/10/2020, 8:08 PMcreamy-potato-29402
06/10/2020, 8:08 PMbland-lamp-16797
06/10/2020, 8:09 PMhelm install -name b81 stable/nginx-ingress --namespace b81-system
works without problem, even uninstalling...
but with pulumi it gets the errorcreamy-potato-29402
06/10/2020, 8:09 PMbland-lamp-16797
06/10/2020, 8:17 PM['helm', 'template', '/var/folders/9x/4kf833yx6dd8c0w1_dffkd0w0000gn/T/tmp0h4stlnp/nginx-ingress', '--name-template', 'b81', '--values', '/var/folders/9x/4kf833yx6dd8c0w1_dffkd0w0000gn/T/tmp0h4stlnp/nginx-ingress/values.yaml', '--values', '/var/folders/9x/4kf833yx6dd8c0w1_dffkd0w0000gn/T/tmpeyy32zn8', '--namespace', 'b81-system', '--include-crds']
ohhh it runs helm template
.... nice...helm template
then it does the magic like with k8s APIbillowy-army-68599
Capabilities.KubeVersion
to detect which API version to use. I linked that here:
https://github.com/helm/charts/blob/master/stable/nginx-ingress/templates/_helpers.tpl#L95-L103
@bland-lamp-16797 your setup, for whatever reason isn't detecting the version correctly which was why I asked for which kubectl
version you have. I would try and use helm template
to see what the chart that's generated isbland-lamp-16797
06/10/2020, 9:11 PMhelm fetch
and compared with master branch of the chart.
The difference is, that i've pin it with version "_0.30.0_" and foolishly enough believing that is Chart version that i need.
However ladies and gentlemen, that is not chart version, that is appversion. Appversion is... huh...
I've just changed 0.30.0
version to 1.36.3
and magically started to work how it should 🤦♂️