Hello,
I have been trying out kpt for the past couple weeks, and appreciate the overall direction it provides towards publishing/consuming k8s config.
I am in the process of exploring how to
1. create a package of k8s config, and
2. deploy that package across many different kubernetes clusters, with only slight changes across the configuration (i.e. cluster_name: "my-cluster", environment: "dev", etc.).
Of course, kpt helps solve the first part of packaging up k8s config, but it's unclear how it can be leveraged to achieve my second goal (though I have a feeling it can be used, I'm just not thinking of it in the right way yet).
Here's an example of what I'm trying to achieve:
Say I have two k8s applications, each of which has a config variable for an S3 bucket. I'd like to deploy these two applications in many different k8s clusters. Each k8s cluster has its own S3 bucket. When both applications are deployed in the same cluster, they should be configured with the same S3 bucket that belongs to that cluster. But instances of the applications in different clusters will of course be configured with different S3 buckets.
It's unclear to me how I can achieve this with kpt and kustomize. Specifically, I dont know how to avoid copy/pasting the S3 bucket name across many different application and/or kustomization.yaml manifests (which of course is error prone). Ideally, I'd define the cluster's s3 bucket config value in one place, and then use that config value in many kustomized application instances within that cluster.
I'm wondering if:
1. Theres a way to structure the kustomize folders/overlays to achieve this, which I haven't yet considered, and/or
2. If kpt can help solve this problem in tandem with kustomize (via setters/substitutions, or functions....?)
I really appreciate any help, thoughts, and guidance you can provide in addressing this use case!
Thanks,
John