-
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.
fix: correct issue where skaffold setTemplateValues env vars were in …
…some cases empty
- Loading branch information
1 parent
b51d82c
commit 1e3826d
Showing
15 changed files
with
264 additions
and
36 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
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 was deleted.
Oops, something went wrong.
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
12 changes: 12 additions & 0 deletions
12
integration/testdata/helm-statefulset-v1-schema/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,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.10 | ||
# 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 . |
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,39 @@ | ||
### Example: deploy multiple releases with Helm | ||
|
||
[![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://ssh.cloud.google.com/cloudshell/editor?cloudshell_git_repo=https://github.com/GoogleContainerTools/skaffold&cloudshell_open_in_editor=README.md&cloudshell_workspace=examples/helm-deployment) | ||
|
||
You can deploy multiple releases with skaffold, each will need a chartPath, a values file, and namespace. | ||
Skaffold can inject intermediate build tags in the the values map in the skaffold.yaml. | ||
|
||
Let's walk through the skaffold yaml: | ||
|
||
We'll be building an image called `skaffold-helm`, and it's a dockerfile, so we'll add it to the artifacts. | ||
|
||
```yaml | ||
build: | ||
artifacts: | ||
- image: skaffold-helm | ||
``` | ||
Now, we want to deploy this image with helm. | ||
We add a new release in the helm part of the deploy stanza. | ||
```yaml | ||
deploy: | ||
helm: | ||
releases: | ||
- name: skaffold-helm | ||
chartPath: charts | ||
# namespace: skaffold | ||
artifactOverrides: | ||
image: skaffold-helm | ||
valuesFiles: | ||
- values.yaml | ||
``` | ||
This part tells Skaffold to set the `image` parameter of the values file to the built `skaffold-helm` image and tag. | ||
|
||
```yaml | ||
artifactOverrides: | ||
image: skaffold-helm | ||
``` |
4 changes: 4 additions & 0 deletions
4
integration/testdata/helm-statefulset-v1-schema/charts/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: Skaffold example with Helm | ||
name: skaffold-helm | ||
version: 0.1.0 |
18 changes: 18 additions & 0 deletions
18
integration/testdata/helm-statefulset-v1-schema/charts/templates/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,18 @@ | ||
apiVersion: apps/v1 | ||
kind: StatefulSet | ||
metadata: | ||
name: {{ .Chart.Name }} | ||
spec: | ||
serviceName: {{ .Chart.Name }} | ||
replicas: 2 | ||
selector: | ||
matchLabels: | ||
app: {{ .Chart.Name }} | ||
template: | ||
metadata: | ||
labels: | ||
app: {{ .Chart.Name }} | ||
spec: | ||
containers: | ||
- name: {{ .Chart.Name }} | ||
image: "{{.Values.image.repository}}:{{.Values.image.tag}}" |
7 changes: 7 additions & 0 deletions
7
integration/testdata/helm-statefulset-v1-schema/charts/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,7 @@ | ||
# Default values for skaffold-helm. | ||
# This is a YAML-formatted file. | ||
# Declare variables to be passed into your templates. | ||
image: | ||
registry: gcr.io | ||
repository: other-project/other-image | ||
tag: latest |
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 counter := 0; ; counter++ { | ||
fmt.Println("Hello world!", counter) | ||
|
||
time.Sleep(time.Second * 1) | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
integration/testdata/helm-statefulset-v1-schema/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,15 @@ | ||
apiVersion: skaffold/v2beta29 | ||
kind: Config | ||
build: | ||
artifacts: | ||
- image: gcr.io/k8s-skaffold/skaffold-helm | ||
deploy: | ||
helm: | ||
releases: | ||
- name: skaffold-helm | ||
chartPath: charts | ||
artifactOverrides: | ||
image: gcr.io/k8s-skaffold/skaffold-helm | ||
imageStrategy: | ||
helm: {} | ||
|
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