Skip to content

Commit

Permalink
Merge branch 'maina' into fix-integration-tests-dev-deployments-cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ericzzzzzzz committed Nov 22, 2022
2 parents 53b0c12 + 2b884e6 commit 708c969
Show file tree
Hide file tree
Showing 38 changed files with 400 additions and 397 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ ifeq ($(GCP_ONLY),true)
--zone $(GKE_ZONE) \
--project $(GCP_PROJECT)
endif
@ GCP_ONLY=$(GCP_ONLY) GKE_CLUSTER_NAME=$(GKE_CLUSTER_NAME) ./hack/gotest.sh -v $(REPOPATH)/integration/binpack $(REPOPATH)/integration -timeout 50m $(INTEGRATION_TEST_ARGS)
@ GCP_ONLY=$(GCP_ONLY) GKE_CLUSTER_NAME=$(GKE_CLUSTER_NAME) ./hack/gotest.sh -v $(REPOPATH)/integration -timeout 50m $(INTEGRATION_TEST_ARGS)

.PHONY: integration
integration: install integration-tests
Expand Down
6 changes: 3 additions & 3 deletions deploy/skaffold/Dockerfile.deps
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ FROM alpine:3.10 as download-kubectl
ARG ARCH
# Track default version installed by Google Cloud SDK: 406.0.0 moved to 1.22(.14)
# https://cloud.google.com/sdk/docs/release-notes
ENV KUBECTL_VERSION v1.22.14
ENV KUBECTL_VERSION v1.23.12
ENV KUBECTL_URL https://storage.googleapis.com/kubernetes-release/release/${KUBECTL_VERSION}/bin/linux/${ARCH}/kubectl
# SHAs at gs://kubernetes-release/release/${KUBECTL_VERSION}/bin/linux/${ARCH}/
COPY deploy/skaffold/digests/kubectl.${ARCH}.sha512 .
Expand All @@ -30,7 +30,7 @@ RUN chmod +x kubectl
FROM alpine:3.10 as download-helm
ARG ARCH
RUN echo arch=$ARCH
ENV HELM_VERSION v3.10.1
ENV HELM_VERSION v3.10.2
ENV HELM_URL https://storage.googleapis.com/skaffold/deps/helm/helm-${HELM_VERSION}-linux-${ARCH}.tar.gz
COPY deploy/skaffold/digests/helm.${ARCH}.sha256 .
RUN wget -O helm.tar.gz "${HELM_URL}" && sha256sum -c helm.${ARCH}.sha256
Expand Down Expand Up @@ -93,7 +93,7 @@ RUN chmod +x k3d
# Download gcloud
FROM alpine:3.10 as download-gcloud
ARG ARCH
ENV GCLOUD_VERSION 406.0.0
ENV GCLOUD_VERSION 410.0.0
ENV GCLOUD_URL https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-${GCLOUD_VERSION}-linux-GCLOUDARCH.tar.gz
# SHAs listed at https://cloud.google.com/sdk/docs/downloads-versioned-archives
COPY deploy/skaffold/digests/gcloud.${ARCH}.sha256 .
Expand Down
6 changes: 3 additions & 3 deletions deploy/skaffold/Dockerfile.deps.lts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ FROM alpine:3.10 as download-kubectl
ARG ARCH
# Track default version installed by Google Cloud SDK: 406.0.0 moved to 1.22(.14)
# https://cloud.google.com/sdk/docs/release-notes
ENV KUBECTL_VERSION v1.22.14
ENV KUBECTL_VERSION v1.23.12
ENV KUBECTL_URL https://storage.googleapis.com/kubernetes-release/release/${KUBECTL_VERSION}/bin/linux/${ARCH}/kubectl
# SHAs at gs://kubernetes-release/release/${KUBECTL_VERSION}/bin/linux/${ARCH}/
COPY deploy/skaffold/digests/kubectl.${ARCH}.sha512 .
Expand All @@ -30,7 +30,7 @@ RUN chmod +x kubectl
FROM alpine:3.10 as download-helm
ARG ARCH
RUN echo arch=$ARCH
ENV HELM_VERSION v3.10.1
ENV HELM_VERSION v3.10.2
ENV HELM_URL https://storage.googleapis.com/skaffold/deps/helm/helm-${HELM_VERSION}-linux-${ARCH}.tar.gz
COPY deploy/skaffold/digests/helm.${ARCH}.sha256 .
RUN wget -O helm.tar.gz "${HELM_URL}" && sha256sum -c helm.${ARCH}.sha256
Expand All @@ -57,7 +57,7 @@ RUN chmod +x kpt
# Download gcloud
FROM alpine:3.10 as download-gcloud
ARG ARCH
ENV GCLOUD_VERSION 406.0.0
ENV GCLOUD_VERSION 410.0.0
ENV GCLOUD_URL https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-${GCLOUD_VERSION}-linux-GCLOUDARCH.tar.gz
# SHAs listed at https://cloud.google.com/sdk/docs/downloads-versioned-archives
COPY deploy/skaffold/digests/gcloud.${ARCH}.sha256 .
Expand Down
2 changes: 1 addition & 1 deletion deploy/skaffold/digests/gcloud.amd64.sha256
Original file line number Diff line number Diff line change
@@ -1 +1 @@
dc6b2319d80bdeeb7a242d30b33709061608b8421e4b0238d6aeac791972ce40 gcloud.tar.gz
f22a80c952a7b0ad561c06b207c91be74e738fc9e365a2bf3ea841369c46917d gcloud.tar.gz
2 changes: 1 addition & 1 deletion deploy/skaffold/digests/helm.amd64.sha256
Original file line number Diff line number Diff line change
@@ -1 +1 @@
c12d2cd638f2d066fec123d0bd7f010f32c643afdf288d39a4610b1f9cb32af3 helm.tar.gz
2315941a13291c277dac9f65e75ead56386440d3907e0540bf157ae70f188347 helm.tar.gz
2 changes: 1 addition & 1 deletion deploy/skaffold/digests/kubectl.amd64.sha512
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1db59414e8e352ddf53968cc38f7bb195f17c6bae6c804fecb394870f005e3a495ab0b1de98b541dae691fd5463c62a275247e5ae867a8c57577ed0363d245f8 kubectl
159a28f728926654c2b4a7790c2d9227e0f755f111488dfa4ba76eb8e8f2501b1dde88762fb2983ca81622aec20b8a6c800fa34122b5e637ece7e0266b03bebb kubectl
142 changes: 122 additions & 20 deletions docs-v2/content/en/docs/install/_index.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,87 @@
---
title: "Installing Skaffold v2.0.0 [NEW]"
linkTitle: "Installing Skaffold v2.0.0 [NEW]"
title: "Installing Skaffold"
linkTitle: "Installing Skaffold"
weight: 10
aliases: [/docs/getting-started]
---

