-
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 #1656 from priyawadhwa/local
Added local execution environment to docker builder plugin
- Loading branch information
Showing
9 changed files
with
180 additions
and
0 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
integration/examples/test-plugin/local/docker/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.10.1-alpine3.7 as builder | ||
COPY app.go . | ||
RUN go build -o /app . | ||
|
||
FROM alpine:3.7 | ||
CMD ["./app"] | ||
COPY --from=builder /app . |
17 changes: 17 additions & 0 deletions
17
integration/examples/test-plugin/local/docker/leeroy-app/app.go
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) | ||
} |
35 changes: 35 additions & 0 deletions
35
integration/examples/test-plugin/local/docker/leeroy-app/kubernetes/deployment.yaml
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,35 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: leeroy-app | ||
labels: | ||
app: leeroy-app | ||
spec: | ||
clusterIP: None | ||
ports: | ||
- port: 50051 | ||
name: leeroy-app | ||
selector: | ||
app: leeroy-app | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: leeroy-app | ||
labels: | ||
app: leeroy-app | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: leeroy-app | ||
template: | ||
metadata: | ||
labels: | ||
app: leeroy-app | ||
spec: | ||
containers: | ||
- name: leeroy-app | ||
image: gcr.io/k8s-skaffold/leeroy-app | ||
ports: | ||
- containerPort: 50051 |
7 changes: 7 additions & 0 deletions
7
integration/examples/test-plugin/local/docker/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.10.1-alpine3.7 as builder | ||
COPY web.go . | ||
RUN go build -o /web . | ||
|
||
FROM alpine:3.7 | ||
CMD ["./web"] | ||
COPY --from=builder /web . |
37 changes: 37 additions & 0 deletions
37
integration/examples/test-plugin/local/docker/leeroy-web/kubernetes/deployment.yaml
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,37 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: leeroy-web | ||
labels: | ||
app: leeroy-web | ||
spec: | ||
type: NodePort | ||
ports: | ||
- port: 8080 | ||
targetPort: 8080 | ||
protocol: TCP | ||
name: leeroy-web | ||
selector: | ||
app: leeroy-web | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: leeroy-web | ||
labels: | ||
app: leeroy-web | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: leeroy-web | ||
template: | ||
metadata: | ||
labels: | ||
app: leeroy-web | ||
spec: | ||
containers: | ||
- name: leeroy-web | ||
image: gcr.io/k8s-skaffold/leeroy-web | ||
ports: | ||
- containerPort: 8080 |
26 changes: 26 additions & 0 deletions
26
integration/examples/test-plugin/local/docker/leeroy-web/web.go
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,26 @@ | ||
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) | ||
} |
19 changes: 19 additions & 0 deletions
19
integration/examples/test-plugin/local/docker/skaffold.yaml
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,19 @@ | ||
apiVersion: skaffold/v1beta5 | ||
kind: Config | ||
build: | ||
artifacts: | ||
- image: gcr.io/k8s-skaffold/leeroy-web | ||
context: ./leeroy-web/ | ||
plugin: | ||
name: docker | ||
- image: gcr.io/k8s-skaffold/leeroy-app | ||
context: ./leeroy-app/ | ||
plugin: | ||
name: docker | ||
executionEnvironment: | ||
name: local | ||
deploy: | ||
kubectl: | ||
manifests: | ||
- ./leeroy-web/kubernetes/* | ||
- ./leeroy-app/kubernetes/* |
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