GoogleContainerTools/skaffold

[Feature Request] Allow Config Override

Open

#7 938 ouverte le 12 oct. 2022

Voir sur GitHub
 (3 commentaires) (1 réaction) (0 assignés)Go (1 416 forks)batch import
area/profileshelp wantedkind/feature-requestpriority/p3

Métriques du dépôt

Stars
 (12 822 stars)
Métriques de merge PR
 (Merge moyen 1j 18h) (18 PRs mergées en 30 j)

Description

Hello Guys,

first of all thank you so much for this amazing tool! I'd like to suggest a possible advancement in the configuration: So let's say that I have a Config used by many services. For example

---
apiVersion: skaffold/v2beta29
kind: Config
metadata:
  name: postgresql
profiles:
  - name: kind-baz
    activation:
      - kubeContext: kind-baz
    deploy:
      helm:
        releases:
          - name: postgres
            repo: https://charts.bitnami.com/bitnami
            remoteChart: postgresql
            wait: true
            setValues:
              auth.enablePostgresUser: true
              auth.postgresPassword: postgres
              auth.database: foo

Usually I can include this in another config file like so

---
apiVersion: skaffold/v2beta29
kind: Config
metadata:
  name: minio
requires:
  - configs: ["postgresql"]
    path: "postgres.yaml"
profiles:
  - name: kind-baz
    activation:
      - kubeContext: kind-baz
    deploy:
      helm:
        releases:
          - name: minio
            repo: https://charts.bitnami.com/bitnami
            remoteChart: minio
            wait: true
            setValues:
              auth.rootUser: myaccesskey
              auth.rootPassword: mysecretkey
              defaultBuckets: foo-bar

This is totally fine but I believe one missing bit is the chance of overriding values in the config. Something like the following:

---
apiVersion: skaffold/v2beta29
kind: Config
metadata:
  name: minio
requires:
  - configs: ["postgresql"]
    path: "postgres.yaml"
    overrideValues:
      auth.enablePostgresUser: true
      auth.postgresPassword: bazinga
      auth.database: bazinga
profiles:
  - name: kind-baz
    activation:
      - kubeContext: kind-baz
    deploy:
      helm:
        releases:
          - name: minio
            repo: https://charts.bitnami.com/bitnami
            remoteChart: minio
            wait: true
            setValues:
              auth.rootUser: myaccesskey
              auth.rootPassword: mysecretkey
              defaultBuckets: foo-bar

In this example I've overridden all 3 values because they were already set, but I could potentially never set any default and have skaffold do the overriding job for me. In this way I could potentially fetch the base Config of postgres from another directory or anorther repository and override only what I need This would give skaffold more flexibility , unless there is another way to achieve all of this and I'm simply not aware of it. Wdyt?

Thank you

Guide contributeur