Skip to content

Commit

Permalink
skaffold demo
Browse files Browse the repository at this point in the history
  • Loading branch information
wardviaene committed Nov 21, 2019
1 parent a763e15 commit 1fe2e04
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 0 deletions.
7 changes: 7 additions & 0 deletions skaffold-demo/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 .
3 changes: 3 additions & 0 deletions skaffold-demo/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/wardviaene/kubernetes-course/skaffold-demo

go 1.13
23 changes: 23 additions & 0 deletions skaffold-demo/k8s-pod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: v1
kind: Pod
metadata:
name: skaffold-demo
labels:
app: skaffold-demo
spec:
containers:
- name: skaffold-demo
image: wardviaene/skaffold-demo
---
apiVersion: v1
kind: Service
metadata:
name: skaffold-demo
spec:
selector:
app: skaffold-demo
type: LoadBalancer
ports:
- protocol: TCP
port: 80
targetPort: 8080
16 changes: 16 additions & 0 deletions skaffold-demo/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package main

import (
"fmt"
"net/http"
)

func main() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "hello world - go crazy!")
})

fmt.Printf("Listening on port 8080\n")
http.ListenAndServe(":8080", nil)

}
9 changes: 9 additions & 0 deletions skaffold-demo/skaffold.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: skaffold/v1
kind: Config
build:
artifacts:
- image: wardviaene/skaffold-demo
deploy:
kubectl:
manifests:
- k8s-*

0 comments on commit 1fe2e04

Please sign in to comment.