Introducing Okteto Divert
Here at Okteto, we’re always looking for ways to make development easier for cloud native developers. One feature we thought could be beneficial is the ability to have multiple versions of an application while in development. This would enable you to make live comparisons as you make changes, which would give you a sense of progress and a better understanding of your development's impact. Having multiple versions of a service running would also allow you to try several approaches without tearing down and rebuilding the original services for each method. Additionally, when the deployment of an application becomes more complex, the resources needed to run multiple variants are not always available locally. The application configuration often becomes quite cumbersome and can distract from the developer's goal of application improvement. That’s why we’re excited to announce the release of our newest feature—divert!
Divert allows you to divert traffic that is headed to a particular service in your app to another instance of that service.
This can help with development flow, testing, canary deployments, and more.
The easiest way to implement a divert is with
okteto up in Okteto Cloud.
Adding a divert to your Okteto Manifest modifies the behavior of
When a divert is specified
okteto up creates an additional copy of that service and performs the necessary configuration to allow the application to use the original service and the one under development.
This allows you to compare both versions side by side, which we think is pretty cool.
When configuring your development container, with the divert option in your manifest, the application will have an additional endpoint that utilizes your development container. The existing endpoint will continue to use the previously deployed container, leaving your application unaffected by development changes. You can now both develop and use your original application simultaneously!
How it works
When adding a divert to your manifest, add the name of the ingress, name of service, and port you want Okteto to duplicate from your original deployment. Okteto will then...
- Duplicate the specified resources in the divert specification
- Generate a development container to run alongside the original container
- Inject a container alongside the original that will redirect the traffic originating from the duplicate ingress
These operations are all performed through the use of a custom Kubernetes operator built by Okteto. A technical deep dive on the operator and how you can use the divert custom resource tailored to your application will follow soon.
Try it out
The divert feature is available in Okteto Cloud and ready for you to try out today. A tutorial using divert is provided alongside an example application.