Setting service type manually
# 🌱|help-and-getting-started
m
I have a Garden Module of type container that I want to deploy with a service. I want this service to be of kubernetes ServiceType LoadBalancer instead of the default ClusterIP, but I am struggling to find a way to achieve this without specifying kubernetes manifests manually as a kubernetes Module. Is there a way to specify this? In general, it would be great if it was possible to specify arbitrary kubernetes manifest fields in the Garden Module service spec. The services field will generate both deployment, service, and ingress manifests, but perhaps it could be possible to override some defaults for these at need with f.ex
Copy code
services:
  - name: blabla
    service:
      type: LoadBalancer
    deployment:
      labels:
        app: my-app
    command: /bin/bash
    ports:
      - name: http
...
b
Hey @millions-ability-962 let me take a look into this and get back to you! Thanks a lot for using Garden
m
Thank you!
q
Hi @millions-ability-962, you'll need to use the kubernetes module (or action in the Bonsai release out tomorrow). The container module is powerful but is not intended for flexibility: that's where the kubernetes and helm modules come in
m
Thanks! I did do that in the end. It's just that using the kubernetes module introduces a lot of boilerplate that I wanted to avoid and the avoidance of which was a primary motivation for using Garden. It's a shame to have to throw all that leanness away just to be able to specify one simple extra field.
q
I feel you on the boilerplate. It might be worth exploring rebasing our container type on a portable standard at some point that allows these extensions or else extending our container type itself to support
c
Also config templates can be used with all aciton/module kinds to greatly reduce boilerplate even with kubernetes or helm types https://github.com/garden-io/garden/blob/main/docs/using-garden/config-templates.md
13 Views