Crafting for Kubernetes

In this newsletter, we introduce Crafting for Kubernetes, the Crafting feature specifically designed to support Kubernetes development.

Some key challenges for engineers to develop services running on Kubernetes include:

  • Difficult to preview and test code changes end-to-end in an integrated environment.

  • The environment on local dev machine is different from the production or staging.

  • Contention on a single staging environment for testing.

With Crafting, these challenges can be addressed by on-demand creating per-developer Kubernetes namespaces to run your services with your own production config for a specific version of the code (e.g. per Pull Request).

Per-developer namespaces to preview on Kubernetes

Crafting platform can connect your dev Kubernetes cluster and launch namespaces with your config in a few simple steps:

1. Connect your Kubernetes cluster to Crafting or providing required credentials on Crafting to run kubectl

2. Setup a sandbox template with a Resource that represents a Kubernetes namespace. In the resource, define hooks to create a namespace and apply your config file (e.g., k8s manifests, helm charts, terraform). You can pass in environment variables to control which container image to use for each particular service so that the namespace reflects the end-to-end config you need.

With that setup, when you create a sandbox with specific ENV setting, a Kubernetes namespace is launched on-demand for the developer to test with.

When the namespace is set up, you can also access your per-developer namespace from your Crafting sandbox.

For more information, please see here.

Lifecycle management for the per-developer namespaces

A key issue in providing on-demand per-developer Kubernetes namespaces to run everything end-to-end is resource management. If not properly managed, you could have too many large namespaces live on the cluster, causing performance issue and/or increasing the machine cost significantly.

Crafting has a solution to control the resource utilization by scaling the replicas down to zero when there is no testing activity for a while. Leveraging the activity-based auto-suspension provided by Crafting sandbox, the corresponding resources can be adjusted (e.g., scale to zero) at the suspension time and restored quickly when the developer needs it.

The namespaces can be automatically cleaned up as part of sandbox deletion, which is part of the automated sandbox cleanup feature.

With the lifecycle management provided by Crafting, your can create per-developer namespaces without worrying about resource usage and cleanup effort. For more information, please see here.

More Information

To know more about Crafting for Kubernetes, please see our documentation on use case, user guide, and setup guide. Or see our video demo.

In future newsletters, we are going to talk about advanced features, such as instant service replacement via traffic interception, etc.

  • Charlie Gao
    Charlie Gao

    March 25, 2023

  • Share:


    Subscribe to our Newsletter


    Your production-like cloud dev environments, instantly.

    © Crafting Inc. 2024. All rights reserved