1_r/devopsish

1_r/devopsish

54497 bookmarks
Custom sorting
Are databases in Kubernetes production-ready?
Are databases in Kubernetes production-ready?

Are databases in Kubernetes production-ready?

Should we run databases in Kubernetes? Are they production-ready?

kubernetes #database

▬▬▬▬▬▬ 💰 Sponsoships 💰 ▬▬▬▬▬▬ If you are interested in sponsoring this channel, please use https://calendly.com/vfarcic/meet to book a timeslot that suits you, and we'll go over the details. Or feel free to contact me over Twitter or LinkedIn (see below).

▬▬▬▬▬▬ 👋 Contact me 👋 ▬▬▬▬▬▬ ➡ BlueSky: https://vfarcic.bsky.social ➡ LinkedIn: https://www.linkedin.com/in/viktorfarcic/

▬▬▬▬▬▬ 🚀 Other Channels 🚀 ▬▬▬▬▬▬ 🎤 Podcast: https://www.devopsparadox.com/ 💬 Live streams: https://www.youtube.com/c/DevOpsParadox

via YouTube https://www.youtube.com/watch?v=9GJTZqkRRGM

·youtube.com·
Are databases in Kubernetes production-ready?
Linux Fixing A "Hilarious/Revolting Performance Regression" Around Intel KVM Virtualization
Linux Fixing A "Hilarious/Revolting Performance Regression" Around Intel KVM Virtualization
It's not too often that 'fixes' to the Kernel-based Virtual Machine (KVM) are noteworthy but today is an interesting exception with among the KVM fixes sent in today ahead of the Linux 6.13-rc3 tagging is for beginning to deal with a 'hilarious/revolting' performance regression affecting recent generations of Intel processors
·phoronix.com·
Linux Fixing A "Hilarious/Revolting Performance Regression" Around Intel KVM Virtualization
The Death of Developer Relations | lbr.
The Death of Developer Relations | lbr.
Every year, I gear up for “conference season,” which includes KubeCon NA (typically held between mid-October and mid-November) and AWS re:Invent, always the week after Thanksgiving in the US. As
·leebriggs.co.uk·
The Death of Developer Relations | lbr.
Caddy Ninja
Caddy Ninja
Setup an HTTPS-enabled webserver with Caddy on Alpine Linux
·caddy.ninja·
Caddy Ninja
In search of a faster SQLite - blag
In search of a faster SQLite - blag
Researchers at the University of Helsinki and Cambridge attempted to build a faster SQLite using modern programming paradigms like io_uring and disaggregated storage. They demonstrate up to a 100x reduction in tail latency. These are my notes.
·avi.im·
In search of a faster SQLite - blag
Enhancing Kubernetes API Server Efficiency with API Streaming
Enhancing Kubernetes API Server Efficiency with API Streaming

Enhancing Kubernetes API Server Efficiency with API Streaming

https://kubernetes.io/blog/2024/12/17/kube-apiserver-api-streaming/

Managing Kubernetes clusters efficiently is critical, especially as their size is growing. A significant challenge with large clusters is the memory overhead caused by list requests.

In the existing implementation, the kube-apiserver processes list requests by assembling the entire response in-memory before transmitting any data to the client. But what if the response body is substantial, say hundreds of megabytes? Additionally, imagine a scenario where multiple list requests flood in simultaneously, perhaps after a brief network outage. While API Priority and Fairness has proven to reasonably protect kube-apiserver from CPU overload, its impact is visibly smaller for memory protection. This can be explained by the differing nature of resource consumption by a single API request - the CPU usage at any given time is capped by a constant, whereas memory, being uncompressible, can grow proportionally with the number of processed objects and is unbounded. This situation poses a genuine risk, potentially overwhelming and crashing any kube-apiserver within seconds due to out-of-memory (OOM) conditions. To better visualize the issue, let's consider the below graph.

The graph shows the memory usage of a kube-apiserver during a synthetic test. (see the synthetic test section for more details). The results clearly show that increasing the number of informers significantly boosts the server's memory consumption. Notably, at approximately 16:40, the server crashed when serving only 16 informers.

Why does kube-apiserver allocate so much memory for list requests?

Our investigation revealed that this substantial memory allocation occurs because the server before sending the first byte to the client must:

fetch data from the database,

deserialize the data from its stored format,

