How can I reference, using a template string, the ...
# 🤖|ask-kapa
f
@microscopic-river-74022 How can I reference, using a template string, the ingress hostname of a deploy action?
m
Please stand by @fresh-yak-35965 as I search the knowledge base. I normally take about 20 seconds or so. :wave:
---------------------- In Garden, you can reference the ingress hostname of a deploy action using a template string in the configuration of your service. The specific template string for the ingress hostname is not directly provided in the knowledge sources, but you can infer it from the provided information. Here's an example of how you might set up an ingress with a hostname in a service configuration:
Copy code
yaml
kind: Deploy
name: frontend
description: Frontend service container
type: container
dependencies:
 - build.frontend
variables:
  base-hostname: "${environment.name == 'ephemeral' ? providers.ephemeral-kubernetes.outputs.default-hostname : local.demo.garden}"
spec:
  image: ${actions.build.frontend.outputs.deploymentImageId}
  ports:
    - name: http
      containerPort: 8080
  ingresses:
    - path: /
      port: http
      hostname: frontend.${var.base-hostname}
In this example, the
base-hostname
variable is set using a template string that checks the environment name and uses the appropriate hostname. The
hostname
for the ingress is then set using another template string that references this
base-hostname
variable. Please note that the exact template string to use may depend on your specific configuration and setup. For more information, you can refer to the Garden documentation (). ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
message has been deleted
2 Views