Serialization of Lambda expressions in the JDK and the clever use of SerializedLambda

I want to Javassist as the core JDBC-based Javassist in my free time to write a set of lightweight ORM framework to abandon reflection calls, the process of reading mybatis, tk-mapper, mybatis-plus and spring-boot-starter-jdbc source code. Among them, I found that the LambdaQueryWrapper in mybatis-plus can get the method information (actually CallSite information) of the currently called Lambda expression, so here is a complete record. This article is based on

Resolving CoreDNS custom domain name failure issues

A few days ago we used NodeLocal DNSCache to solve the 5 second timeout problem with CoreDNS, and the cluster DNS resolution performance was significantly improved. However, today we encountered a major pitfall, when we were doing DevOps experiments, the tools were using custom domains, so we needed to add custom domain name resolution to access each other, which we could solve by adding hostAlias to Pods, but when using

Jenkins Shared Library Example

If you use Jenkins Pipeline a lot, you’re bound to encounter a lot of duplicate code in several different pipelines, and often we copy and paste it directly into different pipelines for convenience, but in the long run this code becomes more and more troublesome to maintain. To solve this problem, Jenkins provides the concept of shared libraries to solve the problem of duplicate code, we just need to extract

Log monitoring and alerting with Loki

For a production environment and an aspiring ops person, even millisecond level downtime is not tolerated. Proper logging and monitoring of infrastructure and applications is very helpful in solving problems, and can also help optimize costs and resources, as well as help detect some problems that may occur later. In this article we will use the more lightweight Grafana Loki to implement log monitoring and alerting. The key thing is that if you are familiar with using Prometheus, you will have no problem using Loki, as they are basically the same, and have the same Label tag if they are auto-discovered in a Kubernetes cluster.

Building a Kubernetes cluster with WSL2 on Windows

In this article we’ll cover how to build a Kubernetes cluster using WSL2 and KinD under Windows 10. Over the past few years, Kubernetes has become the de facto standard in container orchestration. While there are now a variety of Kubernetes distributions and installers to deploy Kubernetes environments, we still need to deploy and run Kubernetes clusters locally, especially for developers, except in cloud or bare-metal environments. However, Kubernetes was

Running Kubernetes in Kubernetes

KinD is a very lightweight Kubernetes installation tool that treats Docker containers as Kubernetes nodes, making it very easy to use. Since you can run a Kubernetes cluster in a Docker container, it’s natural to wonder if you can run it in a Pod. What are the problems with running in a Pod? Installing Docker Daemon in a Pod KinD is now dependent on Docker, so first we need to create an image that allows us to run Docker Deamon in the Pod, so that we can execute commands like docker run inside the Pod, but this is not the same as the DIND mode of mounting docker.

PV and PVC state changes in Kubernetes

We should not be unfamiliar with several states of PV and PVC, but we may have some questions in the process of using them, such as why the PV has become Failed state, how can the newly created PVC bind the previous PV, and can I restore the previous PV? Here we will explain several state changes in PV and PVC again. In different cases, the state changes of PV

Encrypting Kubernetes Secrets with Sealed Secrets

We’ve talked about GitOps practices before, and we know that GitOps advocates managing all of your configuration through Git and versioning your environment configuration and infrastructure through declarative code. In Kubernetes, we know that you can use resource manifest files to manage a cluster’s resource objects, but it’s not a good idea to store Kubernetes Secrets data in a Git repository, which is also very insecure. Kubernetes Secrets are resource objects used to help us store sensitive information, such as passwords, keys, certificates, OAuth Token, SSH KEY, etc.

Creating CLI Applications with Cobra in Golang

Although most of the software we use today is visual and easy to use, that doesn’t mean that CLI (command line) applications are useless, especially for developers who deal with CLI applications on a regular basis. Golang is perfect for building CLI applications, and we will introduce how to build a CLI application in Golang in the following. For developers, there are a lot of CLI tools like npm, node,

Kubernetes Dashboard with Time Machine - Kubevious

Kubevious is an open source Kubernetes Dashboard, but it’s not quite the same as our mainstream Dashboard, it’s very unique, it has all the configuration related to the application in one place, which saves the operator’s time. The main thing is that it has a Time Machine feature that allows us to go back in time to see the application error messages. Features Most of the Kubernetes Dashboard features are pretty much the same, so what features does Kubevious have?

