Skaffold is a command line tool that facilitates continuous development for Kubernetes applications. You can iterate on your application source code locally then deploy to local or remote Kubernetes clusters.
Skaffold handles the workflow for building, pushing and deploying your application. It also provides building blocks and describe customizations for a CI/CD pipeline.
kustomize lets you customize raw, template-free YAML files for multiple purposes, leaving the original YAML untouched and usable as is.
kustomize targets kubernetes; it understands and can patch kubernetes style API objects. It’s like make, in that what it does is declared in a file, and it’s like sed, in that it emits editted text.
On macOS you can install Skaffold with Homebrew.
brew install skaffold
You can find installation instructions for other platforms here: https://github.com/GoogleContainerTools/skaffold/releases
On macOS you can install kustomize with Homebrew.
brew install kustomize
You can find installation instructions for other platforms here: https://github.com/kubernetes-sigs/kustomize/blob/master/docs/INSTALL.md
Download Skaffold’s kustomize example
Clone the Skaffold repository and cd into the kustomize example directory.
git clone [https://github.com/GoogleContainerTools/skaffold](https://github.com/GoogleContainerTools/skaffold) cd skaffold/examples/kustomize
You can run following command to deploy the application to your Kubernetes cluster.
❯ skaffold run Starting build... Build complete in 41.003µs Starting test... Test complete in 4.239µs Starting deploy... deployment.apps "kustomize-test" created Deploy complete in 3.548712675s You can also run [skaffold run --tail] to get the logs
Use skaffold dev to build and deploy your app every time your code changes.
❯ skaffold dev Starting build... Build complete in 20.354µs Starting test... Test complete in 3.863µs Starting deploy... deployment.apps "kustomize-test" unchanged Deploy complete in 531.523251ms Watching for changes every 1s...
Verify the deployment with kubectl.
❯ kubectl get pods NAME READY STATUS RESTARTS AGE kustomize-test-6557bbc789-7m57b 1/1 Running 0 1m
Clean up and remove the k8s pod.
❯ skaffold delete Cleaning up... deployment.apps "kustomize-test" deleted Cleanup complete in 5.754931332s