Okteto Cloud gives instant access to secure Kubernetes namespaces to enable developers to code, build, and run Kubernetes applications entirely in the cloud.
This tutorial will show you how to create an account in Okteto Cloud and how to develop a sample application.
Step 1: Deploy the Movies App
Log in to Okteto Cloud, and click on the Deploy button on the top left. A dialog will open asking for a Git repository URL to deploy. Type the one for the Movies App repository (https://github.com/okteto/movies), pick a branch, and click Deploy:
The Movies App is a simple web app composed of: a React frontend, a Node.js api, and a mongodb database.
When you deploy the Movies App Git repository, Okteto Cloud will run the deploy pipeline defined by the
okteto-pipeline.yml of the repository.
In this case, the pipeline deploys the chart of the Movies App with Helm.
Check the docs to learn more about how to configure your
At this point, your application is deploying. It will be ready to go once its components reach the
The Okteto Cloud dashboard is designed to be developer friendly. It gives you instant feedback about your applications logs, errors, metrics, and more.
Now click on the application's endpoint of the frontend component to access the Movies App. You should see something like this:
Cool no 😎? But ooh... seems like we have a bug in our application. The list of Movies and the list of Continue watching for Cindy are the same. Let's work on a fix now!
Step 2: Install the Okteto CLI
Okteto provides a local development experience for Kubernetes applications. You code locally in your favorite IDE and Okteto automatically updates your application running in Kubernetes in seconds. No commit, build, push, or deploy required.
The Okteto CLI is open source, and the code is available at GitHub. It's a client-side only tool that works in any Kubernetes cluster. Check it out and star it to show your support 🤗!
If you haven't done it yet, install the Okteto CLI:
- MacOS / Linux
Download https://downloads.okteto.com/cli/okteto.exe and add it to your
More installation options are documented here.
Step 3: Configure access to your Okteto Cloud namespace
The Okteto CLI can download your Kubernetes credentials from Okteto Cloud. To do this, you just need to run the context command:
okteto context configures the default context for any Okteto CLI command.
If you're not logged into Okteto Cloud yet, it also runs the login sequence.
Step 4: Activate your development container
Clone the repo with the source code of the Movies App:
And activate your development container to develop on the api component:
okteto up command starts a development container in Okteto Cloud, which means:
- A file synchronization service is created to keep your changes up-to-date between your local filesystem and your development container
- Container ports 8080 (the application) and 9229 (the debugger) are forwarded to localhost
- A remote shell is started in your development container. Build, test and run your application as if you were in your local machine.
All of this (and more) can be customized via the
okteto.ymlmanifest file, which lives side by side with the application source code. Use the
.stignorefile to avoid synchronizing build artifacts, git metadata, or dependencies like
Your development container inherits all the Kubernetes configuration of the original api deployment. For example, the development container receives the database password via an environment variable. To check it out, execute the following command in the development container shell:
Start the api service by executing the command below in the development container shell:
Go back to the browser and reload the Movies App. Check your development container shell and see how the traffic now goes through your development container:
Step 5: Development time!
Let's fix the bug of the Movies App.
server.js file in your favorite local IDE and modify line 43 to query the
watching collection instead of
Save your changes. Okteto will automatically synchronize your changes to your development container. Take a look at the development container shell and notice how the changes are detected by
nodemon and automatically hot reloaded.
Go back to the browser and reload the Movies App. Your code fixes were instantly applied! No commit, build, or push required 😎.
Congratulations, you just developed your first application in Okteto Cloud 🚀.
Okteto lets you develop your applications directly in Kubernetes. This way you can:
- Eliminate integration issues by developing in a realistic environment
- Test your application end to end as fast as you type code
- No more CPU cycles wasted in your machine. Develop at the speed of the cloud!
Ready to develop your application on Okteto Cloud? Read our step by step tutorial on how to configure an Okteto Pipeline to deploy realistic environments for your application in just one click.