-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3703 from nkubala/init-k8sgen
Autogenerate k8s manifests in skaffold init
- Loading branch information
Showing
27 changed files
with
639 additions
and
113 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
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
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
skaffold.yaml.out | ||
**/deployment.yaml | ||
**/skaffold.yaml.out |
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 hello.go . | ||
RUN go build -o /app hello.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,30 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: dockerfile-image | ||
labels: | ||
app: dockerfile-image | ||
spec: | ||
clusterIP: None | ||
selector: | ||
app: dockerfile-image | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: dockerfile-image | ||
labels: | ||
app: dockerfile-image | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: dockerfile-image | ||
template: | ||
metadata: | ||
labels: | ||
app: dockerfile-image | ||
spec: | ||
containers: | ||
- name: dockerfile-image | ||
image: dockerfile-image |
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,14 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"time" | ||
) | ||
|
||
func main() { | ||
for { | ||
fmt.Println("Hello world!") | ||
|
||
time.Sleep(time.Second * 1) | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
integration/testdata/init/microservices/leeroy-app/Dockerfile
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 app.go . | ||
RUN go build -o /app . | ||
|
||
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,17 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"log" | ||
"net/http" | ||
) | ||
|
||
func handler(w http.ResponseWriter, r *http.Request) { | ||
fmt.Fprintf(w, "leeroooooy app!!\n") | ||
} | ||
|
||
func main() { | ||
log.Print("leeroy app server ready") | ||
http.HandleFunc("/", handler) | ||
http.ListenAndServe(":50051", nil) | ||
} |
7 changes: 7 additions & 0 deletions
7
integration/testdata/init/microservices/leeroy-web/Dockerfile
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 web.go . | ||
RUN go build -o /web . | ||
|
||
FROM alpine:3.10 | ||
CMD ["./web"] | ||
COPY --from=builder /web . |
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,25 @@ | ||
package main | ||
|
||
import ( | ||
"io" | ||
"net/http" | ||
|
||
"log" | ||
) | ||
|
||
func handler(w http.ResponseWriter, r *http.Request) { | ||
resp, err := http.Get("http://leeroy-app:50051") | ||
if err != nil { | ||
panic(err) | ||
} | ||
defer resp.Body.Close() | ||
if _, err := io.Copy(w, resp.Body); err != nil { | ||
panic(err) | ||
} | ||
} | ||
|
||
func main() { | ||
log.Print("leeroy web server ready") | ||
http.HandleFunc("/", handler) | ||
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
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
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
Oops, something went wrong.