Skip to main content
Version: 1.28

Okteto Manifest Overview

The Okteto Manifest is how you configure the behavior for building, deploying, testing, and developing your application in Okteto. These are the main sections of the Okteto Manifest:

SectionDescription
buildConfigure a list of images to build for your application
dependenciesConfigure a list of git repositories to deploy as part of your application
deployConfigure a list of commands to deploy your application. You can also refer to Docker Compose files
destroyConfigure a list of commands to destroy your application
devConfigure a list of Development Containers to define how okteto up works when you are iterating on your application
externalConfigure a list of External Resources that exist outside of the Kubernetes cluster (e.g. cloud resources, dashboards).
testConfigure a list of Test Containers to define how okteto test runs tests for your application

There are other sections to help you build your ideal development experience in Okteto, but this document focuses solely on introducing you to the core concepts of the Okteto Manifest. You can learn more about the other Okteto Manifest options in the manifest reference.

Build

This section contains the instructions for Okteto to build the images for each service of your application.

Your build section might look like this:

build:
api:
context: api
frontend:
context: frontend
dockerfile: Dockerfile
secrets:
npmrc: .npmrc

This configuration defines images to be built for three services: api, and frontend. It also defines a context for each image, which tells Okteto which folder/subfolder to use for building each container image. In this case, Okteto is using the api subfolder for the api image, and the frontend subfolder for the frontend image. For the frontend image, it's also defining the dockerfile path and a build secret.

Refer to our documentation to learn more about the build section and how Okteto Build works.

Dependencies

This section tells Okteto to deploy a list of git repositories as part of the deployment of your application.

Your dependencies section might look like this:

dependencies:
mongodb:
repository: https://github.com/okteto/mongodb
wait: true

In this sample the dependencies section instructs Okteto to deploy the repo https://github.com/okteto/mongodb and wait until its resources are available before running the commands in the deploy section of the Okteto Manifest.

You can learn more about the dependencies section here.

Deploy

This section tells Okteto how to deploy your application. It typically uses a combination of helm, kubectl, and okteto commands. All the resources created by these commands will appear in the Okteto UI as part of a single Development Environment that represents the whole of your application.

note

If you have external resources you'd like to configure and show within the Okteto development environment, you must configure those in the external section.

Your deploy section might look like this:

deploy:
- name: Deploy PostgreSQL
command: helm upgrade --install postgresql postgresql/postgresql-11.6.21.tgz -f postgresql/values.yml --version 11.6.21
- name: Deploy Frontend
command: helm upgrade --install frontend frontend/chart --set image=${OKTETO_BUILD_FRONTEND_IMAGE}
- name: Deploy API
command: helm upgrade --install api api/chart --set image=${OKTETO_BUILD_API_IMAGE} --set load=${API_LOAD_DATA:-true}

In this sample the deploy section instructs Okteto to execute three commands: deploy a postgresql database, deploy the frontend helm chart (referring the frontend image using an environment variable), and deploy the api chart (referring the api image using an environment variables).

Refer to our documentation to learn more about the deploy section.

info

Okteto recommends that you enable Remote Execution for your deploy commands

Destroy

This section tells Okteto how to destroy your application. The Okteto CLI command okteto destroy will automatically destroy any Kubernetes resources created by the okteto deploy command. The commands you define in the destroy section will ensure any resources external to the Kubernetes cluster are destroyed when destroying the Development Environment.

Your destroy section might look like this:

destroy:
image: okteto/pipeline-runner:1.0.0-sam
commands:
- name: destroy worker service
command: |
sam delete --no-prompts --stack-name "${OKTETO_NAMESPACE}-voting-texkhnclxd" --region us-east-1

In this sample the destroy section instructs Okteto to delete the worker service running in AWS. When the application is deleted, Okteto will execute this command ensuring orphaned resources don't remain active.

You can learn more about the destroy section here.

info

Okteto recommends that you enable Remote Execution for your destroy commands

Dev

This section contains a list of Development Containers that determine how the Okteto CLI and, specifically, the okteto up command behave. This section is how Okteto hot reloads and debug the code between your local computer and your Development Environment.

Your dev section might look like this:

dev:
api:
command: ["bash"]
forward:
- 8080:8080
- 9229:9229
sync:
- api:/usr/src/app
frontend:
command: yarn start
sync:
- frontend:/usr/src/app

In this sample, the api section will tell Okteto to create a Development Container that exists specifically to sync code between your local computer and the api Kubernetes Deployment so you can see your changes in real-time within your Development Environment.

You can learn more about the dev section here.

External

This section contains a list of resources external to the Kubernetes cluster such as cloud resources or dashboards, but that are part of your application. Configuring your external resources enables you to build a more complete development experience in Okteto.

Your external section might look like this:

external:
readme:
icon: okteto
notes: README.md
endpoints:
- name: Try it out!
url: https://github.com/okteto/voting-app-with-external-resources
lambda:
icon: aws
notes: docs/lambda.md
endpoints:
- name: function

This section provides only the metadata to represent and link to external resources in the Okteto UI and does not create any resources in a cloud provider. Creating or destroying the resources themselves is done in the deploy and destroy sections, respectively.

You can learn more about the external section here.

Test

Okteto Test is designed to seamlessly integrate testing into your development workflow on the Okteto platform. This section tells Okteto how to test your application by defining one or more Test Containers. The Okteto CLI command okteto test will run your Test Containers using Remote Execution. Remote execution ensures your Test Containers have a consistent behavior in your inner development loop and your CI scripts.

Your test section might look like this:

test:
unit:
image: okteto/golang:1
artifacts:
- coverage.out
caches:
- /go
- /root/.cache
commands:
- "go test . -v"

integration:
depends_on:
- unit
image: okteto/golang:1
context: integration
commands:
- make tests

By default okteto test runs all tests when you run okteto test. You also run a single Test Container by passing its name as an argument, for example okteto test unit.

Validating and Autocompleting the Okteto Manifest in your IDE

Follow these instructions to enable inline suggestions and validation for Okteto Manifests in your IDE.