Add skaffold install and guide

This commit is contained in:
Sambo Chea 2021-10-20 08:29:50 +07:00
parent d0a57861f2
commit ae0c77e603
Signed by: sombochea
GPG Key ID: 3C7CF22A05D95490
5 changed files with 49 additions and 0 deletions

6
skaffold/README.md Normal file
View File

@ -0,0 +1,6 @@
# Install Skaffold
```shell
curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64 && \
sudo install skaffold /usr/local/bin/
```

View File

@ -0,0 +1,12 @@
FROM golang:1.15 as builder
COPY main.go .
# `skaffold debug` sets SKAFFOLD_GO_GCFLAGS to disable compiler optimizations
ARG SKAFFOLD_GO_GCFLAGS
RUN go build -gcflags="${SKAFFOLD_GO_GCFLAGS}" -o /app main.go
FROM alpine:3
# Define GOTRACEBACK to mark this container as using the Go language runtime
# for `skaffold debug` (https://skaffold.dev/docs/workflows/debug/).
ENV GOTRACEBACK=single
CMD ["./app"]
COPY --from=builder /app .

View File

@ -0,0 +1,8 @@
apiVersion: v1
kind: Pod
metadata:
name: getting-started
spec:
containers:
- name: getting-started
image: skaffold-example

14
skaffold/starter/main.go Normal file
View File

@ -0,0 +1,14 @@
package main
import (
"fmt"
"time"
)
func main() {
for {
fmt.Println("Hello world!")
time.Sleep(time.Second * 1)
}
}

View File

@ -0,0 +1,9 @@
apiVersion: skaffold/v2beta24
kind: Config
build:
artifacts:
- image: skaffold-example
deploy:
kubectl:
manifests:
- k8s-*