This tutorial will show you how to create an account in Okteto Cloud and how to deploy and develop a sample application using Kubernetes manifests. Okteto Cloud is compatible with any Kubernetes tool.
Login with Github into Okteto Cloud. Okteto Cloud gives you access to your own namespace in our multi-tenant Kubernetes cluster. This namespace is configured automatically to include network policies, quotas, pod security policies, admission webhooks, roles, role bindings, and limit ranges. This way, your applications are isolated respect to other developer namespaces.
Download your Kubernetes credentials from Okteto Cloud and save them in a well-known location. You should find the
Credentials button at the top menu of the main screen:
KUBECONFIG environment variable to the credentials file you just downloaded:
To see that the new configuration is working, enter this command:
kubectl get all
If you don’t have
kubectlinstalled, follow this guide.
To get a local version of the sample application that you can then deploy to Okteto Cloud, execute the following commands in your local terminal:
git clone https://github.com/okteto/samples
You now have a functioning git repository that contains a sample golang application. In the
manifest/ directory you also have the Kubernetes manifests needed to deploy the application.
Deploy the application by executing the command below:
kubectl apply -f manifests
Your application is now ready! Open your browser and go the URL of the application. You can get the URL by logging into Okteto Cloud and clicking on the application’s endpoint.
Did you notice that you are accessing your application through an SSL endpoint? This is because Okteto Cloud will automatically create them for you when you deploy your application. Cool no 😎?
Congratulations, you just deployed your first application 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.
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.