Documentation
¶
Index ¶
- Constants
- Variables
- func AddManifestTransform(newTransform ManifestTransform)
- func ApplyDefaultRepo(globalConfig string, defaultRepo *string, tag string) (string, error)
- func IsHelmChart(path string) bool
- func IsKustomizationBase(path string) bool
- func IsKustomizationPath(path string) bool
- func WithLogFile(filename string, out io.Writer, muted Muted) (io.Writer, func(error), error)
- type Artifact
- type Config
- type DefaultLabeller
- type Deployer
- type DeployerMux
- func (m DeployerMux) Cleanup(ctx context.Context, w io.Writer) error
- func (m DeployerMux) Dependencies() ([]string, error)
- func (m DeployerMux) Deploy(ctx context.Context, w io.Writer, as []build.Artifact) ([]string, error)
- func (m DeployerMux) Render(ctx context.Context, w io.Writer, as []build.Artifact, offline bool, ...) error
- type HelmDeployer
- func (h *HelmDeployer) Cleanup(ctx context.Context, out io.Writer) error
- func (h *HelmDeployer) Dependencies() ([]string, error)
- func (h *HelmDeployer) Deploy(ctx context.Context, out io.Writer, builds []build.Artifact) ([]string, error)
- func (h *HelmDeployer) Render(ctx context.Context, out io.Writer, builds []build.Artifact, offline bool, ...) error
- type KptDeployer
- func (k *KptDeployer) Cleanup(ctx context.Context, out io.Writer) error
- func (k *KptDeployer) Dependencies() ([]string, error)
- func (k *KptDeployer) Deploy(ctx context.Context, out io.Writer, builds []build.Artifact) ([]string, error)
- func (k *KptDeployer) Render(ctx context.Context, out io.Writer, builds []build.Artifact, _ bool, ...) error
- type KubectlDeployer
- func (k *KubectlDeployer) Cleanup(ctx context.Context, out io.Writer) error
- func (k *KubectlDeployer) Dependencies() ([]string, error)
- func (k *KubectlDeployer) Deploy(ctx context.Context, out io.Writer, builds []build.Artifact) ([]string, error)
- func (k *KubectlDeployer) Render(ctx context.Context, out io.Writer, builds []build.Artifact, offline bool, ...) error
- type KustomizeDeployer
- func (k *KustomizeDeployer) Cleanup(ctx context.Context, out io.Writer) error
- func (k *KustomizeDeployer) Dependencies() ([]string, error)
- func (k *KustomizeDeployer) Deploy(ctx context.Context, out io.Writer, builds []build.Artifact) ([]string, error)
- func (k *KustomizeDeployer) Render(ctx context.Context, out io.Writer, builds []build.Artifact, offline bool, ...) error
- type ManifestTransform
- type Muted
- type Registries
- type StatusCheckConfig
- type StatusChecker
Constants ¶
const ( K8sManagedByLabelKey = "app.kubernetes.io/managed-by" RunIDLabel = "skaffold.dev/run-id" )
const TimeFormat = "2006-01-02_15-04-05"
TimeFormat is used to name log files generated by deploy step
Variables ¶
var (
DefaultKustomizePath = "."
)
Functions ¶
func AddManifestTransform ¶ added in v0.26.0
func AddManifestTransform(newTransform ManifestTransform)
AddManifestTransform adds a transform to be applied when deploying.
func ApplyDefaultRepo ¶ added in v1.11.0
ApplyDefaultRepo applies the default repo to a given image tag.
func IsHelmChart ¶ added in v1.13.0
func IsKustomizationBase ¶ added in v1.11.4
func IsKustomizationPath ¶ added in v1.10.0
Types ¶
type DefaultLabeller ¶ added in v0.33.0
type DefaultLabeller struct {
// contains filtered or unexported fields
}
DefaultLabeller adds K8s style managed-by label and a run-specific UUID label
func NewLabeller ¶ added in v0.33.0
func NewLabeller(addSkaffoldLabels bool, customLabels []string) *DefaultLabeller
func (*DefaultLabeller) Labels ¶ added in v0.33.0
func (d *DefaultLabeller) Labels() map[string]string
func (*DefaultLabeller) RunIDSelector ¶ added in v1.9.0
func (d *DefaultLabeller) RunIDSelector() string
type Deployer ¶
type Deployer interface { // Deploy should ensure that the build results are deployed to the Kubernetes // cluster. Returns the list of impacted namespaces. Deploy(context.Context, io.Writer, []build.Artifact) ([]string, error) // Dependencies returns a list of files that the deployer depends on. // In dev mode, a redeploy will be triggered Dependencies() ([]string, error) // Cleanup deletes what was deployed by calling Deploy. Cleanup(context.Context, io.Writer) error // Render generates the Kubernetes manifests replacing the build results and // writes them to the given file path Render(context.Context, io.Writer, []build.Artifact, bool, string) error }
Deployer is the Deploy API of skaffold and responsible for deploying the build results to a Kubernetes cluster
type DeployerMux ¶ added in v1.2.0
type DeployerMux []Deployer
DeployerMux forwards all method calls to the deployers it contains. When encountering an error, it aborts and returns the error. Otherwise, it collects the results and returns it in bulk.
func (DeployerMux) Dependencies ¶ added in v1.2.0
func (m DeployerMux) Dependencies() ([]string, error)
type HelmDeployer ¶
type HelmDeployer struct { *latest.HelmDeploy // contains filtered or unexported fields }
HelmDeployer deploys workflows using the helm CLI
func NewHelmDeployer ¶
func NewHelmDeployer(cfg Config, labels map[string]string) *HelmDeployer
NewHelmDeployer returns a configured HelmDeployer
func (*HelmDeployer) Dependencies ¶ added in v0.5.0
func (h *HelmDeployer) Dependencies() ([]string, error)
Dependencies returns a list of files that the deployer depends on.
type KptDeployer ¶ added in v1.14.0
KptDeployer deploys workflows with kpt CLI
func NewKptDeployer ¶ added in v1.14.0
func NewKptDeployer(ctx Config, labels map[string]string) *KptDeployer
func (*KptDeployer) Cleanup ¶ added in v1.14.0
Cleanup deletes what was deployed by calling `kpt live destroy`.
func (*KptDeployer) Dependencies ¶ added in v1.14.0
func (k *KptDeployer) Dependencies() ([]string, error)
Dependencies returns a list of files that the deployer depends on. This does NOT include applyDir. In dev mode, a redeploy will be triggered if one of these files is updated.
func (*KptDeployer) Deploy ¶ added in v1.14.0
func (k *KptDeployer) Deploy(ctx context.Context, out io.Writer, builds []build.Artifact) ([]string, error)
Deploy hydrates the manifests using kustomizations and kpt functions as described in the render method, outputs them to the applyDir, and runs `kpt live apply` against applyDir to create resources in the cluster. `kpt live apply` supports automated pruning declaratively via resources in the applyDir.
type KubectlDeployer ¶
type KubectlDeployer struct { *latest.KubectlDeploy // contains filtered or unexported fields }
KubectlDeployer deploys workflows using kubectl CLI.
func NewKubectlDeployer ¶
func NewKubectlDeployer(cfg Config, labels map[string]string) *KubectlDeployer
NewKubectlDeployer returns a new KubectlDeployer for a DeployConfig filled with the needed configuration for `kubectl apply`
func (*KubectlDeployer) Cleanup ¶ added in v0.5.0
Cleanup deletes what was deployed by calling Deploy.
func (*KubectlDeployer) Dependencies ¶ added in v0.5.0
func (k *KubectlDeployer) Dependencies() ([]string, error)
Dependencies lists all the files that describe what needs to be deployed.
type KustomizeDeployer ¶ added in v0.7.0
type KustomizeDeployer struct { *latest.KustomizeDeploy // contains filtered or unexported fields }
KustomizeDeployer deploys workflows using kustomize CLI.
func NewKustomizeDeployer ¶ added in v0.7.0
func NewKustomizeDeployer(cfg Config, labels map[string]string) *KustomizeDeployer
func (*KustomizeDeployer) Cleanup ¶ added in v0.7.0
Cleanup deletes what was deployed by calling Deploy.
func (*KustomizeDeployer) Dependencies ¶ added in v0.7.0
func (k *KustomizeDeployer) Dependencies() ([]string, error)
Dependencies lists all the files that describe what needs to be deployed.
type ManifestTransform ¶ added in v0.27.0
type ManifestTransform func(l kubectl.ManifestList, builds []build.Artifact, registries Registries) (kubectl.ManifestList, error)
type Registries ¶ added in v1.11.4
type StatusCheckConfig ¶ added in v1.14.0
type StatusChecker ¶ added in v1.14.0
StatusChecker wait for the application to be totally deployed.
func NewStatusChecker ¶ added in v1.14.0
func NewStatusChecker(cfg StatusCheckConfig, labeller *DefaultLabeller) StatusChecker
NewStatusChecker returns a status checker which runs checks on deployments and pods.