In our Helm templates, we heavily rely on the lookup function to apply data to our application templates.
One use case is that we use the lookup function to fetch the ClusterIP from our internal namespaced service to add hostAliases to our deployments and statefulsets to route http data internally instead of externally.
Expected behavior
In skaffold v1, when skaffold would directly execute helm upgrade --install, this lookup method would work as expected. With skaffold v2, we expect our use case to be still available. So when executing skaffold build and skaffold deploy, skaffold should not return an error about the lookup function or data is unavailable.
Maybe we are missing something, and is the option still available. However, I could not find any information in the documentation to use the old behaviour.
Actual behavior
Because of the helm template action in the manifest step, the lookup function is unavailable (restriction of helm template). Then executing our deployment strategy using skaffold build and skaffold deploy we now get the error that the template could not be executed properly and fails on the lookup in the templates.
The error we get is the following
Error: template: example/templates/application.yaml:31:45: executing "example/templates/application.yaml" at <$internalLoadBalancerService.spec.clusterIP>: nil pointer evaluating interface {}.clusterIP
Use --debug flag to render out invalid YAML
)
Information
Skaffold version: v2.13.1
Operating system: Mixed. macOS for development, Linux for CI/CD process
std out err: %!(EXTRA *errors.errorString=Error: template: example-chart/templates/deployment.yaml:44:45: executing "example-chart/templates/deployment.yaml" at <$internalLoadBalancerService.spec.clusterIP>: nil pointer evaluating interface {}.clusterIP
Use --debug flag to render out invalid YAML
)
When using skaffold v1.39.18, and the skaffold-v1.yaml provided below, the skaffold deploy will succeed and the correct ClusterIP should be set in the applications hostAliases settings.
Context
In our Helm templates, we heavily rely on the
lookup
function to apply data to our application templates.One use case is that we use the lookup function to fetch the ClusterIP from our internal namespaced service to add hostAliases to our deployments and statefulsets to route http data internally instead of externally.
Expected behavior
In skaffold v1, when skaffold would directly execute
helm upgrade --install
, this lookup method would work as expected. With skaffold v2, we expect our use case to be still available. So when executingskaffold build
andskaffold deploy
, skaffold should not return an error about the lookup function or data is unavailable.Maybe we are missing something, and is the option still available. However, I could not find any information in the documentation to use the old behaviour.
Actual behavior
Because of the
helm template
action in the manifest step, thelookup
function is unavailable (restriction ofhelm template
). Then executing our deployment strategy usingskaffold build
andskaffold deploy
we now get the error that thetemplate
could not be executed properly and fails on thelookup
in the templates.The error we get is the following
Information
Steps to reproduce the behavior
At first, create a simple helm chart using the files below
Apply the service below using
kubectl apply -f service.yaml -n [NAMESPACE]
Use helm to deploy the chart created earlier
helm upgrade --install example .helm --debug
The correct ClusterIP should be set in the applications
hostAliases
settings.Use skaffold to apply the helm chart, using the
skaffold.build-artifacts.json
below and the skaffold.yaml provided above.skaffold.build-artifacts.json
skaffold deploy --build-artifacts skaffold.build-artifacts.json -n [NAMESPACE]
See that you get the error
When using skaffold v1.39.18, and the
skaffold-v1.yaml
provided below, theskaffold deploy
will succeed and the correct ClusterIP should be set in the applicationshostAliases
settings.skaffold deploy --build-artifacts skaffold.build-artifacts.json -f skaffold-v1.yaml -n [NAMESPACE]