Devs World
495 subscribers
182 photos
14 videos
419 links
All about software developing & architecture
@ml_world - the best materials about Machine Learning & Data Science

Our fund instagram to help homeless animals: https://www.instagram.com/ukraineanimalhelp/

Contacts: @anikishaev | creotiv@gmail.com
Download Telegram
💾💾💾 Moving the pod to another node in K8S may create connection issues for some period of time.

In Kubernetes, when a pod moves from one node to another—due to rebalancing, node failure, or pod eviction—there indeed exists a window of time during which other pods trying to communicate with the relocated pod might encounter issues. This scenario is possible due to several factors involved in the pod's networking and service discovery mechanisms within a Kubernetes cluster.

Kubernetes uses a combination of service resources, kube-proxy, and sometimes DNS for service discovery and load balancing. Here’s how these components typically handle pod IP changes:

1. Service Resources and Endpoints: Kubernetes Services act as a stable front for a set of pods. When a pod that's part of a service moves to a different node and gets a new IP address, the Service's Endpoints object is updated with the new IP. However, this update does not happen instantaneously; there's a brief period required for the control plane to detect the change and update the Endpoints.

2. kube-proxy: kube-proxy runs on each node and is responsible for routing traffic to the correct pod based on the Service's Endpoints. It watches the Kubernetes API for changes in Services and Endpoints and updates the node's iptables or ipvs rules accordingly. Again, this process is not immediate, and there's a short delay before the iptables or ipvs rules are updated to reflect the new pod location.

3. DNS Caching: If DNS is used for service discovery (via CoreDNS in Kubernetes), caching can also introduce a delay. The DNS records for a Service might still point to the old pod IP until the DNS TTL (time to live) expires and the record is refreshed.

Given these mechanisms, if another pod tries to communicate with the relocated pod in that brief window before the Endpoints and iptables/ipvs rules are updated, it might indeed try to send traffic to the old node/IP, leading to failed connections. However, Kubernetes is designed to minimize such disruptions:

- The control plane components are optimized to update Endpoints and propagate changes as quickly as possible.
- kube-proxy watches for these changes and updates routing rules promptly.
- Services and DNS provide abstraction layers that, under normal circumstances, shield clients from direct pod IP changes.

To mitigate potential issues, applications can implement retry logic for handling transient network failures, ensuring they can gracefully handle brief periods of unavailability or network hiccups as Kubernetes updates its internal state.

#kubernetes #k8s #devops #sre #softwareengineering #dns #iptable #proxy #networking
👍1🔥1
Today in our rubric #ANDevHowTo i will teach you how to make cool approval #deploy #automation with #GitHubActions

Very often deploy, especially on production require attention and approval from many people from different teams like: dev, qa, product, support, etc.
And its very complicated to gather all this approvals manually, and most of the companies are not using any software that will help with this. But many of them using GitHub.

GitHub PRs already have approval process, but it lacks configuration.
That's why for solving this problem we will use 2 actions.

This action that auto assign people to our PR
https://github.com/marketplace/actions/auto-assign-action

This action will check that needed amount of teams and users approved PR
https://github.com/marketplace/actions/custom-approval-management

#ANDevHowToAutomation #GitHub #devops #process
👍2