-
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 #2568 from GoogleContainerTools/gke_load_balancer_svc
Bring back applying labels to services deployed with helm
- Loading branch information
Showing
8 changed files
with
166 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM golang:1.12.6-alpine3.9 as builder | ||
COPY main.go . | ||
RUN go build -o /main . | ||
|
||
FROM alpine:3.9 | ||
CMD ["./main"] | ||
COPY --from=builder /main . |
4 changes: 4 additions & 0 deletions
4
integration/testdata/gke_loadbalancer/loadbalancer-helm/Chart.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,4 @@ | ||
apiVersion: v1 | ||
description: A Helm chart for Kubernetes | ||
name: loadbalancer-helm | ||
version: 0.1.0 |
37 changes: 37 additions & 0 deletions
37
integration/testdata/gke_loadbalancer/loadbalancer-helm/templates/k8s.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: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: gke-loadbalancer | ||
labels: | ||
app: gke-loadbalancer | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: gke-loadbalancer | ||
template: | ||
metadata: | ||
labels: | ||
app: gke-loadbalancer | ||
spec: | ||
containers: | ||
- name: gke-container | ||
image: {{ .Values.image }} | ||
ports: | ||
- containerPort: 3000 | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: gke-loadbalancer | ||
labels: | ||
app: gke-loadbalancer | ||
spec: | ||
type: LoadBalancer | ||
ports: | ||
- port: 80 | ||
targetPort: 3000 | ||
protocol: TCP | ||
name: http | ||
selector: | ||
app: "gke-loadbalancer" |
3 changes: 3 additions & 0 deletions
3
integration/testdata/gke_loadbalancer/loadbalancer-helm/values.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,3 @@ | ||
image: gcr.io/k8s-skaffold/gke-loadbalancer | ||
|
||
|
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, "hello!!\n") | ||
} | ||
|
||
func main() { | ||
log.Print("gke loadbalancer server ready") | ||
http.HandleFunc("/", handler) | ||
http.ListenAndServe(":3000", 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: skaffold/v1beta13 | ||
kind: Config | ||
build: | ||
artifacts: | ||
- image: gcr.io/k8s-skaffold/gke-loadbalancer | ||
context: ./ | ||
deploy: | ||
helm: | ||
releases: | ||
# seed test namespace in the release name. | ||
- name: skaffold-helm-{{.TEST_NS}} | ||
chartPath: loadbalancer-helm | ||
values: | ||
image: gcr.io/k8s-skaffold/gke-loadbalancer |
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