Guest Author

Skaffold vs Telepresence: Comparing Kubernetes Inner Development Loop Tools

Sudip Sengupta
Ambassador Labs
Published in
6 min readNov 10, 2022

--

The Kubernetes inner development loop supports various stages of a development workflow, starting from the developer writing the code until it is deployed to production. Skaffold and Telepresence are two popular Kubernetes inner development loop tools that support continuous development in modern DevOps frameworks.

Skaffold is an open source command-line tool that lets developers focus on iterating their workloads locally while continuously deploying to a target cluster. On the other hand, Telepresence is an CNCF command-line and web-based tool that supports faster iterations of testing and deployment by enabling developers to locally access remote Kubernetes cluster services and test their local code changes against remote dependencies before creating a PR and deploying their code changes.

In this article, I explain how Skaffold and Telepresence support modern CI/CD pipelines, their features, fundamental differences, and use cases.

What is Skaffold?

Skaffold is an open-source CI/CD tool that simplifies Kubernetes application development by automating containerization and administration tasks. By operating entirely on the client-side, the default Skaffold configuration offers a high-performance and lightweight platform that requires no installation of components on an operating cluster. The tool consumes logs from Kubernetes deployments and port-forwards the application to the developer’s machine for rapid, iterative development.

Skaffold supports two operating modes: run and dev.

  • In run mode, Skaffold does a one-time run of the pipeline, building images and deploying them into the cluster. The run mode is crucial for security and QA teams looking to test their application’s state as it helps debug runtime conflicts without adding operational complexities of deploying a minimal setup.
  • Dev mode is a more interactive operating mode, where Skaffold watches for changes in the project repository, rebuilds images, and updates the Kubernetes cluster to support a continuous development model. In dev mode, Skaffold synchronizes the cluster with the developers’ working environment while offering developers real-time feedback on code changes.

Skaffold Features

Key features of Skaffold include:

  • Continuous feedback — Through dev mode, Skaffold runs Kubernetes commands in a continuous development loop and port-forwards the application to the developer machine for feedback on the impact of their code changes.
  • Context-aware project-sharing — Skaffold allows the sharing of project files in common repositories. With this, enterprises can incorporate project differences across environments using flags, local user configurations, environment variables, and Skaffold profiles.
  • CI/CD building blocks — Kubernetes cluster administrators can build applications and deploy them into production with the same toolsets and workflows used to run applications locally.
  • render for GitOps integration — With Skaffold render, developers can build images and output templated manifests instead of deploying those directly to a cluster. These templates can easily be integrated into any existing GitOps workflow.
  • Multi-component apps — Skaffold implements a plugin architecture, making it useful in automating development loops for multi-component, microservice-based applications.
  • Client-side components — Skaffold components are only deployed on the developer’s machine and rely on port-forwarding to access the state of the cluster.
  • Minimal pipeline- Skaffold provides a straightforward build-deploy process for a simple, minimal-maintenance CI/CD pipeline.

What is Telepresence?

Telepresence is a CNCF project that provides a local development environment for remote Kubernetes and OpenShift clusters. The platform accelerates the development of Kubernetes applications by allowing developers to access services locally before replicating code changes across to the production cluster. Telepresence also supports the use of any tools installed locally to test and debug workloads, without having to run any dependencies locally.

Telepresence leverages two primary architecture components to enable local access of remote services. These include:

  • Cluster-side traffic manager — Enables the access of cluster services locally by establishing a double-proxied communication between the production cluster and the local development environment.
  • Traffic agent — Invoked by the traffic manager to install a proxy container as an agent on the local machine to funnel remote services to the local environment.

Telepresence Features

Key features of Telepresence include:

  • Provides connectivity via a side-car process — Telepresence runs sidecar proxies inside remote Kubernetes clusters. This proxy sends Kubernetes environment data, such as volumes, environment variables, and TCP connections to services running on the developer’s machine, thereby allowing iterative cycles of development and testing of the application code locally.
  • Enables local debugging — Developers can use their local Integrated Development Environments (IDEs) and other tools to debug the application based on the proxied data.
  • Instant feedback — Thanks to the proxy service, the developer’s local development environment looks like it is within a pod in the remote cluster. All cluster data available to the proxy service pod is available to the developer’s machine as well, enabling them to track application changes in real time.
  • Realistic environment representation — Telepresence allows developers to code and test within any Kubernetes cluster (test or development environments), which is configured the same way as a production cluster. This eliminates defects that occur due to differences between the production and development deployments.
  • Minimal resource footprint — Since it integrates with a running Kubernetes cluster, Telepresence only requires machine resources to run the local service.

