Okteto is a platform to manage your team development environments and to maximize productivity in Kubernetes.
Each service of your development environment should be defined in the same project, and each team member should work on its own project.
This guide will show you how to configure a development environment in your okteto account.
Log in to your okteto account by browsing to hello.okteto.com.
If this is the first time you log in to okteto, click on the button
+ Create New Project in the middle of the screen. If not, click on the
Projects button on the top bar of the screen, and then click on the
Pick a name for your project.
Click on the
Create button to create your new project.
By default, your project is configured to use okteto’s infrastructure. Our Free Tier Kubernetes cluster is just meant for demo purposes and it allows the creation of a maximum of 5 services which get auto destroyed after 1 hour. Each project in okteto maps to a different Kubernetes namespace, isolating your services from other services created by other team members.
Now it’s time to launch your first service.
By default, okteto creates a manifest to deploy our welcome application:
Edit the name of this service at your convenience. By default, a random name is generated.
Click on the deploy button on the top right corner.
As the service is deployed, its logs will appear in the
History section below the service manifest. Every action you perform via okteto will be displayed as part of the service’s history.
After a few seconds, your service will be deployed () and a new
Endpoints section will appear to access your service. Browse to the endpoint to verify that the app is running (note that an
https endpoint has been automatically configured).
If things are working as expected, you should see our welcome site, a place to vote for cats and dogs:
Congratulations, you have successfully deployed your first service in okteto!
Note that with a simple okteto service manifest, you have been able to deploy more complex resources in our okteto Free Tier Kubernetes cluster such us: Pods, Replica Sets, Deployments, Services, and Ingress Rules.
Our sample development environment consists of a single service, but you could add as many services as you want to simulate more complex microservice architectures.
Once your development environment is up and running in your okteto project, it is time to start coding. This is simpler and faster than ever with okteto’s developer mode.
Okteto’s developer mode lets you code locally in your favorite IDE, but execute this code directly on the cluster, using the exact same configuration and infrastructure that you have in production.
Enable development mode using the switch at the top of the service screen.
While the development mode is enabled, install the
okteto CLI. The instructions are available here.
Once the development mode has been enabled, click on the
Link button on the right, and then on the
copy to clipboard button.
Open a terminal, paste the command, and press enter.
When asked for a repo to clone, press enter. The CLI will automatically clone the
okteto/welcome repo for you.
If this is the first time you use the
okteto CLI, you’ll be asked to type your okteto api token. To get it, browse to okteto, open the user menu by clicking on your name on the top right corner and click the “copy” button.
okteto up command will link your local repo with the remote container, enabling live code synchronization.
Browse to the service’s endpoint to verify that the app is running.
On your favorite IDE, open the
app.py file. Change the value of
option_a from “Cats” to “Pets” and the value of
option_b from “Dogs” to “Castles”, and save the file.
Go to the browser, reload the page, and see how your changes were applied automatically!
Let’s recapitulate what we have accomplished in this guide:
You have learned to create a project to isolate each team member development environment.
You have deployed complex Kubernetes objects with a simple okteto service manifest.
Okteto has automatically created TLS certificates to expose your application to the world.
You have developed and tested your changes faster than ever. Forget about boring and time-consuming operations such us building containers, pushing images or deploying services and just focus on your code.
Ready to use okteto in your own Kubernetes cluster? You can configure a project to use your own infrastructure following our Project Configuration guide or contact sales ([email protected]) if you are interested in Okteto Enterprise, our on-premise solution.
Follow the links below to learn more about the power of okteto: