When is okteto deploy
recommended, and when should I use okteto pipeline deploy
?
Both okteto deploy
and okteto pipeline deploy
help you automatically deploy a remote development environment.
The major difference between commands is that okteto deploy
always uses your local files, while okteto pipeline deploy
always uses the files in your repository, ignoring local changes.
okteto deploy
(Local Mode)
When you run okteto deploy
(or when okteto up triggers deployment for you) in local mode , here’s what happens:
- The Okteto CLI fetches the required Okteto context (e.g., secrets, configurations, etc.) if needed
- Deploy steps are executed locally using your machine’s tooling and resources
- Logs from the process are streamed in real-time to your terminal
okteto deploy
(Remote Mode)
When you run okteto deploy
(or when okteto up
triggers deployment for you) in remote mode, here’s what happens:
- The Okteto CLI generates the deploy context . By default, this includes everything in your current folder. You can use an
.oktetoignore
file to exclude specific files or directories. - The deploy context is sent to your cluster (specifically, to one of the BuildKit pods running in your cluster)
- BuildKit starts an isolated job for your deployment, using the image defined in your Okteto manifest. If no image is specified, a default Okteto image is used
- The Okteto CLI fetches the required Okteto context (e.g., secrets, configurations, etc.) if needed
- Okteto executes the deploy steps inside the isolated job (all steps share the same file system)
- Logs from the job are streamed in real-time to your terminal
okteto pipeline
deploy
When you run okteto pipeline deploy
, the process looks slightly different:
- The Okteto CLI sends a request to the Okteto API in your cluster to schedule the deployment job. This includes the repository URL, branch, and any deployment variables
- The Okteto API schedules an installer job (a Kubernetes job) in your cluster, using the image defined in your Okteto Manifest. If no image is specified, the default Okteto image is used
- The installer job clones the specified repository and fetches the required Okteto context (e.g., secrets, configurations, etc.) into the job environment
- The deploy steps are executed within the installer job
- Logs are streamed to your terminal in real-time or displayed in the Okteto UI
- Notes:
okteto pipeline deploy
ignores all local changes. The deployment is based solely on the state of the repository branch. This is the equivalent of deploying from the UI.
Key Differences
okteto deploy
(Remote Mode): Runs deployment in a BuildKit-powered Kubernetes job within your cluster using your local changesokteto deploy
(Local Mode): Runs deployment locally on your machineokteto pipeline
deploy **: Runs deployment through an API-triggered Kubernetes job based on repository state, ignoring local changes