Skaffold config dependencies with profiles

1/7/2022

I have a microservice application in one repo that communicates with another service that's managed by another repo. This is not an issue when deploying to cloud, however, when devving locally the other service needs to be deployed too.

I've read this documentation: https://skaffold.dev/docs/design/config/#remote-config-dependency and this seems like a clean solution, but I only want it to depend on the git skaffold config if deploying locally (i.e. current context is "minikube").

Is there a way to do this?

-- WIlliam
google-kubernetes-engine
kubernetes
skaffold

1 Answer

1/7/2022

Profiles can be automatically activated based on criteria such as environment variables, kube-context names, and the Skaffold command being run.

Profiles are processed after resolving the config dependencies though. But you could have your remote config include a profile that is contingent on a kubeContext: minikube.

Another alternative is to have several skaffold.yamls: one for prod, one for dev.

-- Brian de Alwis
Source: StackOverflow