forked from wardviaene/kubernetes-course
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a763e15
commit 1fe2e04
Showing
5 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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-* |