DEV Community

Luis Fabrício De Llamas
Luis Fabrício De Llamas

Posted on

Dev Services for Kubernetes

Image descriptionDeveloping applications based on Kubernetes often involves headache-inducing tasks for setting up clusters and API servers. However, with the introduction of Dev Services for Kubernetes (An Endless Joy!), these tasks have become simpler and more efficient.

Automatic Initialization of Kubernetes Cluster

One of the greatest advantages is its ability to automatically start a Kubernetes API server in development mode, eliminating the need to manually start a cluster. This is particularly valuable during development and testing phases, where agility is essential. The application is automatically configured to communicate with the API server provided by Dev Services.

Easy Activation and Deactivation

Enabling and disabling Dev Services for Kubernetes is straightforward, thanks to its configurable properties. The tool is enabled by default but can be disabled using the property:
quarkus.kubernetes-client.devservices.enabled, set to false. This flexibility allows you to tailor the environment according to the specific project requirements.

Cluster Sharing

Dev Services for Kubernetes offers a service discovery mechanism that allows multiple Quarkus applications in development mode to share a single Kubernetes cluster. This is particularly useful in scenarios where resources need to be optimized and shared among different applications. The sharing mechanism is enabled by default in development mode and can be deactivated using the property:
quarkus.kubernetes-client.devservices.shared=false.

To enable multiple shared clusters, you can configure the property :
quarkus.kubernetes-client.devservices.service-name with a specific name for the cluster. This ensures that Dev Services finds the desired cluster or creates a new one if necessary. The default service name is "kubernetes".

Flexible Cluster Configuration

Dev Services for Kubernetes offers three different "flavors" of Kubernetes clusters, each supporting different versions of the Kubernetes API. This allows you to choose the most suitable configuration for your project. Through the properties:
quarkus.kubernetes-client.devservices.flavor and quarkus.kubernetes-client.devservices.api-version, you can configure the cluster flavor and API version.

For example, to start only a Kubernetes API server, you can use the flavor api-only with the property: quarkus.kubernetes-client.devservices.flavor=api-only.

If a more complete cluster is needed that can run Pods, flavors like k3s or kind can be chosen. Keep in mind that these flavors require running in Docker privileged mode.

In summary, Dev Services for Kubernetes offers several significant advantages to simplify the development of Kubernetes-based applications. From the automatic cluster initialization to flexible environment configuration, this tool contributes to development agility and efficiency. Take this experience to your team and enhance your work process.

Luis De Llamas

Top comments (1)

Collapse
 
dellamas profile image
Luis Fabrício De Llamas

Link for the community Quarkus Club
discord.gg/8VGwRtf6sm