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

Deployment #15

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
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
33 changes: 33 additions & 0 deletions gyro/deployment.yaml
Original file line number Diff line number Diff line change
@@ -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
18 changes: 18 additions & 0 deletions skaffold.yaml
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions temp-deploy/Dockerfile
Original file line number Diff line number Diff line change
@@ -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 .
Empty file added temp-deploy/README.md
Empty file.
8 changes: 8 additions & 0 deletions temp-deploy/k8s-pod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: v1
kind: Pod
metadata:
name: getting-started
spec:
containers:
- name: getting-started
image: skaffold-example
14 changes: 14 additions & 0 deletions temp-deploy/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)
}
}
9 changes: 9 additions & 0 deletions temp-deploy/skaffold.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: skaffold/v2beta28
kind: Config
build:
artifacts:
- image: skaffold-example
deploy:
kubectl:
manifests:
- k8s-*