and finally construct the final response by converting and serializing the data into a client requested format

This sequence results in significant temporary memory consumption. The actual usage depends on many factors like the page size, applied filters (e.g. label selectors), query parameters, and sizes of individual objects.

Unfortunately, neither API Priority and Fairness nor Golang's garbage collection or Golang memory limits can prevent the system from exhausting memory under these conditions. The memory is allocated suddenly and rapidly, and just a few requests can quickly deplete the available memory, leading to resource exhaustion.

Depending on how the API server is run on the node, it might either be killed through OOM by the kernel when exceeding the configured memory limits during these uncontrolled spikes, or if limits are not configured it might have even worse impact on the control plane node. And worst, after the first API server failure, the same requests will likely hit another control plane node in an HA setup with probably the same impact. Potentially a situation that is hard to diagnose and hard to recover from.

Streaming list requests

Today, we're excited to announce a major improvement. With the graduation of the watch list feature to beta in Kubernetes 1.32, client-go users can opt-in (after explicitly enabling WatchListClient feature gate) to streaming lists by switching from list to (a special kind of) watch requests.

Watch requests are served from the watch cache, an in-memory cache designed to improve scalability of read operations. By streaming each item individually instead of returning the entire collection, the new method maintains constant memory overhead. The API server is bound by the maximum allowed size of an object in etcd plus a few additional allocations. This approach drastically reduces the temporary memory usage compared to traditional list requests, ensuring a more efficient and stable system, especially in clusters with a large number of objects of a given type or large average object sizes where despite paging memory consumption used to be high.

