Using the Okteto CLI and Dashboard
The Okteto CLI is our open-source tool that let's you develop your applications on Okteto. If you haven't done so yet, install and configure the Okteto CLI following this guide.
Most developer interact with okteto via the Command Line Interface (CLI). Here we’ll explain common CLI commands and a typical workflow using them.
Essential Okteto CLI Commands
Command | Description |
---|---|
okteto context | Connect to your Okteto instance |
okteto deploy | Deploy your application |
okteto build | Build a new image for your Development Environment This will build and push the images defined in the build section of your Okteto Manifest. If you want to deploy from the git repo head see, okteto pipeline deploy |
okteto up | Start your Development Environment and connect your terminal window to the cloud environment |
okteto down | Stops your development environment |
A list of all available CLI commands is in our full CLI reference guide here ->
Overview of the Okteto Dashboard
-
Your Personal Namespace
- Automatically generated for each user, this Namespace is uniquely named after the user's username or email, ensuring a personalized environment. These cannot be deleted, but their resources can be destroyed allowing the Namespace to be reused
-
Using the Catalog to Deploy a Development Environment
The most common way to deploy a Development Environment on Okteto is through the Catalog. The Catalog is a list of your applications, configured by a platform engineer on your team, with everything they need to run included. You can find the Catalog by clocking on the “Deploy a Dev Environment” button.
You can also deploy a Development Environment with the following methods:
- Git Repository: Deploy from a repository in a connected GitHub account
- URL: Deploy from a specific Git URL
-
Creating a New Namespace
- Non-Personal Namespaces are additional Namespaces created by users or through automation, facilitating broader project collaboration and management. They may be deleted or transferred to other users.
- As a common practice, you might name your Namespace based on a feature number, ticket number, or a similar identifier. Development environments within these Namespaces are created from Git branches. This allows you to run multiple Namespaces simultaneously, each corresponding to a different branch or feature.
-
-
Collaborate on several applications at once by sharing your namespace
-
To share a Namespace go to the Okteto dashboard, select the namespace you want to share and press the
Share
button in the namespace menu (you'll find it in the main bar at the top).
-
-
Environment States
- Sleep: Suspend your environment to save resources, the Okteto Garbage collector configured by your Okteto admin will set the sleep periods
- Destroy All: Remove all resources in a Namespace
- Keep Awake: Admins can choose to prevent Namespaces from sleeping so that they are always accessible
-
Preview Environments
- Temporary environments for testing features before merging into the main branch. These are a great way to share your changes with a QA Team or Product Manager
- Okteto Admins can configure Previews to work with your source control and CI/CD provider so that a Preview links are automatically added to submitted pull requests
Common Workflows
- When do I create a Namespace?
- Deploying Your App
- Use
okteto deploy
to deploy your application using your local code - Explain catalog option
- Use
- Managing Environments
- Use
okteto up
to start your Development Container and connect your local machine - Use
okteto down
to stop your Development Container - Use
okteto namespace
to switch between different Namespaces - Use
okteto destroy
to completely destroy a deployed Development Environment. Note that this does not destroy the persistent volumes that were created for that environment, if you want it to do that you need to pass the-v
flag
- Use
- Other Useful Commands
okteto logs
: View logs of your applicationokteto doctor
: Diagnose issues with your Development Containersokteto endpoints
: List the endpoints of your deployed application
Now that you know more about the Okteto CLI, let's introduce the concept of Development Containers 😎