Telepresence vs. Skaffold: Key Differences

|-------------|---------------------------|------------------------|
| Aspect | Skaffold | Telepresence |
|-------------|---------------------------|------------------------|
|Purpose |Building and deploying |Testing and debugging |
|-------------|---------------------------|------------------------|
|Connectivity |Port-forwarding |Two-way proxy |
|-------------|---------------------------|------------------------|
|Ease of use |Requires manual |Simple, automated |
| configuration |workflow | |-------------|---------------------------|------------------------|
|Tool support |Requires plugins to |Allows developers to |
| |integrate with developer |work with their own |
| |tools |tools (IDEs, debuggers, | | | |etc.) out-of-the-box |
|-------------|---------------------------|------------------------|

Let us expand on the above parameters to understand the differences better.

Purpose

  • Skaffold handles the workflow (building, pushing, and deploying) and its automation, allowing developers to see the result of their code changes in production.
  • On the other hand, Telepresence helps developers access remote services in local dev environments as if their machines are part of the production-grade cluster, enabling instant debugging.

Connectivity

  • Skaffold tails logs from workloads in Kubernetes, then port-forwards them to the developer’s machine.
  • In contrast, Telepresence deploys network proxies within pods of remote Kubernetes clusters. This approach provides complete two-way communication between cluster services and the local development environment, allowing for real-time feedback.

Ease of Use

  • Skaffold configuration relies on manual efforts to connect the local environment with the target Kubernetes cluster and obtain cluster data.
  • Telepresence deploys a pod that proxies data from within the cluster and sends it directly to the developer’s local service.

Tool Support

  • Skaffold offers flexibility through plugins that allow developers to connect their clusters with the local environment.
  • Telepresence enables developers to work with their local development environment out-of-the-box, allowing them to test and debug applications with their chosen/existing tools on their machine locally.

Telepresence vs. Skaffold: When to Use

Skaffold: When to use

Skaffold provides building blocks for CI/CD pipelines, and handles all the workflows for building, pushing, and deploying the application. Skaffold is considered most suitable for accelerating development workflows by allowing developers to make changes locally while the tool continuously deploys to the target cluster.

Telepresence: When to use

Besides accelerating CI/CD workflows, Telepresence joins the developer’s local environment to the remote cluster so that their local machine appears to be “in the cluster”. This makes Telepresence ideal for rapid development, testing, and debugging, since the realistic environment representation provides instant feedback for queries and code changes. Developers can use their existing tools (and personalized setup and configuration) to code against remote services. This also enables cluster-level debugging of applications with a minimal footprint — there’s no need to spin up your entire application locally.

Skaffold and Telepresence: Using Together for Accelerated Application Delivery

Apart from using them separately for different use cases, developers can also use Skaffold and Telepresence together to supercharge Kubernetes development workflows. A typical scenario may involve the building and deploying of a local environment using Skaffold, while using Telepresence to iterate the debugging of a local service before pushing the service to the target cluster. Telepresence can additionally be used to intercept traffic from the production cluster, thereby exposing cluster changes to the developer and their stakeholders for real-time feedback.

Conclusion

Skaffold and Telepresence accelerate Kubernetes development through automated CI/CD pipelines and instant feedback. While they are built to possess distinct strengths and operate with fundamental differences, developers can leverage both Telepresence and Skaffold together to fasten a CI/CD framework — where rapid development, testing, and deployment is the primary goal.

When using Telepresence, enterprise teams can leverage Ambassador Cloud for additional benefits, such as cross-functional collaboration of shared services running on a local machine through secure “preview URLs”.

To know more on how Telepresence can help with rapid development with live, local debugging of Kubernetes workloads, use a free demo Kubernetes cluster or build your own here.

--

--