CN117112144A - Method and system for deploying k3s on android system and storage medium - Google Patents

Method and system for deploying k3s on android system and storage medium Download PDF

Info

Publication number
CN117112144A
CN117112144A CN202311232362.9A CN202311232362A CN117112144A CN 117112144 A CN117112144 A CN 117112144A CN 202311232362 A CN202311232362 A CN 202311232362A CN 117112144 A CN117112144 A CN 117112144A
Authority
CN
China
Prior art keywords
android
file
deploying
compiling
cgroup
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202311232362.9A
Other languages
Chinese (zh)
Other versions
CN117112144B (en
Inventor
马超
薛伟力
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Zhuo You Network Technology Co ltd
Original Assignee
Shanghai Zhuo You Network Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Zhuo You Network Technology Co ltd filed Critical Shanghai Zhuo You Network Technology Co ltd
Priority to CN202311232362.9A priority Critical patent/CN117112144B/en
Publication of CN117112144A publication Critical patent/CN117112144A/en
Application granted granted Critical
Publication of CN117112144B publication Critical patent/CN117112144B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/31User authentication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances

Abstract

The application provides a method and a system for deploying k3s on an android system and a storage medium, wherein the method comprises the following steps: step S100, modifying an android system kernel configuration file to establish an environment supporting k3S operation; step S200, cross-compiling a dependency library file operated by a k3S agent, creating a k3S starting program, and embedding the k3S starting program into android source codes; step S300, compiling android source codes, generating a brushing firmware and brushing android equipment; k3s is run on the android device to complete k3s deployment on the android system. Thereby enabling the deployment of k3s on an android system.

Description

Method and system for deploying k3s on android system and storage medium
Technical Field
The application relates to a k3S deployment technology, in particular to a method and a system for deploying k3S on an android system and a storage medium.
Background
K3s is lightweight Kubernetes, which is abbreviated as K8s, and is an open source for managing containerized applications on multiple hosts in a cloud platform, and the goal of the Kubernetes is to make the application deploying containerization simple and efficient, and the Kubernetes provides a mechanism for application deployment, planning, updating and maintenance.
Although Kubernetes is so preferred and evolving rapidly, many challenges are still presented to developers and operators. One of the key challenges is to run Kubernetes at the edge. Edges are very different compared to clouds or data centers. It operates at a remote location in a highly constrained environment. There is only a small portion of the computing, storage, and network resources of the edge devices compared to the like devices running in the data center. The connection of edge devices to the cloud is intermittent and they operate primarily in an offline environment. These factors make it difficult to deploy and manage Kubernetes clusters marginally.
Based on this, the industry issued K3s, a release of Kubernetes, which is highly optimized for edges. Although K3s is a simplified, mini version of Kubernetes, the consistency and functionality of the API is not affected. From kubectl to Helm to Kubernetes, almost all tools of the cloud native ecosystem can interface seamlessly with K3s. In fact, K3s is a CNCF certified, satisfactory Kubernetes release that can be deployed in a production environment. Almost all workloads running a complete Kubernetes cluster can guarantee to work on a K3s cluster.
As is well known, the k3s container is realized by using Linux-based Cgroups and namespace technologies, but in view of the difference between Android and Linux kernels, although Android is an operating system running on Linux, android itself cannot be calculated as a certain version of Linux, so k3s cannot be deployed on an Android system.
Disclosure of Invention
Therefore, the main purpose of the application is to provide a method, a system and a storage medium for deploying k3s on an android system, so as to solve the problems in the background technology and realize the deployment of k3s on the android system.
To achieve the above object, according to one aspect of the present application, there is provided a method for deploying k3s on an android system, comprising the steps of:
step S100, modifying an android system kernel configuration file to establish an environment supporting k3S operation;
step S200, cross-compiling a dependency library file operated by a k3S agent, creating a k3S starting program, and embedding the k3S starting program into android source codes;
step S300, compiling android source codes, generating a brushing firmware and brushing android equipment; k3s is run on the android device to complete k3s deployment on the android system.
In a possibly preferred embodiment, the step of creating a k3S start-up procedure in step S200 comprises:
step S210 sets the startup automatic operation service and gives the startup automatic operation service shell system permission to obtain the system permission required by the service k3S file.
In a possible preferred embodiment, the step of cross-compiling the dependency library run by the k3S agent in step S200 includes:
step S220 cross-compiles the k3S, runc, containerd, ipset, cni executable bin file and corresponding library file under the android arm64 architecture.
In a possibly preferred embodiment, the step of interleaving the dependency library run by the k3S agent and the k3S initiator into the android source code in step S200 includes:
step S230, placing the dependent library file operated by the k3S agent into a corresponding directory outside the android source code;
and step S240, writing an android.bp file, respectively embedding the dependency library files in a binary file preassembling mode, and adding the dependency library files to an engineering configuration list to participate in system compiling so as to generate a dependency library file path directory.
In a possibly preferred embodiment, the step of cross-compiling the k3S, runc, containerd, ipset, cni executable bin file and the corresponding library file under the android arm64 architecture in step S220 includes:
step S221, obtaining k3S source codes, and forcibly designating os as linux under all conditions of judging that the current os is android; meanwhile, when cpu info is acquired, the judgment of os is removed; repairing the difference problem of the names of access nodes of the CPU, and removing the prefix of the default name of the node; repairing the cgroup root path to specify a management group path, and isolating the cgroup management group of k3s from the cgroup management group of android;
step S222, acquiring a con-containing source code, and forcibly designating os as linux under all conditions of judging that the current os is android; repairing the difference problem of the names of access nodes of the CPU, and removing the prefix of the default name of the node; repairing the cgroup root path to specify a management group path, and isolating the cgroup management group of k3s from the cgroup management group of android;
step S223 obtains the source codes of ipset and libmnl, and compiles and generates a translation static library libmnl.a required by the ipset; configuring a dependent kernel environment, and compiling to generate an ipset executable file;
step S224 is to acquire a run source code, repair the problem of difference of access node names of the CPU, and remove the prefix of the default name of the node; acquiring libsecomp source codes, and compiling a static library libsecomp.a required by runc generation; compiling and generating a runc executable file;
step S225 obtains source codes of the cni and cni plug-ins, compiles libcni and cnitol, generates cnitol, compiles plug-ins and generates executable files.
In a possibly preferred embodiment, the step of modifying the android system kernel configuration file in step S100 includes:
step 110 adds IPSet, overlayfs, IPVS, netfilter connection tracking support, 802.1d ethernet bridge support;
step 120 configures IPVS to support IPVS TCP/UDP transport protocol load balancing, and support IPVS round robin dispersion algorithm, and turns on the function of allowing matching according to the IPVS attribute of the packet;
step 130 configures the 802.1d ethernet bridge to allow the ethernet bridge to selectively forward multicast packets on different ports according to IGMP load;
step 140, starting access rights of tasks in the cgroups to the equipment, limiting the number of all processes in the same cgroup, starting performance monitoring options for the cgroups, starting a function of allowing limiting the use amount of the pages of the cgroups, and setting IO rate of each cgroup to the specific equipment;
step 150, configuring a kernel support POSIX message queue, supporting a usable PID namespace, supporting a user to reconstruct a network space structure, setting the size of a hash table used by mapping a source IP address to a service, and configuring a bandwidth controllable function of a CPU.
To achieve the above object, corresponding to the above method example, according to a second aspect of the present application, there is also provided a system for deploying k3s on an android system, comprising:
a storage unit, configured to store a program including any of the method steps for deploying k3s on an android system, so that the detection unit, the processing unit, and the communication unit timely call and execute the program;
the detection unit is used for connecting with android equipment through the communication unit, acquiring an android system kernel configuration file of the current equipment, and correspondingly modifying to establish an environment supporting k3s operation;
the processing unit is used for cross compiling a dependency library file operated by the k3s agent, creating a k3s starting program and arranging the dependency library file and the k3s starting program into the android source code together; and compiling android source codes to generate a brushing firmware, and brushing android equipment through the communication unit.
In a possible preferred embodiment, in the process of creating the k3s startup procedure, the processing unit is configured to set a startup autorun service and assign a system authority to the startup autorun service shell, so as to obtain a system authority required for servicing the k3s file.
In a possibly preferred embodiment, the dependency library file in which the k3s agent runs includes: k3s, runc, containerd, ipset, cni may execute bin files and corresponding library files.
To achieve the above object, corresponding to the above method example, according to a third aspect of the present application, there is also provided a computer-readable storage medium having stored thereon a computer program, wherein the computer program, when executed by a processor, implements the steps of the method of deploying k3s on an android system as described in any of the above.
By the method, the system and the storage medium for deploying k3s on the android system, the k3s can be deployed on the android system, meanwhile, the integrity of read-only partitions such as android boot/system/vendor can be maintained, and the problem of fota upgrading is avoided.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the application. In the drawings:
FIG. 1 is a schematic diagram of a system architecture of a method for deploying k3s on an android system, wherein the left part is an original architecture diagram of the android system, and the right part is an expanded schematic diagram of a k3s environment;
FIG. 2 is a flow chart of steps of the method of deploying k3s on an android system of the present application;
FIG. 3 is a diagram of a k3s environment directory tree structure built into an android mirror system partition in the method of deploying k3s on an android system of the present application;
FIG. 4 is a schematic diagram of a system architecture for deploying k3s on an android system in accordance with the present application.
Detailed Description
In order that those skilled in the art can better understand the technical solutions of the present application, the following description will clearly and completely describe the specific technical solutions of the present application in conjunction with the embodiments to help those skilled in the art to further understand the present application. It will be apparent that the embodiments described herein are merely some, but not all embodiments of the application. It should be noted that embodiments of the present application and features of embodiments may be combined with each other by those of ordinary skill in the art without departing from the spirit of the present application and without conflicting with each other. All other embodiments, which are derived from the embodiments herein without creative effort for a person skilled in the art, shall fall within the disclosure and the protection scope of the present application.
Furthermore, the terms first, second, S1, S2 and the like in the description and in the claims and drawings are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the application described herein may be implemented in sequences other than those described herein. Also, the terms "comprising" and "having" and any variations thereof herein are intended to cover a non-exclusive inclusion. Unless specifically stated or limited otherwise, the terms "disposed," "configured," "mounted," "connected," "coupled" and "connected" are to be construed broadly, e.g., as being either permanently connected, removably connected, or integrally connected; can be mechanically or electrically connected; can be directly connected or indirectly connected through an intermediate medium, and can be communication between two elements. The specific meaning of the terms in this case will be understood by those skilled in the art in view of the specific circumstances and in combination with the prior art.
Although android is derived from linux, it is quite different from standard linux, for example: the kernel, package management (executable file cannot be installed like linux), rights management, user management, program execution environment, etc. are very different, so that a program that can be directly run on linux cannot be directly run on android in general.
Thus, in order to implement deployment of k3s on an android system, referring to fig. 1 to 3, the present application provides a method for deploying k3s on an android system, including the steps of:
step S100 modifies the android system kernel configuration file to establish an environment supporting k3S operation.
Specifically, in order for k3s to run on an android system, first, an android kernel needs to be customized to support the k3s running environment. Because the original android kernel defaults to not support the k3s running condition, kernel profile modifications to the android source code, such as (kernel-4.19/arch/arm 64/configs/sprd_sharl5_defcon), are required to perfect the k3s kernel environment. The method comprises the following steps:
step 110:
adding IPSet support, configuring config_ip_set=y;
adding overlayfs support for dock, configuring config_overlayfs=y;
IPVS support required by k3s is added, and ONFIG_IP_VS=y is configured;
adding Netfilter connection tracking support function, and configuring config_ip_vs_nfct=y;
add 802.1d ethernet BRIDGE support, configure config_bridge=y.
Step 120:
configuring IPVS to support IPVS TCP transport protocol load balancing, configuring config_ip_vs_proto_tcp=y;
configuring IPVS to support IPVS UDP transport protocol load balancing, configuring config_ip_vs_proto_udp=y;
configuring IPVS to support an IPVS loop dispersion algorithm, configuring config_ip_vs_rr=y;
the function that allows matching according to the IPVS attribute of the packet is turned on, configuring config_ NETFILTER _xt_match_ipvs=y.
Step 130:
configuring an 802.1d Ethernet BRIDGE, allowing the Ethernet BRIDGE to selectively forward multicast packets on different ports according to an IGMP load, and configuring CONFIG_BRIDGE_IGMP_SNOOPING=y;
step 140:
starting access rights of the task to the equipment in the CGROUP, and configuring CONFIG_CGROUP_DEVICE=y;
configuration allows limiting the number of all processes in the same CGROUP, configuration config_cgroup_pids=y;
starting a performance monitoring option for CGROUP, and configuring config_cgroup_pef=y;
starting a function for allowing limiting the use amount of the pages of the group, and configuring CONFIG_CGROUP_HUGETLB;
setting an IO rate which allows limiting each cgroup to a specific device; configuration config_blk_dev_threttling=y.
Step 150:
adding a support POSIX message queue, and configuring config_posix_mqueue=y;
add support can use PID namespaces to configure config_pid_ns=y;
adding a support user to reconstruct the network space structure and configuring config_net_ns=y;
setting the size of a hash table used by mapping a source IP address to a service to 8, and configuring config_ip_vs_sh_tab_bits=8;
the BANDWIDTH controllable function of the CPU is configured, config_cfs_bandwidth=y.
Step S200 is to cross-compile a dependency library file operated by the k3S agent, create a k3S starting program and build the k3S starting program into android source codes together.
Specifically, the step of cross-compiling the dependency library run by the k3S agent in step S200 includes:
step S220 uses ndk cross-compiles the k3S, runc, containerd, ipset, cni executable bin file and corresponding library file under the android arm64 architecture. The specific cross-compiling steps are as follows:
step S221 performs the cross-compilation step of k3S including:
obtaining k3s source codes, and forcibly designating os as linux under all conditions of judging that the current os is android; repairing the cpu info, and removing the judgment of os when the cpu info is acquired, wherein the condition can be intercepted; repairing the access node problem of the cpuxes, wherein the names of the Android cpuxes are different, the node names of the linux are mostly provided with a cpuxet prefix, for example, the cpuxet.mem_hardwall, and the Android is mem_hardwall, so k3s is the node name of the Android, and the prefix 'cpuxet' is removed during reading; repairing a cgroup root path, wherein the default is designated as/sys/fs/cgroup, and because the android system defaults that the cgroup root management group is at/dev/level, the cgroup management group of k3s is isolated from the cgroup management group of the android, and the path of the designated management group is/sys/fs/cgroup; the compiling is performed, and the compiled executable file can be renamed as kubcect.
Step S222 performs the cross-compilation step of the containerd including:
acquiring a con-containing source code, and forcibly designating os as linux under all conditions of judging that the current os is android; repairing the access node problem of the cpuxes, wherein the names of the Android cpuxes are different, the node names of the linux are mostly provided with a cpuxet prefix, for example, the cpuxet.mem_hardwall, and the Android is mem_hardwall, so k3s is the node name of the Android, and the prefix 'cpuxet' is removed during reading; repairing a cgroup root path, wherein the default is designated as/sys/fs/cgroup, and because the android system defaults that the cgroup root management group is at/dev/level, the cgroup management group of k3s is isolated from the cgroup management group of the android, and the path of the designated management group is/sys/fs/cgroup; make compilation is performed, generating files ctr, containerd, containerd-shim, containerd-shim-run-v 1, con-tainerd-shim-run-v 2.
Step S223 performs the cross-compilation step of ipset including:
acquiring ipset and libmnl source codes, configuring ndk cross compiling environment, and compiling and generating a translation static library libmnl.a required by ipset; the dependent kernel environment is configured, in this step, kernel codes of android source codes and kernel compiling environments are needed, two variables, namely-with-kbuild (kernel compiling path) and-with-ksource (kernel path in android source codes), are configured before make, and finally an ipset executable file is compiled and generated.
Step S224 performs the cross-compilation step of runc including:
obtaining a run source code, repairing access node problems of the cpuxes, wherein the names of the Android cpuxes are different, most of the node names of the linux have a cpuxet prefix, for example, the cpuxet.mem_hardwall, and the Android is mem_hardwall, so k3s is the node name of the matched Android, and the prefix 'cpuxet' is removed during reading; and acquiring libsecomp source codes, configuring a ndk cross compiling environment, compiling a static library libsecomp.a required for generating a runc, and finally compiling and generating a runc executable file.
Step S225 performs the cross-compilation step of cni including:
acquiring source codes of the cni and cni plugins, compiling libcni and cnitol to generate cnitol, compiling plugins to generate executable files bandwidth, bridge, dhcp, firmware, flash, host-device, host-local, ipvlan, lopback, macvlan, portmap, ptp, sbr, static, turn, vlan, vrf.
After final finishing, as shown in FIG. 3, a k3s environment directory tree is obtained that needs to be built into the android mirror system partition.
Further, the step of creating the k3S start-up procedure in step S200 includes:
step S210 sets the startup automatic operation service and gives the startup automatic operation service shell system permission to obtain the system permission required by the service k3S file.
Specifically, firstly, under a k3s-agent script, a cgroup manager is built by mounting, and then ip route and rule and a namerver are set; then setting the automatic running service k3s_service, wherein in order to provide higher system authority of the automatic running service, daemon of the automatic running service is preferably initialized in the example, and rules of the domain for conveniently processing selinux of the automatic running service k3s_service are customized
type k3s_service, domain, coredomain, service_manager_type;
init_daemon_domain(k3s_service);
k3s_service switches to k3s_service domain with a process running in shell_exec (e.g., a k3s executable file)
domain_auto_trans(k3s_service, shell_exec, k3s_service)
Finally setting the operation mode of the whole field of k3s_service as admissive,
permissive k3s_service;
therefore, the system authority of the boot automatic operation service execution shell can be given to obtain the selinux authority required by the service k3s file.
Further, the step of intersecting the dependency library running the k3S agent and the k3S initiator into the android source code in step S200 includes:
step S230, placing the dependency library file operated by the k3S agent into android source codes/external/k 3S/catalogs;
step S240 is to write an android. Bp file, embed the dependency library files in a pre-loading mode of cc_pre-building_binary binary files, add the dependency library files to an engineering configuration list to participate in system compiling, and finally generate paths android source code/out/target/product/{ project }/system/bin and android source code/out/target/product/{ project }/system/user/cni/catalog, wherein the paths android source code/out/target/product/{ project }/system/user/cni/catalog are consistent with the catalog structure of FIG. 3.
Step S300, compiling android source codes, generating a brushing firmware and brushing android equipment; k3s is run on the android device, whereby k3s deployment can be completed on the android system.
On the other hand, as shown in fig. 4, corresponding to the above method example, the present application further provides a system for deploying k3s on an android system, which includes:
a storage unit, configured to store a program including any of the method steps for deploying k3s on an android system, so that the detection unit, the processing unit, and the communication unit timely call and execute the program;
the detection unit is used for connecting with android equipment through the communication unit, acquiring an android system kernel configuration file of the current equipment, and correspondingly modifying to establish an environment supporting k3s operation;
the processing unit is used for cross compiling a dependency library file operated by the k3s agent, creating a k3s starting program and arranging the dependency library file and the k3s starting program into the android source code together; and compiling android source codes to generate a brushing firmware, and brushing android equipment through the communication unit.
Further, in the process of creating the k3s startup procedure, the processing unit is configured to set a startup automatic operation service and assign the startup automatic operation service shell with system authority so as to obtain the system authority required by the service k3s file.
Further, the dependency library file in which the k3s agent runs includes: k3s, runc, containerd, ipset, cni may execute bin files and corresponding library files.
In another aspect, the present application also provides a computer readable storage medium having a computer program stored thereon, where the computer program, when executed by a processor, implements the steps of the method for deploying k3s on an android system as described in any of the above.
In summary, by the method, the system and the storage medium for deploying k3s on the android system, which are provided by the application, the k3s can be deployed on the android system, meanwhile, the integrity of read-only partitions such as android boot/system/vendor can be maintained, and the problem of fota upgrading is ensured not to occur.
The preferred embodiments of the application disclosed above are intended only to assist in the explanation of the application. The preferred embodiments are not exhaustive or to limit the application to the precise form disclosed. Obviously, many modifications and variations are possible in light of the above teaching. The embodiments were chosen and described in order to best explain the principles of the application and the practical application, to thereby enable others skilled in the art to best understand and utilize the application. The application is to be limited only by the following claims and their full scope and equivalents, and any modifications, equivalents, improvements, etc., which fall within the spirit and principles of the application are intended to be included within the scope of the application.
It will be appreciated by those skilled in the art that the system, apparatus and their respective modules provided by the present application may be implemented entirely by logic programming method steps, in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers, etc., except for implementing the system, apparatus and their respective modules provided by the present application in a purely computer readable program code. Therefore, the system, the apparatus, and the respective modules thereof provided by the present application may be regarded as one hardware component, and the modules included therein for implementing various programs may also be regarded as structures within the hardware component; modules for implementing various functions may also be regarded as being either software programs for implementing the methods or structures within hardware components.
Furthermore, all or part of the steps in implementing the methods of the embodiments described above may be implemented by a program, where the program is stored in a storage medium and includes several instructions for causing a single-chip microcomputer, chip or processor (processor) to execute all or part of the steps in the methods of the embodiments of the application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In addition, any combination of various embodiments of the present application may be performed, so long as the concept of the embodiments of the present application is not violated, and the disclosure of the embodiments of the present application should also be considered.

Claims (10)

1. A method of deploying k3s on an android system, the steps comprising:
step S100, modifying an android system kernel configuration file to establish an environment supporting k3S operation;
step S200, cross-compiling a dependency library file operated by a k3S agent, creating a k3S starting program, and embedding the k3S starting program into android source codes;
step S300, compiling android source codes, generating a brushing firmware and brushing android equipment; k3s is run on the android device to complete k3s deployment on the android system.
2. The method of deploying k3S on an android system of claim 1 wherein the step of creating a k3S startup procedure in step S200 comprises:
step S210 sets the startup automatic operation service and gives the startup automatic operation service shell system permission to obtain the system permission required by the service k3S file.
3. The method of deploying k3S on an android system of claim 1 wherein the step of cross-compiling the dependency library run by the k3S agent in step S200 comprises:
step S220 cross-compiles the k3S, runc, containerd, ipset, cni executable bin file and corresponding library file under the android arm64 architecture.
4. The method for deploying k3S on an android system according to claim 1, wherein the step of interleaving the dependency library run by the k3S agent and the k3S initiator into the android source code in step S200 comprises:
step S230, placing the dependent library file operated by the k3S agent into a corresponding directory outside the android source code;
and step S240, writing an android.bp file, respectively embedding the dependency library files in a binary file preassembling mode, and adding the dependency library files to an engineering configuration list to participate in system compiling so as to generate a dependency library file path directory.
5. The method of deploying k3S on an android system of claim 3 wherein the step of cross-compiling k3S, runc, containerd, ipset, cni executable bin files and corresponding library files under the android arm64 architecture in step S220 comprises:
step S221, obtaining k3S source codes, and forcibly designating os as linux under all conditions of judging that the current os is android; meanwhile, when cpu info is acquired, the judgment of os is removed; repairing the difference problem of the names of access nodes of the CPU, and removing the prefix of the default name of the node; repairing the cgroup root path to specify a management group path, and isolating the cgroup management group of k3s from the cgroup management group of android;
step S222, acquiring a con-containing source code, and forcibly designating os as linux under all conditions of judging that the current os is android; repairing the difference problem of the names of access nodes of the CPU, and removing the prefix of the default name of the node; repairing the cgroup root path to specify a management group path, and isolating the cgroup management group of k3s from the cgroup management group of android;
step S223 obtains the source codes of ipset and libmnl, and compiles and generates a translation static library libmnl.a required by the ipset; configuring a dependent kernel environment, and compiling to generate an ipset executable file;
step S224 is to acquire a run source code, repair the problem of difference of access node names of the CPU, and remove the prefix of the default name of the node; acquiring libsecomp source codes, and compiling a static library libsecomp.a required by runc generation; compiling and generating a runc executable file;
step S225 obtains source codes of the cni and cni plug-ins, compiles libcni and cnitol, generates cnitol, compiles plug-ins and generates executable files.
6. The method for deploying k3S on an android system of claim 1 wherein the step of modifying the android system kernel configuration file in step S100 comprises:
step 110 adds IPSet, overlayfs, IPVS, netfilter connection tracking support, 802.1d ethernet bridge support;
step 120 configures IPVS to support IPVS TCP/UDP transport protocol load balancing, and support IPVS round robin dispersion algorithm, and turns on the function of allowing matching according to the IPVS attribute of the packet;
step 130 configures the 802.1d ethernet bridge to allow the ethernet bridge to selectively forward multicast packets on different ports according to IGMP load;
step 140, starting access rights of tasks in the cgroups to the equipment, limiting the number of all processes in the same cgroup, starting performance monitoring options for the cgroups, starting a function of allowing limiting the use amount of the pages of the cgroups, and setting IO rate of each cgroup to the specific equipment;
step 150, configuring a kernel support POSIX message queue, supporting a usable PID namespace, supporting a user to reconstruct a network space structure, setting the size of a hash table used by mapping a source IP address to a service, and configuring a bandwidth controllable function of a CPU.
7. A system for deploying k3s on an android system, comprising:
a storage unit for storing a program comprising the method steps of deploying k3s on an android system according to any one of claims 1 to 6, for the detection unit, the processing unit, and the communication unit to timely fetch and execute;
the detection unit is used for connecting with android equipment through the communication unit, acquiring an android system kernel configuration file of the current equipment, and correspondingly modifying to establish an environment supporting k3s operation;
the processing unit is used for cross compiling a dependency library file operated by the k3s agent, creating a k3s starting program and arranging the dependency library file and the k3s starting program into the android source code together; and compiling android source codes to generate a brushing firmware, and brushing android equipment through the communication unit.
8. The system for deploying k3s on an android system according to claim 7, wherein the processing unit is configured to set a startup autorun service and assign system authority to the startup autorun service shell in order to obtain system authority required for servicing the k3s file during the process of creating the k3s startup program.
9. The system for deploying k3s on an android system of claim 7 wherein the dependency library file run by the k3s agent comprises: k3s, runc, containerd, ipset, cni may execute bin files and corresponding library files.
10. A computer readable storage medium having stored thereon a computer program, wherein the computer program, when executed by a processor, implements the steps of the method of deploying k3s on an android system as claimed in any one of claims 1 to 6.
CN202311232362.9A 2023-09-22 2023-09-22 Method and system for deploying k3s on android system and storage medium Active CN117112144B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311232362.9A CN117112144B (en) 2023-09-22 2023-09-22 Method and system for deploying k3s on android system and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311232362.9A CN117112144B (en) 2023-09-22 2023-09-22 Method and system for deploying k3s on android system and storage medium

Publications (2)

Publication Number Publication Date
CN117112144A true CN117112144A (en) 2023-11-24
CN117112144B CN117112144B (en) 2024-03-12

Family

ID=88803940

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311232362.9A Active CN117112144B (en) 2023-09-22 2023-09-22 Method and system for deploying k3s on android system and storage medium

Country Status (1)

Country Link
CN (1) CN117112144B (en)

Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108376074A (en) * 2016-11-28 2018-08-07 中国科学院声学研究所 A kind of RancherOS ros nucleus module transplantation methods based on embedded system
WO2019184116A1 (en) * 2018-03-30 2019-10-03 平安科技(深圳)有限公司 Method and device for automatically building kubernetes main node, terminal device and computer-readable storage medium
CN110990026A (en) * 2019-10-10 2020-04-10 武汉烽火信息集成技术有限公司 Automatic deployment method and system for PaaS platform
KR20200105582A (en) * 2019-02-28 2020-09-08 에스케이브로드밴드주식회사 Virtual desktop system using container and method thereof
CN113641503A (en) * 2021-09-01 2021-11-12 上海联蔚盘云科技有限公司 Multi-cloud multi-cluster Kubernetes management system, method and equipment
US20210382727A1 (en) * 2020-06-08 2021-12-09 Pivotal Software, Inc. Configuration container for container orchestration platform
WO2022062304A1 (en) * 2020-09-25 2022-03-31 亮风台(上海)信息科技有限公司 Method and device for deploying image recognition service on container cloud
CN114285698A (en) * 2021-12-28 2022-04-05 北京航空航天大学 Method for constructing DDS communication middleware based on K3s on embedded operating system
CN114327484A (en) * 2021-12-31 2022-04-12 华云数据控股集团有限公司 Multi-architecture supporting K8S integration and deployment method, system and storage medium
WO2022183573A1 (en) * 2021-03-02 2022-09-09 长沙景嘉微电子股份有限公司 Method and device for generating and installing driver installation packet supporting multiple kernel versions
CN115033336A (en) * 2022-04-21 2022-09-09 浪潮通信技术有限公司 Container virtual machine management method and system
CN115237436A (en) * 2022-08-29 2022-10-25 北京百度网讯科技有限公司 Application deployment method and device, electronic equipment and readable storage medium
US20220405385A1 (en) * 2019-12-12 2022-12-22 Foundation Of Soongsil University-Industry Cooperation Secure container construction device and method executable by android application, and computer-readable recording medium on which program thereof is recorded
CN115562807A (en) * 2022-10-12 2023-01-03 湖南多行云计算机科技有限公司 Method and system for mounting dynamic equipment for android container in kubernets environment
CN116204302A (en) * 2022-12-14 2023-06-02 南京机敏软件科技有限公司 Equipment scheduling method based on K8S An Zhuoyun mobile phone
CN116301943A (en) * 2023-03-22 2023-06-23 昭通亮风台信息科技有限公司 Image construction method of kubernetes cluster based on container

Patent Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108376074A (en) * 2016-11-28 2018-08-07 中国科学院声学研究所 A kind of RancherOS ros nucleus module transplantation methods based on embedded system
WO2019184116A1 (en) * 2018-03-30 2019-10-03 平安科技(深圳)有限公司 Method and device for automatically building kubernetes main node, terminal device and computer-readable storage medium
KR20200105582A (en) * 2019-02-28 2020-09-08 에스케이브로드밴드주식회사 Virtual desktop system using container and method thereof
CN110990026A (en) * 2019-10-10 2020-04-10 武汉烽火信息集成技术有限公司 Automatic deployment method and system for PaaS platform
US20220405385A1 (en) * 2019-12-12 2022-12-22 Foundation Of Soongsil University-Industry Cooperation Secure container construction device and method executable by android application, and computer-readable recording medium on which program thereof is recorded
US20210382727A1 (en) * 2020-06-08 2021-12-09 Pivotal Software, Inc. Configuration container for container orchestration platform
WO2022062304A1 (en) * 2020-09-25 2022-03-31 亮风台(上海)信息科技有限公司 Method and device for deploying image recognition service on container cloud
WO2022183573A1 (en) * 2021-03-02 2022-09-09 长沙景嘉微电子股份有限公司 Method and device for generating and installing driver installation packet supporting multiple kernel versions
CN113641503A (en) * 2021-09-01 2021-11-12 上海联蔚盘云科技有限公司 Multi-cloud multi-cluster Kubernetes management system, method and equipment
CN114285698A (en) * 2021-12-28 2022-04-05 北京航空航天大学 Method for constructing DDS communication middleware based on K3s on embedded operating system
CN114327484A (en) * 2021-12-31 2022-04-12 华云数据控股集团有限公司 Multi-architecture supporting K8S integration and deployment method, system and storage medium
CN115033336A (en) * 2022-04-21 2022-09-09 浪潮通信技术有限公司 Container virtual machine management method and system
CN115237436A (en) * 2022-08-29 2022-10-25 北京百度网讯科技有限公司 Application deployment method and device, electronic equipment and readable storage medium
CN115562807A (en) * 2022-10-12 2023-01-03 湖南多行云计算机科技有限公司 Method and system for mounting dynamic equipment for android container in kubernets environment
CN116204302A (en) * 2022-12-14 2023-06-02 南京机敏软件科技有限公司 Equipment scheduling method based on K8S An Zhuoyun mobile phone
CN116301943A (en) * 2023-03-22 2023-06-23 昭通亮风台信息科技有限公司 Image construction method of kubernetes cluster based on container

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
唐墨123: "k8s 部署android实例", pages 1 - 5, Retrieved from the Internet <URL:https://blog.csdn.net/jacky128256/article/details/123464358> *
相铮;石春鹏;韩立新;: "Docker容器技术在MES系统部署中的应用", 制造业自动化, no. 04, 25 April 2020 (2020-04-25), pages 1 - 5 *
运维人在路上: "k3s安装与部署", pages 1 - 7, Retrieved from the Internet <URL:https://www.cnblogs.com/hujinzhong/p/15014487.html> *

Also Published As

Publication number Publication date
CN117112144B (en) 2024-03-12

Similar Documents

Publication Publication Date Title
US20230081942A1 (en) Automatically Deployed Information Technology (IT) System and Method
US10372464B2 (en) Provisioning the hyper-converged infrastructure bare metal systems from the top of the rack switch
US20210136147A1 (en) Methods, systems and computer readable media for self-replicating cluster appliances
US9465625B2 (en) Provisioning of operating environments on a server in a networked environment
US9250672B2 (en) Cloning target machines in a software provisioning environment
Hashimoto Vagrant: up and running: create and manage virtualized development environments
Nguyen et al. Distributed mpi cluster with docker swarm mode
US10732961B1 (en) Systems and methods for performing in-service software upgrades on active network devices
CN110990026B (en) Automatic deployment method and system for PaaS platform
US11528186B2 (en) Automated initialization of bare metal servers
US11567672B2 (en) Data and configuration integrity checking post-rollback using backups in virtualized computing environments
WO2022213850A1 (en) Method and apparatus for constructing android running environment
CN114902177A (en) Update of boot code handlers
US20230025529A1 (en) Apparatus and method for managing a distributed system with container image manifest content
WO2017052528A1 (en) Selecting and loading firmware volumes
US10282346B1 (en) Scalable network device self-configuration in large networks
US20230229481A1 (en) Provisioning dpu management operating systems
US20220121502A1 (en) System and Method for Auto-Clustering of Clusterable Services
CN111913719B (en) Deployment method, device and apparatus of high-availability software and computer storage medium
US20230229480A1 (en) Provisioning dpu management operating systems using firmware capsules
EP3114563A1 (en) Method for generating upgrade campaigns to upgrade virtualization facilities
CN113965548A (en) Hardware drive updating method, system, equipment and medium of storage server
CN117112144B (en) Method and system for deploying k3s on android system and storage medium
US20230385052A1 (en) Obtaining software updates from neighboring hosts in a virtualized computing system
US11295018B1 (en) File system modification

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant