Getting Started With Okteto

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.

Create Your First Project

  1. Log in to your okteto account by browsing to hello.okteto.com.

  2. 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 + icon.

  3. Pick a name for your project.

  4. 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.

Deploy Your First Service

Now it’s time to launch your first service.

By default, okteto creates a manifest to deploy our welcome application:

1
2
3
4
5
6
name: welcome
containers:
site:
image: okteto/welcome
ports:
- 80
  1. Edit the name of this service at your convenience. By default, a random name is generated.

  2. Click on the deploy button on the top right corner.

Deploy service

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).

Endpoint service

If things are working as expected, you should see our welcome site, a place to vote for cats and dogs:

Voting app

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.

Developer Mode

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.

  1. Enable development mode using the switch at the top of the service screen.

    Development mode

  2. While the development mode is enabled, install the okteto CLI. The instructions are available here.

  3. Once the development mode has been enabled, click on the Link button on the right, and then on the copy to clipboard button.

    Link CLI

  4. Open a terminal, paste the command, and press enter.

  5. When asked for a repo to clone, press enter. The CLI will automatically clone the okteto/welcome repo for you.

  6. 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 API token

  7. The okteto up command will link your local repo with the remote container, enabling live code synchronization.

    Okteto up

  8. Browse to the service’s endpoint to verify that the app is running.

  9. 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.

    Code

  10. Go to the browser, reload the page, and see how your changes were applied automatically!

What we have learned

Let’s recapitulate what we have accomplished in this guide:

  1. You have learned to create a project to isolate each team member development environment.

  2. You have deployed complex Kubernetes objects with a simple okteto service manifest.

  3. Okteto has automatically created TLS certificates to expose your application to the world.

  4. 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: