diff --git a/integration/examples/getting-started-kustomize/Dockerfile b/integration/examples/getting-started-kustomize/Dockerfile new file mode 100644 index 00000000000..d978b541f36 --- /dev/null +++ b/integration/examples/getting-started-kustomize/Dockerfile @@ -0,0 +1,7 @@ +FROM golang:1.12.9-alpine3.10 as builder +COPY main.go . +RUN go build -o /app main.go + +FROM alpine:3.10 +CMD ["./app"] +COPY --from=builder /app . diff --git a/integration/examples/getting-started-kustomize/README.md b/integration/examples/getting-started-kustomize/README.md new file mode 100644 index 00000000000..a4e5d393401 --- /dev/null +++ b/integration/examples/getting-started-kustomize/README.md @@ -0,0 +1,4 @@ +### Example: Getting started with a simple go app using Kustomize + +This is a variation of the `getting started` example, using `kustomize` to deploy instead of `kubectl`. + diff --git a/integration/examples/getting-started-kustomize/deployment.yaml b/integration/examples/getting-started-kustomize/deployment.yaml new file mode 100644 index 00000000000..2394bef9774 --- /dev/null +++ b/integration/examples/getting-started-kustomize/deployment.yaml @@ -0,0 +1,19 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: skaffold-kustomize + labels: + app: skaffold-kustomize +spec: + replicas: 1 + selector: + matchLabels: + app: skaffold-kustomize + template: + metadata: + labels: + app: skaffold-kustomize + spec: + containers: + - name: skaffold-kustomize + image: not/a/valid/image diff --git a/integration/examples/getting-started-kustomize/kustomization.yaml b/integration/examples/getting-started-kustomize/kustomization.yaml new file mode 100644 index 00000000000..88b1320b5b9 --- /dev/null +++ b/integration/examples/getting-started-kustomize/kustomization.yaml @@ -0,0 +1,4 @@ +resources: + - deployment.yaml +patches: + - patch.yaml diff --git a/integration/examples/getting-started-kustomize/main.go b/integration/examples/getting-started-kustomize/main.go new file mode 100644 index 00000000000..593721cfe2e --- /dev/null +++ b/integration/examples/getting-started-kustomize/main.go @@ -0,0 +1,14 @@ +package main + +import ( + "fmt" + "time" +) + +func main() { + for { + fmt.Println("Hello world!") + + time.Sleep(time.Second * 1) + } +} diff --git a/integration/examples/getting-started-kustomize/patch.yaml b/integration/examples/getting-started-kustomize/patch.yaml new file mode 100644 index 00000000000..92a6b8b7223 --- /dev/null +++ b/integration/examples/getting-started-kustomize/patch.yaml @@ -0,0 +1,10 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: skaffold-kustomize +spec: + template: + spec: + containers: + - name: skaffold-kustomize + image: hello-world diff --git a/integration/examples/getting-started-kustomize/skaffold.yaml b/integration/examples/getting-started-kustomize/skaffold.yaml new file mode 100644 index 00000000000..f9e3b34f250 --- /dev/null +++ b/integration/examples/getting-started-kustomize/skaffold.yaml @@ -0,0 +1,9 @@ +apiVersion: skaffold/v2beta1 +kind: Config +metadata: + name: getting-started-kustomize +build: + artifacts: + - image: hello-world +deploy: + kustomize: {} diff --git a/integration/run_test.go b/integration/run_test.go index 55fc2a5703c..09e75248a70 100644 --- a/integration/run_test.go +++ b/integration/run_test.go @@ -100,6 +100,11 @@ func TestRun(t *testing.T) { dir: "examples/buildpacks", deployments: []string{"web"}, }, + { + description: "kustomize", + dir: "examples/getting-started-kustomize", + deployments: []string{"skaffold-kustomize"}, + }, } for _, test := range tests { t.Run(test.description, func(t *testing.T) {