Deploying Kafka on a Kubernetes cluster

Recently, when I was testing log collection, I found that Elasticsearch was a bit overwhelmed by the volume of log data, and the optimization of ES might not be completed overnight, so I planned to add an intermediate layer to export the logs to Kafka, and then consume the logs from Kafka via Logstash and deposit them into Elasticsearch. There is no Kafka cluster in the test environment, so let’s

Excellent Grafana K8S Plugin - DevOpsProdigy KubeGraf

DevOpsProdigy KubeGraf is an excellent Grafana Kubernetes plugin, an update to Grafana’s official Kubernetes Plugin. The plugin can be used to visualize and analyze the performance of a Kubernetes cluster, visually displaying the metrics and characteristics of the main services of the Kubernetes cluster through various graphs, and can also be used to examine the application lifecycle and error logs. Environment Requirements To install and use the DevOpsProdigy KubeGraf plugin

Re-learning memory mapping (mmap) in Java

mmap Basic Concepts mmap is a memory mapping method that maps a file to a process address space, mapping a file’s disk address to a process virtual address. Once such a mapping relationship is implemented, the process can read and write to this section of memory using pointers, and the system will automatically write back dirty pages to the corresponding file disk, i.e., it is done with the file without

Why DNS uses the UDP protocol

The specific issue to be analyzed today is ‘why DNS uses the UDP protocol’. DNS acts as a phone book for the entire Internet, translating domain names that can be understood by humans into IP addresses that can be understood by machines, eliminating the need for users of the Internet to have direct access to IP addresses that are difficult to read and understand. I believe that it is common knowledge among software engineers that DNS uses the UDP protocol, and anyone who knows a little about computer networks knows that DNS uses the UDP protocol to transfer data, but this is not entirely true.

Why MySQL Uses B+ Tree

Why MySQL uses B+ trees is a question that often comes up in interviews. Many people may have some understanding of this question, but most answers are incomplete and inaccurate, and most people simply talk about the difference between B+ and B trees. But none of them really answer the question of why MySQL chooses to use B+ trees. In this article, we will analyze in depth some of the reasons behind MySQL’s choice of B+ trees.

Why Redis Snapshots Use Subprocesses

Although we often think of Redis as a purely in-memory key-value storage system, we also use its persistence features, and RDB and AOF are two of the persistence tools Redis provides us, with RDB being a snapshot of Redis data. In this article, we want to analyze why Redis needs to use subprocesses when persisting snapshots of data, rather than exporting the in-memory data structures directly to disk for storage.

Why the TCP protocol has performance problems

The TCP protocol is arguably the cornerstone of today’s Internet, and as a reliable transport protocol, almost all data is transmitted over TCP today. However, TCP was not designed with today’s complex network environment in mind, and when you are tormented by intermittent networks on the subway or train, you may not even know that it may all be caused by the TCP protocol. This article will analyze why the TCP protocol has serious performance problems in weak network environments

Why is the UDP header only 8 bytes long?

The two transport protocols, UDP and TCP, are core members of the IP protocol cluster. The RFC 768, published in 1980, defines the UDP protocol, which allows us to pass data across a network of multiple computer connections. The common DNS protocol can use the UDP protocol to obtain the results of domain name resolution UDP is the simplest protocol that can transmit data, and its protocol header (also called protocol header) is only 8 bytes.

Implementation principles of Go language arrays

Arrays and slices are common data structures in the Go language, and many developers new to Go tend to confuse these two concepts. In addition to arrays, Go introduces another concept - slicing. Slicing has some similarities to arrays, but their differences lead to significant differences in usage. In this section we will introduce the underlying implementation of arrays from the Go compile-time runtime, which will include several common operations for initializing, accessing, and assigning values to arrays.

Why the Go language doesn't have generics

Go is a programming language with few syntactic elements and a simple design, which often means less expressiveness and more time for engineers to write repetitive logic. There has been a lot of community discussion and outcry about generics, and here are some of the discussions and feedback related to generics. proposal: spec: generic programming facilities has over 500 generic-related discussions. Generics - ExperienceReports lists a number of articles discussing Go language generics.