Skip to main content
Version: 1.16

Configure your Okteto Pipeline

Okteto Pipelines allow you to configure how your Git repositories get deployed to Okteto. You might want to use them if Okteto cannot detect how to deploy your application from your deployment manifests or simply when you want more control over how your application gets deployed.

The Okteto Pipeline is executed relative to the path where the manifest is located. This means, if the manifest is at any subfolder, the pipeline will use the context of the subfolder where the manifest is defined.

Example okteto-pipeline.yml

icon: https://apps.okteto.com/movies/icon.png
deploy:
- okteto build -t okteto.dev/api:${OKTETO_GIT_COMMIT} api
- okteto build -t okteto.dev/frontend:${OKTETO_GIT_COMMIT} frontend
- helm upgrade --install movies chart --set tag=${OKTETO_GIT_COMMIT}
devs:
- api/okteto.yaml
- frontend/okteto.yaml

Schema Reference

  • icon: the icon associated to your application in the Okteto UI (optional).
  • deploy: list of commands to deploy your application in your Kubernetes namespace. It is usually a combination of helm, kubectl, and okteto commands.
  • destroy: list of commands to be executed when the pipeline is destroyed. It can be used to release any resource created outside Okteto.
  • devs: the paths to the okteto manifests in your Git repository. This is used to fill the hints in the Develop dialog of each service (optional).

For example, the above example builds fresh docker images for the api and frontend components of the Movies App, pushes these images to the Okteto Registry and deploys the app with Helm.

Built-in tools

Okteto will run an installation job that clones your Git repository, checks out the selected branch, and executes the sequence of deploy commands. The job will fail if any of the commands in the deploy list fails.

The installation job will run in a Debian Linux container with the following tools preinstalled:

  • bash
  • cue
  • curl
  • envsubst
  • git
  • helm
  • kubectl
  • kustomize
  • make
  • okteto
  • openssh
  • wait-for-it

The installation job container is automatically configured with credentials to use the above tools on the namespace where your application is deployed.

Are we missing any binaries you use? Join our community and let us know!.

Built-in Environment Variables

The installation job also populates the following environment variables. You can refer to this in your deploy commands if needed:

  • OKTETO_NAMESPACE: the namespace where your application is going to be installed.
  • OKTETO_GIT_BRANCH: the name of the Git branch currently being deployed.
  • OKTETO_GIT_COMMIT: the SHA1 hash of the last commit of the branch.
  • OKTETO_REGISTRY_URL: the url of the Okteto Registry.
  • BUILDKIT_HOST: the address of the Okteto buildkit instance. You can use it to build your images with any CLI tool that supports Buildkit builds.