GoogleContainerTools / GoogleContainerTools/skaffold
Introduce Cluster Builder / Provider
- Dominant language
- Go
- Stars
- 15.9k
- Forks
- 1.7k
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 10
Description
### Expected behavior
Skaffold provides the concept of [profiles](https://skaffold.dev/docs/environment/profiles/) for different configuration environments. These work exceptionally well, allowing a complex matrix of configurations to be selected and merged at runtime with a simple list of selectors.
These same facilities should be available to bootstrap configuration and generation of the cluster. For instance, [KinD cluster configuration](https://kind.sigs.k8s.io/docs/user/configuration/) allows for IPv6 to be enabled. A Skaffold configuration may have a profile coupled to IPv6, but it will currently depend on the injected target cluster having been properly configured. A deployment with a large number of profiles may require a very specific cluster configuration that becomes combinatorially more complex to accurately calculate outside of Skaffold.
This issue proposes to create a [builder type](https://skaffold.dev/docs/builders/builder-types/) (or some new analogue) that generates a cluster either locally or in the cloud, such as via KinD, Minikube, GKE, AKS, etc. The optimal pattern will also allow a CM system such as Terraform to provide the k8s client config as well, although a very small set of initial builder targets are considered in current scope. Practically, this should be a very simple interface that does not replace anything, so the community will not be impacted by a small number of initial providers.
Such a feature (for instance) could negate the need for a [manual installation of a target cluster](https://skaffold.dev/docs/quickstart/#start-minikube) as in the quickstart. To do so, a default target cluster option of KinD would configure this basic generation.
### Actual behavior
At the present time, Skaffold will fail if it cannot discover a target cluster via the well-known configuration locations used by `kubectl`. It is proposed that this search is augmented by a cluster provider interface. If a cluster builder exists as part of the build steps and successfully executes, the cluster provider interface will return that configuration with some precedence in the search.
### Information
The overarching goal of this effort is to allow consolidation of build logic in Skaffold, but shall not require it. Skaffold must continue to support existing k8s client configuration discovery patterns indefinitely. On the other hand, profile-based configuration is complex to implement and already exists inside Skaffold. Exposing the constructs for container generation would be very helpful and ensure external builders do not need to track nuanced changes to profile interpretation.
Contributor guide
Assessment
This issue has not been assessed yet.