https://garden.io logo
#🌱|help-and-getting-started
Garden Deploy Question
# 🌱|help-and-getting-started
c

cold-state-31010

04/13/2023, 3:44 PM
How to ask Garden to deploy a service in dev mode and its dependencies only vs. entire stack defined in garden.yml file? For example, my master garden file has configuration for all projects within our organization. I don't want all services to get deployed in K8. I want the service I'm working on being deployed in dev mode with its dependencies in regular deployed mode. Looking at the examples https://docs.garden.io/reference/commands#garden-deploy its not clear.
c

chilly-gigabyte-83853

04/13/2023, 3:51 PM
Thanks again! If I understand your question correctly, what you want to do is to deploy your service like the following:
garden deploy <my-service-name> --dev=<my-service-name>
This will instruct garden to deploy
<my-service-name>
(and all its dependencies) and start dev mode on it.
You can also pass multiple services as a list like:
garden deploy service1,service2 --dev=service1,service3
anything that doesn't depend on the services you specify in there won't be deployed.
c

cold-state-31010

04/13/2023, 3:58 PM
Thanks for your quick response. Let me give it a try and i will report the status back. Garden is awesome. It's been 2 days using it and I'm enjoying it.
c

chilly-gigabyte-83853

04/13/2023, 3:59 PM
I am glad to hear that! 🙂 Sure thing, let me know how it goes or if you have other questions. Myself or someone else from the team are always happy to help! 🌻
c

cold-state-31010

04/13/2023, 6:58 PM
Thank you. It works perfectly.
I'm playing around with development setup and see what pattern will work best. Lets say I'm working on Service A and it has dependency on Service B, C, D. At part of my feature work i will need to modify Service A for sure and may be Service B. So I set dev mode flags on both the services A, B. I'm consuming resources for C, D on EKS cluster under my namespace so thinking if it is good idea to deploy all services for generic use in the cluster. If I don't need to modify a service I don't deploy in my namespace but refer to those generic ones. I see local mode option but its a different thing. Any thoughts for achieving such working pattern?
@chilly-gigabyte-83853 any thoughts?
b

bright-policeman-43626

04/14/2023, 4:34 PM
Hey @cold-state-31010 I’m glad you are experimenting using Garden! Let me read through this thread to give you an answer✨
There are multiple scenarios you might want to evaluate, what you are doing is such a great use case of Garden though! First I would love to order some thoughts; 1. If you are working on Service A and you are only consistently updating Service B, then correct. You can totally just flag them both and deploy them in an isolated way. 2. It will depend a lot on your Team Size, is having shared services going to be beneficial if Developers can override your work when they are developing? If this doesn't sound good at all, perhaps you could implement a namespace per developer approach, were when a developer starts coding a service they can basically deploy all their own services, if you are using the sync mode, you shouldn't have problems by just doing a
garden deploy --sync
, because Garden will understand which service it needs to change every time you deploy your service. 3. If the above makes sense, feel free to make more questions about it and I can help you build that example. A couple of questions to help you a little bit more, 1. Are you guys using a mono-repo? or are your services segregated through multiple? 2. What is the end result in you guys want to achieve? Developer efficiency by having their own stack? Perhaps remote-link mode to sync with the cluster directly? Hope this helps, feel free to keep the discussion this is going to a great place ❤️
c

cold-state-31010

04/14/2023, 8:16 PM
@bright-policeman-43626 Thanks for your note. here are my thoughts: We are setting up a namespace per developer on EKS cluster where all necessary services are getting deployed. I'm not sure if I should be worried about associated cost. If each developer setup entire stack, and only modifying one or two services (because mostly people are working in features spanning 1 or 2 repos), why am I paying for using other read-only kind of services per namespace. I'm thinking about shared instances in that context. We are cleaning up dev namespaces every night. So every morning I will have to start/deploy my services from scratch. Once they are setup I'm good to go for the entire day. It's just that more I need to bootstrap, more time it takes every morning. Bootstrapping 1 or two services is done in under 5 minutes, doing entire stack takes 15 minutes. About your other questions: 1.) We are moving towards monorepo. We are not there yet. 2.) Developer efficiency is our main goal.
b

bright-policeman-43626

04/19/2023, 12:45 PM
So sorry for the time taken to answer you back @cold-state-31010, we are in KubeCon this week so been kind of disconnected. AMAZING! I love the use cases you guys are putting on Garden, Yes, yes. You can basically have those services already deployed in your cluster, there are some options you could do for that. 1. Option 1 would be that instead of re-deploying everything every morning, you could only scale down the deployments for the time being (at least for the shared services). - You could easily do so with some scripts maybe running on a CI environment? 2. Option two is that an admin (maybe you) each morning would do a deployment of the whole stack with a
garden deploy
without specifying the services, this will get the whole stack ready for your developers to start working on. 3. Any subsequent deployments your developers could do them either with a
garden deploy service1,service2
to prevent shifting the ones that are already there. 4. Maybe another option could be that those "shared" services are part of a different Garden workflow, then you can easily spin them up separately with a CI job, then your developers can work with the other subset of applications freely (they won't have to specify which services they want to deploy, because the shared ones are going to be handled elsewhere). Let me know if you would like me to go more in deep of any of the scenarios.
c

cold-state-31010

04/21/2023, 9:04 PM
Great. Thanks for your input. I've some ideas to move forward.
b

bright-policeman-43626

04/26/2023, 7:38 AM
Excellent @cold-state-31010 please let us know if you were able to solve this!
3 Views