fresh-yak-35965
06/07/2024, 7:26 PMyaml
kind: Deploy
type: kubernetes
name: cockroach-db
dependencies:
- deploy.cockroach-setup
spec:
namespace: kraken-${environment.namespace}
files:
- database.yml
portForwards:
- name: webui
resource: Service/cockroachdb
targetPort: 8080
localPort: 8999
This deploy attempts to create the portForwards before the crd resource it's deploying (a StatefulSet) is deployed. Thus it spams my console with errors until the service is up. How do I prevent this?microscopic-river-74022
06/07/2024, 7:26 PMmicroscopic-river-74022
06/07/2024, 7:27 PMportForwards
configuration in your manifest is used to manually specify port forwards that Garden should set up when deploying in dev or watch mode. If specified, these override the auto-detection of forwardable ports, so you'll need to specify the full list of port forwards to create.
However, the documentation does not provide a direct solution to prevent the console from being spammed with errors when the service is not up yet. It seems that this behavior is inherent to how Garden sets up port forwarding.
One possible workaround could be to ensure that the service is up before deploying the portForwards
. This could potentially be achieved by using Garden's dependencies feature to ensure that the service is deployed before the portForwards
are set up. However, this would likely require restructuring your Garden configuration and possibly splitting the service deployment and port forwarding into separate modules.
For more specific guidance, you may want to reach out to the Garden community or support. They may be able to provide more detailed advice based on their knowledge of the tool's internals and best practices.
Sources:
- Garden Kubernetes Deploy Documentation ()
- Garden Helm Deploy Documentation ()
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------microscopic-river-74022
06/07/2024, 7:27 PM