Name: skaffold
Owner: GoogleContainerTools
Description: Easy and Repeatable Kubernetes Development
Created: 2018-01-23 18:51:29.0
Updated: 2018-05-24 12:51:45.0
Pushed: 2018-05-24 07:30:39.0
Size: 33645
Language: Go
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Skaffold is a command line tool that facilitates continuous development for Kubernetes applications. You can iterate on your application source code locally then deploy to local or remote Kubernetes clusters. Skaffold handles the workflow for building, pushing and deploying your application. It can also be used in an automated context such as a CI/CD pipeline to leverage the same workflow and tooling when moving applications to production.
Skaffold has a pluggable architecture that allows you to choose the tools in the developer workflow that work best for you.
Updates your deployed application continually:
Runs a Skaffold pipeline once, exits on any errors in the pipeline.
Use for:
For getting started with Google Kubernetes Engine and Container Builder go here. Otherwise continue below to get started with a local Kubernetes cluster.
You will need the following components to get started with Skaffold:
skaffold
To download the latest Linux build, run:
curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64 && chmod +x skaffold && sudo mv skaffold /usr/local/bin
To download the latest OSX build, run:
curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-darwin-amd64 && chmod +x skaffold && sudo mv skaffold /usr/local/bin
Kubernetes Cluster
Minikube, GKE, Docker for Mac (Edge) and Docker for Windows (Edge) have been tested but any Kubernetes cluster will work.
If you're not using Minikube, configure the current-context with your target cluster for development
docker
Docker image registry
Your docker client should be configured to push to an external docker image repository. If you're using a minikube or Docker for Desktop cluster, you can skip this requirement.
If you are using Google Container Registry (GCR), choose one of the following:
1. Use `gcloud`'s Docker credential helper: Run [`gcloud auth configure-docker`](https://cloud.google.com/sdk/gcloud/reference/auth/configure-docker)
1. Install and configure GCR's standalone cred helper: [`docker-credential-gcr`](https://github.com/GoogleCloudPlatform/docker-credential-gcr#installation-and-usage)
1. Run `gcloud docker -a` before each development session.
Clone this repository to get access to the examples.
clone https://github.com/GoogleContainerTools/skaffold
Change directories to the getting-started
example.
xamples/getting-started
Run skaffold dev
.
affold dev
ting build...
d [minikube] context, using local docker daemon.
ing build context to Docker daemon 6.144kB
1/5 : FROM golang:1.9.4-alpine3.7
> fb6e10bf973b
2/5 : WORKDIR /go/src/github.com/GoogleContainerTools/skaffold/examples/getting-started
> Using cache
> e9d19a54595b
3/5 : CMD ./app
> Using cache
> 154b6512c4d9
4/5 : COPY main.go .
> Using cache
> e097086e73a7
5/5 : RUN go build -o app main.go
> Using cache
> 9c4622e8f0e7
essfully built 9c4622e8f0e7
essfully tagged 930080f0965230e824a79b9e7eccffbd:latest
essfully tagged gcr.io/k8s-skaffold/skaffold-example:9c4622e8f0e7b5549a61a503bf73366a9cf7f7512aa8e9d64f3327a3c7fded1b
d complete in 657.426821ms
ting deploy...
oying k8s-pod.yaml...
oy complete in 173.770268ms
ting-started] Hello world!
Skaffold has done the following for you:
Build an image from the local source code
Tag it with its sha256
Sets that image in the Kubernetes manifests defined in skaffold.yaml
Deploy the Kubernetes manifests using kubectl apply -f
You will see the output of the pod that was deployed:
ting-started] Hello world!
ting-started] Hello world!
ting-started] Hello world!
Now, update main.go
--git a/examples/getting-started/main.go b/examples/getting-started/main.go
x 64b7bdfc..f95e053d 100644
a/examples/getting-started/main.go
b/examples/getting-started/main.go
7,7 +7,7 @@ import (
c main() {
for {
fmt.Println("Hello world!")
fmt.Println("Hello jerry!")
time.Sleep(time.Second * 1)
}
Once you save the file, you should see the pipeline kick off again to redeploy your application:
ting-started] Hello jerry!
ting-started] Hello jerry!
There may be some cases where you don't want to run build and deploy continuously. To run once, use:
affold run