github.com/GoogleContainerTools/skaffold/v2@v2.13.2/integration/testdata/skaffold-in-cluster/README.md (about) 1 # Skaffold in-cluster test data 2 3 Skaffold aims to be used as a buildstep in CI/CD pipelines. 4 What if this pipeline step is running inside a K8s cluster? 5 6 In that case Skaffold needs to be able to work with an in-cluster k8s context to setup the secret and to create the pod for a kaniko build. 7 This test case is testing that flow. 8 9 The `skaffold.yaml` describes _both_ the creation of an imaginary buildstep. 10 The buildstep is implemented with a k8s Job under `build-step` and an image, 11 `us-central1-docker.pkg.dev/k8s-skaffold/testing/skaffold-in-cluster-builder` that contains the freshly built version of skaffold and kubectl. 12 13 The build target that the buildstep is building using kaniko is a simple `Dockerfile` under `test-build`. 14 15 The flow of the integration test is thus: 16 17 `buildtest -> skaffold run -p create-build-step -> creates job -> creates pod -> skaffold build -p build-step -> kicks off kaniko pod to build test-build` 18 19 Thus at the end we should have a successfully completed job. 20 21 ## Careful with changes when manually testing 22 23 The test does some mutations in the file system, that you don't want to accidentally commit: 24 - copies the latest skaffold binary 25 - replaces the cluster namespace in the skaffold.yaml 26 - replaces the cluster namespace in the build-step/kustomization.yaml 27 28 29 ## On templating the cluster namespace 30 31 This is admittedly ugly. We need to come up with a nice way to express overrides for cluster namespace.