Decoding Go Language Source Code: A Deep Dive into go: Directives and the Use of Automation Tools

These go: instructions in the Go source code && go automation tools Developers have a strong tendency to automate repetitive tasks, and this also applies to writing code. Boilerplate code may include operations such as setting up a basic file structure, initializing variables, defining functions, or importing libraries or modules. In some cases, packages provide boilerplate code as a starting point for developers to build from, typically generated after the code behavior has been configured....

January 25, 2024 · 22 min · 4561 words · Xinwei Xiong, Me

Concurrent Type Checking and Cross-Platform Development in Go

OpenIM cross-platform source code type checking tool start question In the automation path of OpenIM, it involves more and more comprehensive automated design and testing. In the process, I encountered a problem, so I completed a full set of experience from go language type detection to integrated local and CI. The problem is this issue: https://github.com/openimsdk/open-im-server/issues/1807 Our Go code encountered an integer overflow issue when running on a 32-bit system (linux/386)....

January 24, 2024 · 31 min · 6471 words · Xinwei Xiong, Me

Kubernetes Control Plane - Detailed Analysis of Kubelet

Kubelet Component Analysis Understanding kubelet The Kubelet component runs on Node nodes, maintaining running Pods and providing Kubernetes runtime environment, mainly accomplishing the following missions: Monitor Pods assigned to this Node Mount volumes required by Pods Download Pod secrets Run containers in Pods through docker/rkt Periodically execute liveness probes defined for containers in Pods Report Pod status to other system components Report Node status The core process of kubelet managing Pods mainly includes three steps....

September 28, 2023 · 10 min · 1991 words · Xinwei Xiong, Me

Kubernetes Control Plane - Scheduler

Scheduler kube-scheduler is responsible for scheduling and assigning Pods to nodes within the cluster. It listens to kube-apiserver, queries for Pods that haven’t been assigned to Nodes, and then assigns nodes to these Pods based on scheduling policies (updating the Pod’s NodeName field). The scheduler needs to fully consider many factors: Fair scheduling; Efficient resource utilization; QoS; affinity and anti-affinity; data locality; inter-workload interference; deadlines. kube-scheduler scheduling is divided into two phases, predicate and priority:...

September 28, 2023 · 9 min · 1770 words · Xinwei Xiong, Me

Deep Dive Into the Components of Kubernetes Etcd

Before starting ETCD is the hardest of all components in Kubernetes because ETCD is stateful, not stateless. When I was doing k3s runtime design before, I learned some concepts about ETCD and Raft algorithms. As a prelude to knowledge, please go to [ETCD](https://docker.nsddd.top/Cloud-Native-k8s/24 .html) and Raft algorithm for prelude learning. **This article will explain ETCD and Raft in depth and throughout. And analyze ETCD in depth from the perspective of Kubernetes....

September 28, 2023 · 30 min · 6195 words · Xinwei Xiong, Me

Cross Platform Compilation

Preface https://github.com/OpenIMSDK/Open-IM-Server/issues/432 Many places now have requirements for local adaptation of services. Generally, localized platforms provide an arm version of Linux cloud environment for us to deploy services, so it is necessary to build an arm version of the image. Build plan In the above issue, we describe the general construction ideas and solution steps. Let’s take a look at the construction plan. We take the most commonly used amd machine as an example to compile arm....

September 16, 2023 · 14 min · 2923 words · Xinwei Xiong, Me

GoReleaser: Automate your software releases

The goal of GoReleaser is to automate much of the tedious work when releasing software, by using sensible defaults and making it simple for the most common use cases. Preparation: .goreleaser.yaml file: contains all configuration information. (For more information, see Customization ) Clean working tree: Make sure the code is up to date and all changes have been committed. SemVer compliant version number (e.g. 10.21.34-prerelease+buildmeta) GoReleaser running steps: The operation of GoReleaser is mainly divided into the following four steps:...

September 16, 2023 · 53 min · 11220 words · Xinwei Xiong, Me