Building on the insight gained from the synthetic test (see the synthetic test, we developed an automated performance test to systematically evaluate the impact of the watch list feature. This test replicates the same scenario, generating a large number of Secrets with a large payload, and scaling the number of informers to simulate heavy list request patterns. The automated test is executed periodically to monitor memory usage of the server with the feature enabled and disabled.

The results showed significant improvements with the watch list feature enabled. With the feature turned on, the kube-apiserver’s memory consumption stabilized at approximately 2 GB. By contrast, with the feature disabled, memory usage increased to approximately 20GB, a 10x increase! These results confirm the effectiveness of the new streaming API, which reduces the temporary memory footprint.

Enabling API Streaming for your component

Upgrade to Kubernetes 1.32. Make sure your cluster uses etcd in version 3.4.31+ or 3.5.13+. Change your client software to use watch lists. If your client code is written in Golang, you'll want to enable WatchListClient for client-go. For details on enabling that feature, read Introducing Feature Gates to Client-Go: Enhancing Flexibility and Control.

What's next?

In Kubernetes 1.32, the feature is enabled in kube-controller-manager by default despite its beta state. This will eventually be expanded to other core components like kube-scheduler or kubelet; once the feature becomes generally available, if not earlier. Other 3rd-party components are encouraged to opt-in to the feature during the beta phase, especially when they are at risk of accessing a large number of resources or kinds with potentially large object sizes.

For the time being, API Priority and Fairness assigns a reasonable small cost to list requests. This is necessary to allow enough parallelism for the average case where list requests are cheap enough. But it does not match the spiky exceptional situation of many and large objects. Once the majority of the Kubernetes ecosystem has switched to watch list, the list cost estimation can be changed to larger values without risking degraded performance in the average case, and with that increasing the protection against this kind of requests that can still hit the API server in the future.

The synthetic test

In order to reproduce the issue, we conducted a manual test to understand the impact of list requests on kube-apiserver memory usage. In the test, we created 400 Secrets, each containing 1 MB of data, and used informers to retrieve all Secrets.

The results were alarming, only 16 informers were needed to cause the test server to run out of memory and crash, demonstrating how quickly memory consumption can grow under such conditions.

Special shout out to @deads2k for his help in shaping this feature.

via Kubernetes Blog https://kubernetes.io/

December 16, 2024 at 07:00PM

·kubernetes.io·
Enhancing Kubernetes API Server Efficiency with API Streaming
DevOps Toolkit - Ep03 - Ask Me Anything about DevOps Cloud Kubernetes Platform Engineering... w/Scott Rosenberg - https://www.youtube.com/watch?v=gpAiC2Q2f9A
DevOps Toolkit - Ep03 - Ask Me Anything about DevOps Cloud Kubernetes Platform Engineering... w/Scott Rosenberg - https://www.youtube.com/watch?v=gpAiC2Q2f9A

Ep03 - Ask Me Anything about DevOps, Cloud, Kubernetes, Platform Engineering,... w/Scott Rosenberg

There are no restrictions in this AMA session. You can ask anything about DevOps, Cloud, Kubernetes, Platform Engineering, containers, or anything else. We'll have a special guest Scott Rosenberg to help us out.

▬▬▬▬▬▬ 👋 Contact me 👋 ▬▬▬▬▬▬ ➡ BlueSky: https://vfarcic.bsky.social ➡ LinkedIn: https://www.linkedin.com/in/viktorfarcic/

▬▬▬▬▬▬ 🚀 Other Channels 🚀 ▬▬▬▬▬▬ 🎤 Podcast: https://www.devopsparadox.com/ 💬 Live streams: https://www.youtube.com/c/DevOpsParadox

via YouTube https://www.youtube.com/watch?v=gpAiC2Q2f9A

·youtube.com·
DevOps Toolkit - Ep03 - Ask Me Anything about DevOps Cloud Kubernetes Platform Engineering... w/Scott Rosenberg - https://www.youtube.com/watch?v=gpAiC2Q2f9A
The Top Cybersecurity Agency in the US Is Bracing for Donald Trump
The Top Cybersecurity Agency in the US Is Bracing for Donald Trump
Staffers at the Cybersecurity and Infrastructure Security Agency tell WIRED they fear the new administration will cut programs that keep the US safe—and “persecution.”
·wired.com·
The Top Cybersecurity Agency in the US Is Bracing for Donald Trump
AvitalTamir/cyphernetes: A Kubernetes Query Language
AvitalTamir/cyphernetes: A Kubernetes Query Language

AvitalTamir/cyphernetes: A Kubernetes Query Language

Cyphernetes turns this: 😣 # Delete all pods that are not running kubectl get pods --all-namespaces --field-selector 'status.phase!=Running' \ -o…

December 16, 2024 at 11:38AM

via Instapaper

·github.com·
AvitalTamir/cyphernetes: A Kubernetes Query Language
Your Kubernetes Cluster Isn't Safe - The Dark Side of Backups
Your Kubernetes Cluster Isn't Safe - The Dark Side of Backups

Your Kubernetes Cluster Isn't Safe - The Dark Side of Backups

Learn how to reconcile cluster migration and disaster recovery using tools like Velero and the GitOps paradigm. In this video, we explore the limitations of relying solely on backups and the importance of using a multi-faceted approach for disaster recovery. We demonstrate practical steps with Velero, Argo CD, and Crossplane, highlighting common pitfalls and best practices. Whether you're dealing with Kubernetes clusters, PostgreSQL databases, or cloud-native applications, this video will help you understand the intricacies of effective disaster recovery strategies.

GitOps #Velero #DisasterRecovery #Kubernetes

Consider joining the channel: https://www.youtube.com/c/devopstoolkit/join

▬▬▬▬▬▬ 🔗 Additional Info 🔗 ▬▬▬▬▬▬ ➡ Transcript and commands: https://devopstoolkit.live/kubernetes/your-cluster-isnt-safe-the-dark-side-of-backups 🎬 Should We Run Databases In Kubernetes? CloudNativePG (CNPG) PostgreSQL: https://youtu.be/Ny9RxM6H6Hg 🎬 Kubernetes? Database Schema? Schema Management with Atlas Operator: https://youtu.be/1iZoEFzlvhM 🎬 Argo CD Synchronization is BROKEN! It Should Switch to Eventual Consistency!: https://youtu.be/t1Fdse-F9Jw

▬▬▬▬▬▬ 💰 Sponsorships 💰 ▬▬▬▬▬▬ If you are interested in sponsoring this channel, please visit https://devopstoolkit.live/sponsor for more information. Alternatively, feel free to contact me over Twitter or LinkedIn (see below).

▬▬▬▬▬▬ 👋 Contact me 👋 ▬▬▬▬▬▬ ➡ BlueSky: https://vfarcic.bsky.social ➡ LinkedIn: https://www.linkedin.com/in/viktorfarcic/

▬▬▬▬▬▬ 🚀 Other Channels 🚀 ▬▬▬▬▬▬ 🎤 Podcast: https://www.devopsparadox.com/ 💬 Live streams: https://www.youtube.com/c/DevOpsParadox

▬▬▬▬▬▬ ⏱ Timecodes ⏱ ▬▬▬▬▬▬ 00:00 Introduction to Disaster Recovery 00:55 Before The Disaster 02:24 Disaster Recovery with Kuberentes Backups (Velero) 06:53 Disaster Recovery with GitOps (Argo CD) 10:03 Disaster Recovery of Mutated Resources 13:35 What Did We Learn?

via YouTube https://www.youtube.com/watch?v=lSRdVzXqFXE

·youtube.com·
Your Kubernetes Cluster Isn't Safe - The Dark Side of Backups
Open source projects drown in bad bug reports penned by AI
Open source projects drown in bad bug reports penned by AI

Open source projects drown in bad bug reports penned by AI

Software vulnerability submissions generated by AI models have ushered in a "new era of slop security reports for open source" – and the devs maintaining these…

December 16, 2024 at 10:57AM

via Instapaper

·theregister.com·
Open source projects drown in bad bug reports penned by AI
CISA Requests Public Comment for Draft National Cyber Incident Response Plan Update | CISA
CISA Requests Public Comment for Draft National Cyber Incident Response Plan Update | CISA

CISA Requests Public Comment for Draft National Cyber Incident Response Plan Update | CISA

An official website of the United States government Here’s how you know Official websites use .gov A .gov website belongs to an official government organization…

December 16, 2024 at 10:20AM

via Instapaper

·cisa.gov·
CISA Requests Public Comment for Draft National Cyber Incident Response Plan Update | CISA
Kubernetes v1.32 Adds A New CPU Manager Static Policy Option For Strict CPU Reservation
Kubernetes v1.32 Adds A New CPU Manager Static Policy Option For Strict CPU Reservation

Kubernetes v1.32 Adds A New CPU Manager Static Policy Option For Strict CPU Reservation

https://kubernetes.io/blog/2024/12/16/cpumanager-strict-cpu-reservation/

In Kubernetes v1.32, after years of community discussion, we are excited to introduce a strict-cpu-reservation option for the CPU Manager static policy. This feature is currently in alpha, with the associated policy hidden by default. You can only use the policy if you explicitly enable the alpha behavior in your cluster.

Understanding the feature

The CPU Manager static policy is used to reduce latency or improve performance. The reservedSystemCPUs defines an explicit CPU set for OS system daemons and kubernetes system daemons. This option is designed for Telco/NFV type use cases where uncontrolled interrupts/timers may impact the workload performance. you can use this option to define the explicit cpuset for the system/kubernetes daemons as well as the interrupts/timers, so the rest CPUs on the system can be used exclusively for workloads, with less impact from uncontrolled interrupts/timers. More details of this parameter can be found on the Explicitly Reserved CPU List page.

If you want to protect your system daemons and interrupt processing, the obvious way is to use the reservedSystemCPUs option.

However, until the Kubernetes v1.32 release, this isolation was only implemented for guaranteed pods that made requests for a whole number of CPUs. At pod admission time, the kubelet only compares the CPU requests against the allocatable CPUs. In Kubernetes, limits can be higher than the requests; the previous implementation allowed burstable and best-effort pods to use up the capacity of reservedSystemCPUs, which could then starve host OS services of CPU - and we know that people saw this in real life deployments. The existing behavior also made benchmarking (for both infrastructure and workloads) results inaccurate.

When this new strict-cpu-reservation policy option is enabled, the CPU Manager static policy will not allow any workload to use the reserved system CPU cores.

Enabling the feature

To enable this feature, you need to turn on both the CPUManagerPolicyAlphaOptions feature gate and the strict-cpu-reservation policy option. And you need to remove the /var/lib/kubelet/cpu_manager_state file if it exists and restart kubelet.

With the following kubelet configuration:

kind: KubeletConfiguration apiVersion: kubelet.config.k8s.io/v1beta1 featureGates: ... CPUManagerPolicyOptions: true CPUManagerPolicyAlphaOptions: true cpuManagerPolicy: static cpuManagerPolicyOptions: strict-cpu-reservation: "true" reservedSystemCPUs: "0,32,1,33,16,48" ...

When strict-cpu-reservation is not set or set to false:

cat /var/lib/kubelet/cpu_manager_state

{"policyName":"static","defaultCpuSet":"0-63","checksum":1058907510}

When strict-cpu-reservation is set to true:

cat /var/lib/kubelet/cpu_manager_state

{"policyName":"static","defaultCpuSet":"2-15,17-31,34-47,49-63","checksum":4141502832}

Monitoring the feature

You can monitor the feature impact by checking the following CPU Manager counters:

cpu_manager_shared_pool_size_millicores: report shared pool size, in millicores (e.g. 13500m)

cpu_manager_exclusive_cpu_allocation_count: report exclusively allocated cores, counting full cores (e.g. 16)

Your best-effort workloads may starve if the cpu_manager_shared_pool_size_millicores count is zero for prolonged time.

We believe any pod that is required for operational purpose like a log forwarder should not run as best-effort, but you can review and adjust the amount of CPU cores reserved as needed.

Conclusion

Strict CPU reservation is critical for Telco/NFV use cases. It is also a prerequisite for enabling the all-in-one type of deployments where workloads are placed on nodes serving combined control+worker+storage roles.

We want you to start using the feature and looking forward to your feedback.

Further reading

Please check out the Control CPU Management Policies on the Node task page to learn more about the CPU Manager, and how it fits in relation to the other node-level resource managers.

Getting involved

This feature is driven by the SIG Node. If you are interested in helping develop this feature, sharing feedback, or participating in any other ongoing SIG Node projects, please attend the SIG Node meeting for more details.

via Kubernetes Blog https://kubernetes.io/

December 15, 2024 at 07:00PM

·kubernetes.io·
Kubernetes v1.32 Adds A New CPU Manager Static Policy Option For Strict CPU Reservation
OpenZFS 2.2.7 Released With Linux 6.12 Support, Many Fixes
OpenZFS 2.2.7 Released With Linux 6.12 Support, Many Fixes
While we are awaiting the release of OpenZFS 2.3 that has been seeing release candidates since early October, OpenZFS 2.2.7 is out today as the newest stable release of this ZFS file-system implementation for Linux and FreeBSD systems.
·phoronix.com·
OpenZFS 2.2.7 Released With Linux 6.12 Support, Many Fixes
Kubernetes v1.32: Memory Manager Goes GA
Kubernetes v1.32: Memory Manager Goes GA

Kubernetes v1.32: Memory Manager Goes GA

https://kubernetes.io/blog/2024/12/13/memory-manager-goes-ga/

With Kubernetes 1.32, the memory manager has officially graduated to General Availability (GA), marking a significant milestone in the journey toward efficient and predictable memory allocation for containerized applications. Since Kubernetes v1.22, where it graduated to beta, the memory manager has proved itself reliable, stable and a good complementary feature for the CPU Manager.

As part of kubelet's workload admission process, the memory manager provides topology hints to optimize memory allocation and alignment. This enables users to allocate exclusive memory for Pods in the Guaranteed QoS class. More details about the process can be found in the memory manager goes to beta blog.

Most of the changes introduced since the Beta are bug fixes, internal refactoring and observability improvements, such as metrics and better logging.

Observability improvements

As part of the effort to increase the observability of memory manager, new metrics have been added to provide some statistics on memory allocation patterns.

memory_manager_pinning_requests_total - tracks the number of times the pod spec required the memory manager to pin memory pages.

memory_manager_pinning_errors_total - tracks the number of times the pod spec required the memory manager to pin memory pages, but the allocation failed.

Improving memory manager reliability and consistency

The kubelet does not guarantee pod ordering when admitting pods after a restart or reboot.

In certain edge cases, this behavior could cause the memory manager to reject some pods, and in more extreme cases, it may cause kubelet to fail upon restart.

Previously, the beta implementation lacked certain checks and logic to prevent these issues.

To stabilize the memory manager for general availability (GA) readiness, small but critical refinements have been made to the algorithm, improving its robustness and handling of edge cases.

Future development

There is more to come for the future of Topology Manager in general, and memory manager in particular. Notably, ongoing efforts are underway to extend memory manager support to Windows, enabling CPU and memory affinity on a Windows operating system.

Getting involved

This feature is driven by the SIG Node community. Please join us to connect with the community and share your ideas and feedback around the above feature and beyond. We look forward to hearing from you!

via Kubernetes Blog https://kubernetes.io/

December 12, 2024 at 07:00PM

·kubernetes.io·
Kubernetes v1.32: Memory Manager Goes GA