How to let calico use K8s etcd?
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.
Introduction
In Kubernetes (K8s) environments, networking is a crucial aspect, and Calico is a popular choice for container networking due to its performance, flexibility, and extensive features. One of the advanced configurations involves making Calico use the Kubernetes' etcd directly. This approach can simplify the architecture and reduce the number of components involved in networking configuration and updates.
In this article, we will explore how to configure Calico to use the Kubernetes etcd directly and highlight the technical considerations involved.
Why Use Kubernetes' etcd?
By allowing Calico to use the Kubernetes etcd directly, you:
- Simplify Architecture: Reduce the complexity by using a single etcd cluster for both Kubernetes and Calico.
- Resource Efficiency: Save on computing resources that would otherwise be required for managing a separate etcd cluster for Calico.
- Streamlined Operations: Ease operations by managing only one etcd cluster.
Prerequisites
Technical Assumptions
- A Kubernetes cluster set up and running.
- Basic understanding of Calico and its network policies.
- Administrative access to modify Kubernetes components.
Setting up Calico to Use Kubernetes etcd
Step 1: Backup Existing Configuration
Before making any changes, ensure that you backup all existing Kubernetes and Calico configurations.
- name: CALICO_DATASTORE_TYPE
- name: ETCD_ENDPOINTS
- name: ETCD_KEY_FILE
- name: ETCD_CERT_FILE
- name: ETCD_CA_CERT_FILE
- Check the logs of Calico pods:
- Examine the network policies and confirm that they are being applied as expected:
- Performance: Monitor the performance of the etcd as it handles increased load from both Calico and Kubernetes.
- Security: Always secure etcd endpoints and use encryption to safeguard sensitive data.
- Backup Strategy: Have a robust backup strategy for etcd data since both Kubernetes configuration and networking rely heavily on it.
Related reading
- How to let Kubernetes PetSet use existing Persistent Volumes?
- How to limit memory size for .net core application in pod of kubernetes?
- How to list all local images on a Kubernetes node AKS
- How to list all namespaces in a cluster?
- how to limit GPU usage in tensorflow r1.1 with C API
- How to list exposed port of all containers?
- How to list applied Custom Resource Definitions in kubernetes with kubectl
- How to list containers and its info running a pod using kubectl command

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.