-
Notifications
You must be signed in to change notification settings - Fork 684
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 #154 from datawire/lukeshu/rhs/k8s-args/kubeapply
k8s-args: Part 2A: Add {{image}} function to kubeapply
- Loading branch information
Showing
15 changed files
with
240 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
* | ||
!go.mod | ||
!go.sum | ||
!internal/ | ||
!pkg/ | ||
!cmd/ | ||
!vendor/ |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM golang:1.12-alpine as builder | ||
WORKDIR /app | ||
|
||
COPY . . | ||
|
||
RUN go install -mod=vendor ./cmd/httptest | ||
|
||
RUN ls /go/bin | ||
|
||
FROM alpine:3.10.1 | ||
COPY --from=builder /go/bin/httptest /usr/local/bin/httptest | ||
ENTRYPOINT ["/usr/local/bin/httptest"] |
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
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package main | ||
|
||
import ( | ||
"log" | ||
"net/http" | ||
"os" | ||
) | ||
|
||
func main() { | ||
body := os.Getenv("HTTPTEST_BODY") | ||
if body == "" { | ||
body = "HTTPTEST" | ||
} | ||
|
||
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { | ||
_, err := w.Write([]byte(body)) | ||
if err != nil { | ||
log.Print(err) | ||
} | ||
}) | ||
|
||
log.Fatal(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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# @TEMPLATE@ | ||
--- | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: alt | ||
--- | ||
kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
name: httptarget | ||
namespace: alt | ||
spec: | ||
selector: | ||
pod: httptarget | ||
ports: | ||
- protocol: TCP | ||
port: 80 | ||
targetPort: 8080 | ||
--- | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: httptarget | ||
namespace: alt | ||
labels: | ||
pod: httptarget | ||
spec: | ||
containers: | ||
- name: backend | ||
image: {{image "../Dockerfile"}} | ||
ports: | ||
- containerPort: 80 | ||
env: | ||
- name: HTTPTEST_BODY | ||
value: "ALT" |
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,25 +1,26 @@ | ||
# @TEMPLATE@ | ||
--- | ||
kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
name: teleproxied-httpbin | ||
name: httptarget | ||
spec: | ||
selector: | ||
pod: teleproxied-httpbin | ||
pod: httptarget | ||
ports: | ||
- protocol: TCP | ||
port: 80 | ||
targetPort: 80 | ||
targetPort: 8080 | ||
--- | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: teleproxied-httpbin | ||
name: httptarget | ||
labels: | ||
pod: teleproxied-httpbin | ||
pod: httptarget | ||
spec: | ||
containers: | ||
- name: backend | ||
image: kennethreitz/httpbin | ||
image: {{image "../Dockerfile"}} | ||
ports: | ||
- containerPort: 80 |
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 @@ | ||
# @TEMPLATE@ | ||
--- | ||
kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
name: httptest | ||
spec: | ||
selector: | ||
pod: httptest | ||
ports: | ||
- protocol: TCP | ||
port: 80 | ||
targetPort: 8080 | ||
--- | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: httptest | ||
labels: | ||
pod: httptest | ||
spec: | ||
containers: | ||
- name: httptest | ||
image: {{image "../../Dockerfile"}} | ||
ports: | ||
- containerPort: 80 |
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.