Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Kustomize example with an image built by skaffold #3901

Merged
merged 2 commits into from
Apr 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions integration/examples/getting-started-kustomize/Dockerfile
Original file line number Diff line number Diff line change
@@ -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 .
4 changes: 4 additions & 0 deletions integration/examples/getting-started-kustomize/README.md
Original file line number Diff line number Diff line change
@@ -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`.

19 changes: 19 additions & 0 deletions integration/examples/getting-started-kustomize/deployment.yaml
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
resources:
- deployment.yaml
patches:
- patch.yaml
14 changes: 14 additions & 0 deletions integration/examples/getting-started-kustomize/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package main

import (
"fmt"
"time"
)

func main() {
for {
fmt.Println("Hello world!")

time.Sleep(time.Second * 1)
}
}
10 changes: 10 additions & 0 deletions integration/examples/getting-started-kustomize/patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: skaffold-kustomize
spec:
template:
spec:
containers:
- name: skaffold-kustomize
image: hello-world
9 changes: 9 additions & 0 deletions integration/examples/getting-started-kustomize/skaffold.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: skaffold/v2beta1
kind: Config
metadata:
name: getting-started-kustomize
build:
artifacts:
- image: hello-world
deploy:
kustomize: {}
5 changes: 5 additions & 0 deletions integration/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down