Introduction to Kubernetes Service APIs

Kubernetes Service APIs (Service APIs) is an open source project managed by the SIG-NETWORK community at https://github.com/kubernetes-sigs/service-apis. The goal of the project is to develop Service APIs in the Kubernetes ecosystem. The goal of this project is to develop Service Network APIs in the Kubernetes ecosystem. Service APIs provide interfaces to expose Kubernetes applications - Services, Ingress, etc. What is the goal of the Service API? Service APIs are designed to improve service networks by providing expressible, extensible, role-oriented interfaces that are implemented by many vendors and supported by a wide range of industries.

nginx reverse proxy configuration to remove prefixes

When using nginx as a reverse proxy, you can simply forward the request directly to the next service as is. Setting a proxy_pass request will only replace the domain name, if you want to access different services based on different url suffixes, you need to go through the following method. options 1: Add “/” 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 server { listen 8000; server_name abc.

docker registry migration to harbor

Registry Docker Distribution Docker Distribution is the first tool that implements packaging, distribution, storage and image distribution, acting as a Docker registry. (Currently Distribution has been donated to CNCF). The spec specification in Docker Distribution has since become the OCI distribution-spec specification. It can be assumed that Docker Distribution implements most of the OCI image distribution specifications, and that the two are largely compatible. OCI’s guiding philosophy is to have

Detecting Mobile Browser

Sometimes, front-end web pages need to know whether the user is using a mobile or desktop browser. This article, based on StackOverflow, compiles five ways for JavaScript to detect mobile browsers. navigator.userAgent The easiest way to do this is to analyze the browser’s user agent string, which contains device information. JS gets this string through the navigator.userAgent property, and as long as it contains keywords like mobi, android, iphone, etc.,

Traffic routing with Kubernetes Service APIs via Traefik

In this article we will demonstrate how to use the new Gateway, GatewayClass and HTTPRoute API to route requests to the backend service Pod via Traefik. Environment Before we can get started we need to prepare the relevant environment. A running Kubernetes cluster, which this article will assume is running on localhost. The kubectl command line tool, and configure it to access your cluster. The relevant configuration files covered in this article are available through the following GitHub repository.

How do I collect and manage multi-line logs?

Multi-line logs (e.g. exception messages) provide a lot of very valuable information for debugging application problems, and today’s distributed microservices are popular basically collect the logs uniformly, such as the common ELK, EFK and other schemes, but these schemes do not look at multi-line logs as a whole without proper configuration, but each line is treated as a separate line of logs. This is difficult for us to accept. In this article, we will describe the strategies of some common log collection tools for handling multi-line logs.

Building a Highly Available Kubernetes Cluster with kube-vip

kube-vip can provide a Kubernetes native HA load balancing on your control plane nodes, we don’t need to set up HAProxy and Keepalived externally to achieve high availability of the cluster anymore. kube-vip is an open source project that provides high availability and load balancing for Kubernetes clusters both internally and externally, and has been used in Vmware’s Tanzu project to replace the HAProxy load balancer for vSphere deployments with

Understanding the Container Runtime Containerd in one article

Before learning Containerd we need to do a brief review of Docker’s development history, because it involves a bit more components in practice, there are many we will often hear, but it is not clear what these components are really for, such as libcontainer, runc, containerd, CRI, OCI and so on. Docker Since Docker 1.11, Docker containers are not simply started by Docker Daemon, but by integrating containerd, runc and

Application of overlay2 in a packaged release pipeline

Since I joined the company in May last year, I have been responsible for the packaging and deployment of PaaS toB products, which is somewhat similar to the Kubernetes community’s SIG Release Team. The main work during the trial period is to optimize our existing packaging and release process. Many optimizations were made to the product packaging and release pipeline during this period, most notably the optimization of mirror synchronization,

Jenkins With Kubernetes

While the cloud-native era has seen up-and-comers like JenkinsX, Drone, and Tekton, an old-school CI/CD tool like Jenkins is still the dominant solution used by major companies. CD tool is still the mainstream solution used by major companies. For example, our private cloud product packaging and release is done with this old guy. However, the traditional Jenkins Slave master-multiple-slave approach has some pain points, such as. Each Slave has a

In-depth understanding of the HTML slot element

Whether it is an instance component or an HTML component, passing parameters is inevitable. In the case of the Web Components component, for example, if we want to pass width and height, we can use custom width or height properties, e.g., passing parameters is inevitable for both example components and HTML components. In the case of a Web Components component, for example, to pass width and height, we can use

webpack close sourceMap cause sass-loader error problem analysis and solution

In webpack, the webpack devtool is usually set to enable the sourceMap feature. If you use resolve-url-loader and sass-loader, when you turn off the sourceMap feature of webpack for production output, you may get an error message like the following. ModuleNotFoundError: Module not found: Error: Can’t resolve ‘… /… /…/images/abc.png’ After debugging the source code of resolve-url-loader and sass-loader, I found that resolve-url-loader relies on the sourceMap information processed by

Error Boundaries and Global Error Handling in React 16

As of React 16, any error not caught by an error boundary will cause the entire React component tree to be uninstalled. For large projects that have been in development for a long time and where Code Review is not as stringent, upgrading to React 16 may reveal that exceptions that were previously only occasionally localized and did not receive enough attention may now occasionally cause the entire application to

《Righting Software》 reading notes

Righting software is a book published by Pearson in 2020 by Juval Löwy, and it was introduced in China this year. I finished reading the part of the book that I cared about during the mid-autumn festival, and this article extracts some core ideas from it. The author first summed up his decades of experience (first expressing his envy), and proposed a reliable software design method, called The Method (translated into Chinese as meta-method).

Analyzing Netty Traffic Control from Occasional Downtime Events

Business Background A large number of messages are currently used in mobile usage scenarios. Push messages can help operators achieve operational goals more efficiently (such as pushing marketing campaigns to users or alerting new APP features). For the push system needs to have the following two characteristics. Messages are delivered to users in seconds with no latency, support for millions of pushes per second, and millions of long connections on

Detailed Guide to Web Page Sub-resource Integrity Checks

About Subresource Integrity (subresource integrity) If you don’t pay much attention to web security, you may not have heard of this term. I believe that after reading this article, you will be able to gain a deeper understanding of what SRI is, why you should use SRI, and how to practice using SRI in your projects if you have a need for it. What SRI is and what it solves

golang netpoll Explained

Computer io models are distinguished into a variety of, currently the most used is also nio, epoll, select. Combining different scenarios with different io models is the right solution. Network io in golang golang is naturally suited for concurrency, why? One is the lightweight concurrency, and the other is the abstraction of complex io, which simplifies the process. For example, if we simply access an http service, a few simple

How to get the client's real IP, starting with a "bug" in Gin

Request IP, as one of the user’s identity attributes, is a very important basic data. In many scenarios, we will do network security attack prevention or access risk control based on the client request IP. Usually, we can get the real IP through the X-Forwarded-For header in the HTTP protocol Request Headers, but is it really reliable to get the real IP through the X-Forwarded-For header? Concept The X-Forwarded-For is

Solution for websocket service proxy and data mock

Mocking data is an inevitable requirement in the collaborative development process with separate front and back ends. There are many mature solutions for data mocking in the common http way, but it becomes more complicated for websocket push mode. Here we share the data request mock solution for websocket services with the help of simple-mock plugin library. Introduction to simple-mock In the case that no other roles such as product

Reasonable use of git rebase instead of git merge

The main points of this article are first written in the front. develop on the same branch with fewer changes per commit, it is recommended to use rebase it is recommended to use rebase when merging from a public branch to a personal feature branch when merging from different branches with many change records, merge is recommended To merge from a personal topic branch to a public branch, you should