We run several microservices on Kubernetes. After a Docker image is built and pushed to a registry, our CI pipeline updates the image tag in Git, and Argo CD or Flux detects the change and deploys it.
Right now, each service has its own Helm chart and set of templates, which creates a lot of duplication. Is there a good way to follow a DRY approach while still allowing each service to have its own configuration? For example, could we maintain one shared or unified chart with separate values files for each service? Would Kustomize be a better fit for this, or is a shared Helm chart with reusable templates more common? I'm interested in how others organize and maintain many microservices on Kubernetes.
4 Answers
Reusable library or subcharts are another good option. Put the common templates in one chart, then let each service chart depend on it and enable features through values and conditions. This keeps services separate without copying every template into every repository.
Be careful about forcing every application into one giant chart. A shared chart is useful when the services follow the same deployment model, but too many conditionals eventually make it difficult to understand and maintain. For substantially different services, separate charts that consume common components are usually cleaner. You can publish the shared charts to a registry and use automated dependency updates to keep downstream services current.
Build a shared base chart around the conventions your teams use: application name, team, ports, probes, resources, ingress, service accounts, and so on. Individual services only need to supply their values. This reduces repetition while keeping the deployment interface consistent and makes platform support easier.
A common approach is to create one generic chart containing the standard resources your services need, then provide a separate values file for each service. The chart can iterate over a collection of services, or each deployment can reference the same chart with different values. This works well with GitOps tools, especially when several related services are managed as one application.

Related Questions
Can't Load PhpMyadmin On After Server Update
Redirect www to non-www in Apache Conf
How To Check If Your SSL Cert Is SHA 1
Windows TrackPad Gestures