Permalink
213 lines (194 sloc) 8.81 KB
apiVersion: skaffold/v1beta1
kind: Config
build:
# tagPolicy (beta) determines how Skaffold is going to tag your images.
# We provide a few strategies here, although you most likely won't need to care!
# The policy can `gitCommit` (beta), `sha256` (beta), `envTemplate` (beta) or `dateTime` (beta).
# If not specified, it defaults to `gitCommit: {}`.
tagPolicy:
# gitCommit tags the image with the git commit of your current repository.
gitCommit: {}
# sha256 tags the image with the checksum of the built image (image id).
# sha256: {}
# envTemplate tags the image with a configurable template string.
# The template must be in the golang text/template syntax: https://golang.org/pkg/text/template/
# The template is compiled and executed against the current environment,
# with those variables injected:
# IMAGE_NAME | Name of the image being built, as supplied in the artifacts section.
# DIGEST | Digest of the newly built image. For eg. `sha256:27ffc7f352665cc50ae3cbcc4b2725e36062f1b38c611b6f95d6df9a7510de23`.
# DIGEST_ALGO | Algorithm used by the digest: For eg. `sha256`.
# DIGEST_HEX | Digest of the newly built image. For eg. `27ffc7f352665cc50ae3cbcc4b2725e36062f1b38c611b6f95d6df9a7510de23`.
# Example
# envTemplate:
# template: "{{.RELEASE}}-{{.IMAGE_NAME}}"
# dateTime tags the image with the build timestamp.
# The format can be overridden with golang formats, see: https://golang.org/pkg/time/#Time.Format
# Default format is "2006-01-02_15-04-05.999_MST
# The timezone is by default the local timezone, this can be overridden, see https://golang.org/pkg/time/#Time.LoadLocation
# dateTime:
# format: "2006-01-02"
# timezone: "UTC"
# artifacts is a list of the actual images you're going to be building
# you can include as many as you want here.
artifacts:
# The name of the image to be built.
- image: gcr.io/k8s-skaffold/skaffold-example
# The path to your dockerfile context. Defaults to ".".
context: ../examples/getting-started
# Skaffold can sync local files with remote pods (alpha) instead
# of rebuilding the whole artifact's image. This is a mapping
# of local files to sync to remote folders.
# sync:
# '*.py': .
# Each artifact is of a given type among: `docker` (beta), `bazel` (beta), `jibMaven` (alpha) and `jibGradle` (alpha).
# If not specified, it defaults to `docker: {}`.
docker:
# Dockerfile's location relative to workspace. Defaults to "Dockerfile"
dockerfile: Dockerfile
# Key/value arguements passed to the docker build.
buildArgs:
key1: "value1"
key2: "value2"
# Images to consider as cache sources
cacheFrom:
- image1
- image2
# Dockerfile target name to build.
# target: stageName
# bazel requires bazel CLI to be installed and the artifacts sources to
# contain Bazel configuration files.
# bazel:
# target: //:skaffold_example.tar
# additional args to pass to `bazel build`
# args:
# - "arg1"
# - "arg2"
# jibMaven builds containers using the Jib plugin for Maven.
# jibMaven:
# module: modulename # selects which maven module to build, for a multimodule project
# profile: profilename # selects which maven profile to activate
# jibGradle builds containers using the Jib plugin for Gradle.
# jibGradle:
# project: projectname # selects which gradle project to build
# This next section is where you'll put your specific builder configuration.
# Valid builders are `local` (beta), `googleCloudBuild` (beta) and `kaniko` (beta).
# Defaults to `local: {}`
# Pushing the images can be skipped. If no value is specified, it'll default to
# `true` on minikube or Docker for Desktop, for even faster build and deploy cycles.
# `false` on other types of kubernetes clusters that require pushing the images.
# skaffold defers to your ~/.docker/config for authentication information.
# If you're using Google Container Registry, make sure that you have gcloud and
# docker-credentials-helper-gcr configured correctly.
#
# By default, the local builder connects to the Docker daemon with Go code to build
# images. If `useDockerCLI` is set, skaffold will simply shell out to the docker CLI.
# `useBuildkit` can also be set to activate the experimental BuildKit feature.
#
# local:
# false by default for local clusters, true for remote clusters
# push: false
# useDockerCLI: false
# useBuildkit: false
# Docker artifacts can be built on Google Cloud Build. The projectId then needs
# to be provided and the currently logged user should be given permissions to trigger
# new builds on Cloud Build.
# If the projectId is not provided, Skaffold will try to guess it from the image name.
# For eg. If the artifact image name is gcr.io/myproject/image, then Skaffold will use
# the `myproject` GCP project.
# All the other parameters are also optional. The default values are listed here:
# googleCloudBuild:
# projectId: YOUR_PROJECT
# diskSizeGb: 200
# machineType: "N1_HIGHCPU_8"|"N1_HIGHCPU_32"
# timeout: 10000s
# dockerImage: gcr.io/cloud-builders/docker
# Docker artifacts can be built on a Kubernetes cluster with Kaniko.
# Exactly one buildContext must be specified to use kaniko
# If localDir is specified, skaffold will mount sources directly via a emptyDir volume
# If gcsBucket is specified, skaffold will send sources to the GCS bucket provided
# Kaniko also needs access to a service account to push the final image.
# See https://github.com/GoogleContainerTools/kaniko#running-kaniko-in-a-kubernetes-cluster
# If cache is specified, kaniko will use a remote cache which will speed up builds.
# A cache repo can be specified to store cached layers, otherwise one will be inferred
# from the image name. See https://github.com/GoogleContainerTools/kaniko#caching
#
# kaniko:
# buildContext:
# gcsBucket: k8s-skaffold
# localDir: {}
# cache:
# repo: gcr.io/my-project/skaffold/cache
# pullSecret: /a/secret/path/serviceaccount.json
# pullSecretName: kaniko-secret
# namespace: default
# timeout: 20m
# image: defaults to the latest released version of `gcr.io/kaniko-project/executor`
# The deploy section has all the information needed to deploy. Along with build:
# it is a required section.
deploy:
# The type of the deployment method can be `kubectl` (beta), `helm` (beta) or `kustomize` (beta).
# The kubectl deployer uses a client side `kubectl apply` to apply the manifests to the cluster.
# You'll need a kubectl CLI version installed that's compatible with your cluster.
kubectl:
# manifests to deploy from files.
manifests:
- ../examples/getting-started/k8s-*
# kubectl can be passed additional option flags either on every command (Global),
# on creations (Apply) or deletions (Delete).
# flags:
# global: [""]
# apply: [""]
# delete: [""]
# manifests to deploy from remote cluster.
# The path to where these manifests live in remote kubernetes cluster.
# Example
# remoteManifests:
# - deployment/web-app1
# - namespace:deployment/web-app2
# kustomize:
# path: .
# kustomize deploys manifests with kubectl.
# kubectl can be passed additional option flags either on every command (Global),
# on creations (Apply) or deletions (Delete).
# flags:
# global: [""]
# apply: [""]
# delete: [""]
# helm:
# helm releases to deploy.
# releases:
# - name: skaffold-helm
# chartPath: skaffold-helm
# valuesFiles:
# - first-values-file.yaml
# - second-values-file.yaml
# values:
# image: skaffold-helm
# namespace: skaffold
# version: ""
# recreatePods: false
#
# # setValues get appended to the helm deploy with --set.
# setValues:
# key: "value"
#
# # overrides builds an override values.yaml file to run with the helm deploy
# overrides:
# some:
# key: someValue
#
# # packaged section allows to package chart setting specific version
# # and/or appVersion using "helm package" command.
# packaged:
# # version is passed to "helm package --version" flag.
# # Note that you can specify both static string or dynamic template.
# version: {{ .CHART_VERSION }}-dirty
# # appVersion is passed to "helm package --app-version" flag.
# # Note that you can specify both static string or dynamic template.
# appVersion: {{ .CHART_VERSION }}-dirty
# profiles (beta) section has all the profile information which can be used to override any build or deploy configuration
profiles:
- name: gcb
build:
googleCloudBuild:
projectId: k8s-skaffold