New Feature: Custom Kubernetes Annotations

Kubernetes annotations are key-value pairs attached to Kubernetes objects, providing a flexible way to extend the functionality of your Kubernetes resources without altering their internal specifications. These annotations serve as a tool to store additional metadata to tailor behavior, orchestrate tools, and interact seamlessly with third-party utilities that complement your Kubernetes environment. Today, we're excited to announce that Qovery supports the declaration of Custom Annotations for your Kubernetes clusters 🥳.

Romaric Philogène

Romaric Philogène

April 26, 2024 · 3 min read
New Feature: Custom Kubernetes Annotations - Qovery

#Why Use Kubernetes Annotations?

Using annotations in Kubernetes gives you more control over Kubernetes internal resources like Ingress Controllers, Services, Pods, Deployment, Statefulset, <add your Kubernetes resource type>... and even third-party services. They provide enhanced features and controls without directly modifying the primary resource definitions.

#Setting Custom Annotations with Qovery

At Qovery, setting up custom Kubernetes annotations is designed to be straightforward and efficient:

1/ Navigate to your Qovery dashboard and select your application.

2/ In the application settings, scroll down the "General" tab and add your Annotations Group.

Create my annotation group
Create my annotation group

3/ Select the Annotations Groups you want to attach to your app.

I attach my annotations group to my app
I attach my annotations group to my app

For enhanced management, Qovery introduces Annotations Groups, which allow you to group multiple annotations and apply them across various services, streamlining management and updates.

4/ Finally, save and deploy your changes.

#Examples of Kubernetes Annotations

Here are some Kubernetes annotations that you could use:

#DataDog Monitoring

This annotation integrates Nginx pods with DataDog's monitoring system to collect detailed metrics.

ad.datadoghq.com/nginx.checks: {"nginx":{"init_config":[],"instances":[{"nginx_status_url":"http://%%host%%/status"}]}}

#NGINX Configuration

Adjusts the path of the NGINX ingress controller.

nginx.ingress.kubernetes.io/rewrite-target: /

#Hashicorp Vault

Enables HashiCorp Vault to manage secrets for Kubernetes applications securely.

vault.hashicorp.com/role: my-role

#Horizontal Pod Autoscaler (HPA)

Autoscale based on custom and external metrics.

autoscaling.kubernetes.io/metrics: "[{'type': 'Resource', 'resource': {'name': 'cpu', 'target': {'type': 'Utilization', 'averageUtilization': 80}}}]"  

Another example: This annotation sets the stabilization window, within a period during which the HPA does not decrease the number of replicas, even if there is no high load. This helps to prevent frequent scale-down operations which could lead to performance degradation during fluctuating loads.

autoscaling.kubernetes.io/scaleDownStabilizationWindowSeconds: 300

#Linkerd

Automatically injects Linkerd’s service mesh resources for detailed network and performance monitoring.

linkerd.io/inject: enabled

#Prometheus Scraping

Marks pods for scraping by Prometheus directly from Kubernetes.

prometheus.io/scrape: true

#Istio Sidecar Injection

Ensures that Istio injects its sidecars for network traffic management within specified pods.

sidecar.istio.io/inject: true

#Resource Limits

Defines the resource quota and management tier for the pod or namespace.

quota.management/cluster: gold

#Helm Hooks

Specifies custom actions to be taken by Helm post-installation of a chart.

helm.sh/hook: post-install
helm.sh/hook-weight: "-5"
helm.sh/hook-delete-policy: hook-succeeded

#Toleration Tags

Allows specific pods to tolerate node taints, facilitating the scheduling of pods on dedicated nodes.

scheduler.alpha.kubernetes.io/tolerations: [{"key":"dedicated","value":"search","effect":"NoSchedule"}]

Those are just a few examples. For more examples, refer to the documentation of services and internal resources deployed on your Kubernetes cluster.

#Wrapping Up

Custom Kubernetes annotations on Qovery are now generally available to all users. With the Qovery Annotations Groups feature, Qovery enhances the power of Kubernetes annotations by allowing you to manage them as templates. This feature promotes reusability and ensures consistency across multiple services, simplifying the management and scaling of your Kubernetes applications. Explore this new capability and empower your team to manage Kubernetes more effectively, all within the streamlined developer experience that Qovery promises.

Start using custom Kubernetes annotations with Qovery today and take your infrastructure management to the next level!

Resources: Qovery Kubernetes Annotations documentation

Your Favorite Internal Developer Platform

Qovery is an Internal Developer Platform Helping 50.000+ Developers and Platform Engineers To Ship Faster.

Try it out now!
Your Favorite Internal Developer Platform
Qovery white logo

Your Favorite Internal Developer Platform

Qovery is an Internal Developer Platform Helping 50.000+ Developers and Platform Engineers To Ship Faster.

Try it out now!
ProductKubernetes