This tutorial will show you how to use Okteto to develop your applications in Kubernetes. Okteto lets you code locally and see the results instantaneously in Kubernetes, the Cloud Native way.
If you haven’t deployed your first application in Okteto Cloud, we recommend that you first complete our 5-minute getting started guide, since this guide depends on having the sample application deployed in Okteto Cloud.
The Okteto CLI keeps your code synchronized between your local machine and the containers running your application. See your changes live in Kubernetes without having to rebuild images and redeploy containers!
The Okteto CLI is open source, and the code is available at Github. Check it out and star it to show your support 🤗!
Install the Okteto CLI by running the following command in your local terminal:
curl https://get.okteto.com -sSfL | sh
wget https://downloads.okteto.com/cli/okteto-Windows-x86_64 -OutFile c:\windows\system32\okteto.exe
Open a terminal, and navigate to the folder where you cloned the sample application’s code. Once you’re there, run the
okteto up command to create your development environment:
✓ Persistent volume provisioned
Your development environment is now ready. The
okteto up command executes the following tasks:
okteto/golang:1. This image contains the required dev tools to build, test and run the sample application. Enjoy the advantages of having development environments as code.
Now run your application by executing the following command:
go run main.go
Open your browser and go to the URL of the application to test it.
You can get the URL by logging into Okteto Cloud and clicking in the application’s endpoint.
Edit the file
main.go and replace the word
Okteto Cloud on line 23. Save your changes.
Cancel the execution of
go run main.go by pressing
ctrl + c. Rerun your application:
go run main.go
Go back to the browser, and reload the page. Notice how your changes are instantly applied. No commit, build or push required 😎.
Congratulations, you just developed your first application in Okteto Cloud 🚀.
Okteto helps you move your entire development workflow to Kubernetes. This way you can:
- Eliminate integration issues by developing the same way your application runs in production.
- Uninstall Docker or Minikube. No more cpu cycles wasted in your machine.
- Hardware and network just limited by the power of the cloud!
- Your development endpoints are always available. No need to expose your local machine to the internet through remote tunnels.
okteto up command by pressing
Ctrl + C +
Ctrl + D and run the following commands to remove the resources created by this guide:
okteto down -v
✓ Okteto Environment deactivated
kubectl delete -f manifests
deployment.apps "hello-world" deleted
Your next step is to deploy and develop your own application in Okteto Cloud.
okteto.yml file in the sample folder? Okteto uses that manifest to determine the name of your development environment, the docker image to use and where to upload your code. Check the Okteto manifest docs to customize your development environments with your own dev tools, images, and dependencies.