diff --git a/gyro/deployment.yaml b/gyro/deployment.yaml new file mode 100644 index 00000000..c9504960 --- /dev/null +++ b/gyro/deployment.yaml @@ -0,0 +1,33 @@ +apiVersion: v1 +kind: Service +metadata: + name: gyro + labels: + app: gyro +spec: + ports: + - port: 8080 + protocol: TCP + clusterIP: None + selector: + app: gyro +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: gyro + labels: + app: gyro +spec: + replicas: 1 + selector: + matchLabels: + app: gyro + template: + metadata: + labels: + app: gyro + spec: + containers: + - name: gyro + image: gyro diff --git a/skaffold.yaml b/skaffold.yaml new file mode 100644 index 00000000..d1f088ed --- /dev/null +++ b/skaffold.yaml @@ -0,0 +1,18 @@ +apiVersion: skaffold/v2beta28 +kind: Config +metadata: + name: spacecraft +build: + artifacts: + - image: gyro + context: gyro + buildpacks: + builder: gcr.io/buildpacks/builder:v1 +deploy: + kubectl: + manifests: + - gyro/deployment.yaml +portForward: +- resourceType: service + resourceName: gyro + port: 8080 diff --git a/temp-deploy/Dockerfile b/temp-deploy/Dockerfile new file mode 100644 index 00000000..415a8456 --- /dev/null +++ b/temp-deploy/Dockerfile @@ -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 . diff --git a/temp-deploy/README.md b/temp-deploy/README.md new file mode 100644 index 00000000..e69de29b diff --git a/temp-deploy/k8s-pod.yaml b/temp-deploy/k8s-pod.yaml new file mode 100644 index 00000000..27fdd679 --- /dev/null +++ b/temp-deploy/k8s-pod.yaml @@ -0,0 +1,8 @@ +apiVersion: v1 +kind: Pod +metadata: + name: getting-started +spec: + containers: + - name: getting-started + image: skaffold-example diff --git a/temp-deploy/main.go b/temp-deploy/main.go new file mode 100644 index 00000000..593721cf --- /dev/null +++ b/temp-deploy/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/temp-deploy/skaffold.yaml b/temp-deploy/skaffold.yaml new file mode 100644 index 00000000..fe95bc9c --- /dev/null +++ b/temp-deploy/skaffold.yaml @@ -0,0 +1,9 @@ +apiVersion: skaffold/v2beta28 +kind: Config +build: + artifacts: + - image: skaffold-example +deploy: + kubectl: + manifests: + - k8s-* \ No newline at end of file