{{< alert title="Note" >}}

To keep Skaffold up to date, update checks are made to Google servers to see if a new version of
Skaffold is available.

You can turn this update check off by following [these instructions]({{<relref "/docs/references/privacy#update-check">}}).

To help prioritize features and work on improving Skaffold, we collect anonymized Skaffold usage data.
You can opt out of data collection by following [these instructions]({{<relref "/docs/resources/telemetry">}}).

Your use of this software is subject to the [Google Privacy Policy](https://policies.google.com/privacy)

{{< /alert >}}

### Managed IDE

{{% tabs %}}

{{% tab "CLOUD CODE" %}}

[Cloud Code](https://cloud.google.com/code) provides a managed experience of using Skaffold in supported IDEs. You can install the `Cloud Code` extension for [Visual Studio Code](https://cloud.google.com/code/docs/vscode/quickstart-k8s#installing) or the plugin for [JetBrains IDEs](https://cloud.google.com/code/docs/intellij/quickstart-k8s#installing_the_plugin). It manages and keeps Skaffold up-to-date, along with other common dependencies, and works with any kubernetes cluster.

{{% /tab %}}

{{% tab "GOOGLE CLOUD SHELL" %}}

Google Cloud Platform's [_Cloud Shell_](http://cloud.google.com/shell)
provides a free [browser-based terminal/CLI and editor](https://cloud.google.com/shell#product-demo)
with Skaffold, Minikube, and Docker pre-installed.
(Requires a [Google Account](https://accounts.google.com/SignUp).)

Cloud Shell is a great way to try Skaffold out.

[![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://ssh.cloud.google.com/cloudshell/editor?shellonly=true&cloudshell_git_repo=https%3A%2F%2Fgithub.com%2FGoogleContainerTools%2Fskaffold&cloudshell_working_dir=examples%2Fgetting-started)

{{% /tab %}}

{{% /tabs %}}

### Standalone binary

{{% tabs %}}

{{% tab "LINUX" %}}
The latest **stable** v2.0.0 beta binaries can be found here:
- Linux x86_64 (amd64): https://storage.googleapis.com/skaffold/releases/v2.0.0/skaffold-linux-amd64
- Linux ARMv8 (arm64): https://storage.googleapis.com/skaffold/releases/v2.0.0/skaffold-linux-arm64
The latest **stable** binaries can be found here:

- Linux x86_64 (amd64): https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64
- Linux ARMv8 (arm64): https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-arm64

Simply download the appropriate binary and add it to your `PATH`. Or, copy+paste one of the following commands in your terminal:

```bash
# For Linux x86_64 (amd64)
curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/v2.0.0/skaffold-linux-amd64 && \
curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64 && \
sudo install skaffold /usr/local/bin/
```

```bash
# For Linux ARMv8 (arm64)
curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/v2.0.0/skaffold-linux-arm64 && \
curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-arm64 && \
sudo install skaffold /usr/local/bin/
```

We also release a v2.0.0 **bleeding edge** latest build, built from the latest commit:
We also release a **bleeding edge** build, built from the latest commit:

- Linux x86_64 (amd64): https://storage.googleapis.com/skaffold/builds/latest/skaffold-linux-amd64
- Linux ARMv8 (arm64): https://storage.googleapis.com/skaffold/builds/latest/skaffold-linux-arm64

```bash
# For Linux on x86_64 (amd64)
curl -Lo skaffold https://storage.googleapis.com/skaffold/builds/v2.0.0/skaffold-linux-amd64 && \
curl -Lo skaffold https://storage.googleapis.com/skaffold/builds/latest/skaffold-linux-amd64 && \
sudo install skaffold /usr/local/bin/
```

```bash
# For Linux on ARMv8 (arm64)
curl -Lo skaffold https://storage.googleapis.com/skaffold/builds/v2.0.0/skaffold-linux-arm64 && \
curl -Lo skaffold https://storage.googleapis.com/skaffold/builds/latest/skaffold-linux-arm64 && \
sudo install skaffold /usr/local/bin/
```

Expand All @@ -50,24 +91,24 @@ sudo install skaffold /usr/local/bin/

The latest **stable** binaries can be found here:

- Darwin x86_64 (amd64): https://storage.googleapis.com/skaffold/releases/v2.0.0/skaffold-darwin-amd64
- Darwin ARMv8 (arm64): https://storage.googleapis.com/skaffold/releases/v2.0.0/skaffold-darwin-arm64
- Darwin x86_64 (amd64): https://storage.googleapis.com/skaffold/releases/latest/skaffold-darwin-amd64
- Darwin ARMv8 (arm64): https://storage.googleapis.com/skaffold/releases/latest/skaffold-darwin-arm64

Simply download the appropriate binary and add it to your `PATH`. Or, copy+paste one of the following commands in your terminal:

```bash
# For macOS on x86_64 (amd64)
curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/v2.0.0/skaffold-darwin-amd64 && \
curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-darwin-amd64 && \
sudo install skaffold /usr/local/bin/
```

```bash
# For macOS on ARMv8 (arm64)
curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/v2.0.0/skaffold-darwin-arm64 && \
curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-darwin-arm64 && \
sudo install skaffold /usr/local/bin/
```

We also release a v2.0.0 **bleeding edge** build, built from the latest commit:
We also release a **bleeding edge** build, built from the latest commit:

- Darwin x86_64 (amd64): https://storage.googleapis.com/skaffold/builds/latest/skaffold-darwin-amd64
- Darwin ARMv8 (arm64): https://storage.googleapis.com/skaffold/builds/latest/skaffold-darwin-arm64
Expand All @@ -83,32 +124,93 @@ sudo install skaffold /usr/local/bin/
curl -Lo skaffold https://storage.googleapis.com/skaffold/builds/latest/skaffold-darwin-arm64 && \
sudo install skaffold /usr/local/bin/
```
{{% /tab %}}

Skaffold is also kept up to date on a few central package managers:

### Homebrew

```bash
brew install skaffold
```

### MacPorts

```bash
sudo port install skaffold
```

{{% /tab %}}

{{% tab "WINDOWS" %}}

The latest **stable** release binary can be found here:

https://storage.googleapis.com/skaffold/releases/v2.0.0/skaffold-windows-amd64.exe
https://storage.googleapis.com/skaffold/releases/latest/skaffold-windows-amd64.exe

Simply download it and place it in your `PATH` as `skaffold.exe`.

We also release a **bleeding edge** build, built from the latest commit:

https://storage.googleapis.com/skaffold/builds/latest/skaffold-windows-amd64.exe

---

### Scoop

Skaffold can be installed using the [Scoop package manager](https://scoop.sh/)
from the [extras bucket](https://github.com/lukesampson/scoop-extras#readme).
This package is not maintained by the Skaffold team.

```powershell
scoop bucket add extras
scoop install skaffold
```

### Chocolatey

Skaffold can be installed using the [Chocolatey package manager](https://chocolatey.org/packages/skaffold).
This package is not maintained by the Skaffold team.

{{< alert title="Caution" >}}

Chocolatey's installation mechanism interferes with <kbd>Ctrl</kbd>+<kbd>C</kbd> handling
and [prevents Skaffold from cleaning up deployments](https://github.com/GoogleContainerTools/skaffold/issues/4815).
This cannot be fixed by Skaffold.
For more information about this defect see
[chocolatey/shimgen#32](https://github.com/chocolatey/shimgen/issues/32).

{{< /alert >}}

```bash
choco install -y skaffold
```
{{% /tab %}}

{{% tab "GCLOUD" %}}

If you have the Google Cloud SDK installed on your machine, you can quickly install Skaffold as a bundled component.

Make sure your gcloud installation and the components are up to date:

`gcloud components update`

Then, install Skaffold:

`gcloud components install skaffold`

{{% /tab %}}

{{% tab "DOCKER" %}}

### Stable binary

For the latest v2.0.0 beta **stable** release, you can use:
For the latest **stable** release, you can use:

`docker run gcr.io/k8s-skaffold/skaffold/v2:latest skaffold <command>`
`docker run gcr.io/k8s-skaffold/skaffold:latest skaffold <command>`

### Bleeding edge binary

For the latest v2.0.0 **bleeding edge** build:
For the latest **bleeding edge** build:

`docker run gcr.io/k8s-skaffold/skaffold:edge skaffold <command>`

Expand Down
7 changes: 4 additions & 3 deletions docs-v2/content/en/docs/pipeline-stages/deployers/helm.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@ Skaffold supports projects set up to render and/or deploy with Helm, but certain
Skaffold no longer requires the intricate configuring of `artifactOverrides` or `imageStrategy` fields. See docs [here]({{< relref "#image-reference-strategies" >}}) on how old `artifactOverrides` and `imageStrategy` values translate to `setValues` entires in the latest Skaffold schemas (`apiVersion: skaffold/v3alpha1` or skaffold binary version `v2.0.0` onwards)
{{< /alert >}}

{{< alert title="In Skaffold `v2` the primary difference between the helm renderer (`manifest.helm.*`) and the helm deployer `deploy.helm.*` is the use of `helm install` vs `helm install`" >}}
{{< alert title="Note" >}}
In Skaffold `v2` the primary difference between the helm renderer (`manifest.helm.*`) and the helm deployer (`deploy.helm.*`) is the use of `helm template` vs `helm install`
{{< /alert >}}

## How `helm` render support works in Skaffold
In the latest version of Skaffold, the primary methods of using `helm` templating with Skaffold involve the `deploy.helm.setValues` and the `deploy.helm.setValueTemplates` fields. `deploy.helm.setValues` supplies the key:value pair to substitute from a users `values.yaml` file (a standard `helm` file for rendering). `deploy.helm.setValueTemplates` does a similar thing only the key:value value comes from an environment variable instead of a given value. The thing to note here is that when using a value that is the same name as an artifact name, that value will be replaced by the fully qualified artifact name (eg: `image: gcr.io/example-repo/skaffold-helm-image:latest@sha256:<sha256-hash>`) for the current build (or the specified value from additional configuration eg: CLI flags or config from `skaffold.yaml`). Depending on how a user's `values.yaml` and charts specify `image: $IMAGE_TEMPLATE`, the docs [here]({{< relref "#image-reference-strategies" >}}) explain the proper `setValues` to use. When migrating from schema version `v2beta29` or less, Skaffold will automatically configure these values to continue to work.


`helm` render support in Skaffold is accomplished by calling `helm install ...` and using the `skaffold` binary as a `helm` `--post-renderer`. This works by having Skaffold run `helm install ...` taking into consideration all of the supplied flags, skaffold.yaml configuration, etc. and creating an intermediate yaml manifest with all helm replacements except that the fully qualified image from the current run is NOT added but instead a placeholder with the artifact name - eg: `skaffold-helm-image`. Then the skaffold post-renderer is called to convert `image: skaffold-helm-image` -> `image: gcr.io/example-repo/skaffold-helm-image:latest@sha256:<sha256-hash>` in specified locations (specific allowlisted k8s objects and/or k8s object fields). This above replacement is nearly identical to how it works for values.yaml files using only the `image` key in `values.yaml` - eg:
`helm` deploy support in Skaffold is accomplished by calling `helm install ...` and using the `skaffold` binary as a `helm` `--post-renderer`. This works by having Skaffold run `helm install ...` taking into consideration all of the supplied flags, skaffold.yaml configuration, etc. and creating an intermediate yaml manifest with all helm replacements except that the fully qualified image from the current run is NOT added but instead a placeholder with the artifact name - eg: `skaffold-helm-image`. Then the skaffold post-renderer is called to convert `image: skaffold-helm-image` -> `image: gcr.io/example-repo/skaffold-helm-image:latest@sha256:<sha256-hash>` in specified locations (specific allowlisted k8s objects and/or k8s object fields). This above replacement is nearly identical to how it works for values.yaml files using only the `image` key in `values.yaml` - eg:
`image: "{{.Values.image}}"`

When using `image.repoistory` + `image.tag` or `image.registry` + `image.repository` + `image.tag` - eg:
Expand Down Expand Up @@ -249,7 +250,7 @@ spec:

Skaffold will invoke
```
helm install <chart> <chart-path> --set-string image.registry=<artifact-name>,image.repository=<artifact-name>,tag=<artifcact-name> --post-renderer=<path-to-skaffold-binary-from-original-invocation>
helm install <chart> <chart-path> --set-string image.registry=<artifact-name>,image.repository=<artifact-name>,image.tag=<artifact-name>,image2.registry=<artifact-name>,image2.repository=<artifact-name>,image2.tag=<artifcact-name> --post-renderer=<path-to-skaffold-binary-from-original-invocation>
```

### Helm Build Dependencies
Expand Down
5 changes: 3 additions & 2 deletions docs-v2/content/en/docs/pipeline-stages/renderers/helm.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ Skaffold supports projects set up to render and/or deploy with Helm, but certain
Skaffold no longer requires the intricate configuring of `artifactOverrides` or `imageStrategy` fields. See docs [here]({{< relref "#image-reference-strategies" >}}) on how old `artifactOverrides` and `imageStrategy` values translate to `setValues` entires in the latest Skaffold schemas (`apiVersion: skaffold/v3alpha1` or skaffold binary version `v2.0.0` onwards)
{{< /alert >}}

{{< alert title="In Skaffold `v2` the primary difference between the helm renderer (`manifest.helm.*`) and the helm deployer `deploy.helm.*` is the use of `helm template` vs `helm install`" >}}
{{< alert title="Note" >}}
In Skaffold `v2` the primary difference between the helm renderer (`manifest.helm.*`) and the helm deployer (`deploy.helm.*`) is the use of `helm template` vs `helm install`
{{< /alert >}}

## How `helm` render support works in Skaffold
Expand Down Expand Up @@ -249,7 +250,7 @@ spec:

Skaffold will invoke
```
helm template <chart> <chart-path> --set-string image.registry=<artifact-name>,image.repository=<artifact-name>,tag=<artifcact-name> --post-renderer=<path-to-skaffold-binary-from-original-invocation>
helm template <chart> <chart-path> --set-string image.registry=<artifact-name>,image.repository=<artifact-name>,image.tag=<artifact-name>,image2.registry=<artifact-name>,image2.repository=<artifact-name>,image2.tag=<artifact-name> --post-renderer=<path-to-skaffold-binary-from-original-invocation>
```

### Helm Build Dependencies
Expand Down
8 changes: 7 additions & 1 deletion docs-v2/content/en/docs/quickstart/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ weight: 20
{{% tab "STANDALONE" %}}

Follow this tutorial if you're using the Skaffold [standalone binary]({{< relref "../install/#standalone-binary" >}}). It walks through running Skaffold on a small Kubernetes app built with [Docker](https://www.docker.com/) inside [minikube](https://minikube.sigs.k8s.io)
and deployed with [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/)! To learn how to generate a new project with previously built-in structure and features, see the [Google Cloud Solutions Template](https://github.com/GoogleCloudPlatform/solutions-template).
and deployed with [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/)!

{{< alert title="Note" >}}
If you are looking to generate a new project templated to use Skaffold best-practicees and features, see the [Google Cloud Solutions Template](https://github.com/GoogleCloudPlatform/solutions-template).
{{< /alert >}}



This tutorial uses minikube as Skaffold knows how to build the app using the Docker daemon hosted
inside minikube and thus avoiding any need for a registry to host the app's container images.
Expand Down
Loading

0 comments on commit 708c969

Please sign in to comment.