Learn About Automated Testing

Automated testing practices and strategies for GitHub open source Go projects in the cloud native field introduce As OpenIM, a popular project on Github, how to create value in the cloud native era is very important. OpenIM is a small and high-quality team, and we do not have particularly in-depth insights in automation. Continuous Integration and Continuous Delivery (CI/CD) using GitHub Actions: GitHub Actions provides a platform to automatically build and test Go language projects. By configuring GitHub Actions workflows, you can automatically run tests when your code changes, ensuring the quality and functionality of your code (https://docs.github.com/en/actions/automating-builds-and-tests) . KubeVela project practice: KubeVela is a cloud-native and open-source project in Go that shows how to organize CI/CD processes, including automated testing, in a cloud-native environment. KubeVela uses declarative workflows to coordinate the CI/CD process. You can refer to KubeVela’s GitHub repository to understand and apply these [Practice 3](https://www.alibabacloud.com/blog/kubevela-one-of-the- hottest-golang-cloud-native-and-open-source-project_597465)4 [5](https://github.com/kubevela/workflow# :~ :text=KubeVela Workflow is an open,engine in your own repository). Cloud native testing framework and tools: In cloud native development, Contract Testing is a common testing practice, which ensures that communication between services complies with predefined API protocols. For example, Pact is used in Cloud-Native Toolkit for contract testing. By writing and integrating tests, you can verify that communication between services works as expected 6 . Code Coverage Check: When doing automated testing, it is a good practice to check code coverage. Many testing frameworks have built-in code coverage checking capabilities, and they can be configured to report code coverage of tests. For example, use the SonarQube tool to read and report code coverage information 6 . Utilize open source tools and frameworks: You can use open source tools and frameworks for testing, such as using Cypress to test cloud native applications[7](https://dev.to/litmus-chaos/cloud-native-application-testing-automation-2bh5# : ~:text=Cloud Native Application %26 Testing,Testing Using Cypress for). There are other projects and resources, such as the learning-cloud-native-go/myapp repository on GitHub, which provide completed examples of cloud native Go projects. You can refer to these examples to understand and apply cloud native testing practices[8] (https://medium.com/learning-cloud-native-go/lets-get-it-started-dc4634ef03b#:~:text=The completed project can be,The completed API). Customized automated testing process: By combining GitHub Actions and open source tools, you can customize your project’s CI/CD process, including automated testing and verification steps9 . Quantify the value of automated testing Automation obviously means that the manual cost in the later period is very low. That is to say, as time goes by and the number of automation runs increases, the value of automation and ROI becomes higher. ...

October 14, 2023 · 60 min · 12628 words · Xinwei Xiong, Me

Deep Dive into Kubernetes CNI, CRI, CSI Components

Container Runtime Container Runtime runs on every node in a Kubernetes (k8s) cluster and is responsible for the entire container lifecycle. Docker is currently the most widely used. With the development of container cloud, more and more container runtimes have emerged. To solve the integration problems between these container runtimes and Kubernetes, the community introduced CRI (Container Runtime Interface) in Kubernetes version 1.5 to support more container runtimes. ...

September 28, 2023 · 32 min · 6640 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. First, kubelet obtains Pod manifests through files, HTTP endpoints, API Server, and HTTP server. Second, node management mainly involves node self-registration and node status updates. Kubelet registers node information through API Server at startup and periodically sends node information to API Server, which writes the information to etcd after receiving it. Finally, Pod startup process mainly includes steps like image pulling, container startup, probe monitoring, and status reporting. ...

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

In-depth understanding of the components of Kubernetes Kube apisserver

Deep understanding of Kube-APIServer kube-apiserver is one of the most important core components of Kubernetes and mainly provides the following functions Provides REST API interface for cluster management, including authentication and authorization, data verification, cluster status changes, etc. Provides a hub for data interaction and communication between other modules (other modules query or modify data through API Server, only API Server directly operates etcd) apiserver main functions: Authentication: Use the cluster to determine identity. Authentication: Use operation CRUD, permissions are required. Access: For Kubernetes, some additional actions are required. For example, if the written value is not standardized, it needs to be modified, and verification is required after modification. Finally, it is necessary to limit the current flow to prevent maliciousness or loopholes from causing congestion. Mutating Validating +Admission Current Limit Implementation of APIServer object Access control API Server is the intermediate hub for all component interactions. ...

September 28, 2023 · 24 min · 4922 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

Kubernetes Port Config via Config Files

Introduction In the current module’s execution, numerous ports (ws, api, rpc, Prometheus) are passed directly. This approach can be cumbersome and doesn’t align with Kubernetes’ best practices where a pod typically exposes only one port (either 80 or 443). This proposal suggests transitioning to a configuration file-centric approach, while still retaining the capability to pass ports directly when needed. Goals Simplify the port configuration for Kubernetes deployment. Prioritize port values passed as arguments over configuration file values. Provide flexibility to users who wish to use traditional port-based or environment variable-based deployments. Proposed Solution 1. Configuration File Instead of passing multiple ports directly, a configuration file will be introduced. By default, this file will contain predefined ports. This configuration file can be passed to the module using Kubernetes’ ConfigMap. ...

September 18, 2023 · 2 min · 402 words · Xinwei Xiong, Me

Open Source Business: From Community to Revenue

Introduction: Global Perspective at the Shenzhen Futian Convention and Exhibition Center On December 6, 2023, the GTC 2023 Global Traffic Conference was held in full swing at the Shenzhen Futian Convention and Exhibition Center. This grand event brought together technology elites from around the world to explore the cutting-edge trends and future developments in the internet industry. As a participant, I had the privilege of immersing myself in this exchange between technology and business, particularly the theme of “Focusing on Open Source and Pioneering Global Expansion,” which left a profound impression on me. ...

September 17, 2023 · 26 min · 5412 words · Xinwei Xiong, Me

OpenIM clustering design Kubernetes deploy concludes

Conference and Reference Links Conference reference documents: https://nsddd.notion.site/2899028707604b8090b36677c031cdf8?pvs=4 Video playback: Bilibili: https://www.bilibili.com/video/BV1s8411q7Um/?spm_id_from=333.999.0.0 Comment: I think that middleware can be replaced with https://kubeblocks.io which can help you manage multiple database middlewares. im reads the configuration information, and reads the config/ directory. The config.yaml hard-coded in the code can be automatically divided into rpc for different services, and then unified directories. By default, the directory is read from the binary running path. two floors openim version: https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/version.md Storage can consider using: https://github.com/openebs/openebs https://github.com/rook/rook Core target: ...

September 17, 2023 · 14 min · 2771 words · Xinwei Xiong, Me

The Art of Asking Questions in Open Source Communities

Before asking a question Before you ask a technical question via email, newsgroup, or chat room, please do the following: Try searching for answers in old articles on the forum where you are asking a question. Try searching online to find the answer. Try reading the manual to find the answer. Try reading the Frequently Asked Questions document (FAQ) to find the answer. Try to check or experiment on your own to find the answer. Ask your strong friends to find out. If you are a program developer, try reading the source code to find the answer. When you ask a question, please show that you have done the above; this will help establish that you are not a questioner who is getting something for nothing and wasting other people’s time. It would be better if you could also express what you learned in the process of doing the above efforts, because we are more willing to answer questions from people who show that they can learn from the answers. ...

September 17, 2023 · 48 min · 10169 words · Xinwei Xiong, Me