当前位置:网站首页>Discover K8E: minimalist kubernetes distribution
Discover K8E: minimalist kubernetes distribution
2022-06-26 16:45:00 【Cloud primary pointing North】
TL;DR
This article introduces and experiences minimalism Kubernetes Distribution version , Also by the way, analyze and learn the compiling process .
background
k8e The original meaning is kuber easy, It's a Kubernetes Minimalist distribution of , The intention is to deploy the cloud natively Kubernetes More relaxed .k8e Based on another distribution k3s , Cropped ( Removed Edge/IoT Related functions 、traefix etc. )、 Expand ( Join in ingress、sidecar Realization 、cilium etc. ) And come .
k8e It has the following characteristics :
- Single binary file , Integrated k8s The various components of 、containerd、runc、kubectl、nerdctl etc.
- Use cilium As cni The implementation of the , convenient eBPF Fast landing of
- Support based on pipy Of ingress、sidecar proxy, Realize one-stop management of application traffic
- Only one... Is maintained k8s edition , At present, it is 1.21
- According to the experience of private cloud, increase 、 Optimize the code
Thanks to these characteristics ,k8e Very suitable CI、 Development and enterprise deployment , The stand-alone cluster is suitable for the technical verification environment .

Install the test
It can be downloaded from GitHub Download the corresponding version of Binary , You can also compile it manually ( The compilation process is briefly analyzed later ).
sudo k8e check-configsudo k8e server &# Kubeconfig is written to /etc/k8e/k8e.yamlexport KUBECONFIG=/etc/k8e/k8e.yaml# On a different node run the below. NODE_TOKEN comes from# /var/lib/k8e/server/node-token on your serversudo k8e agent --server https://myserver:6443 --token ${NODE_TOKEN}# query all node from k8s clustersudo k8e kubectl get nodes Because there is no default cni Realization , here pod All in Pending state . Manual installation required cilium:
adopt k8e check-config Can find builddata Catalog :/var/lib/k8e/data/5a7ced03412504a18bf3f49cbee5dafca7187d86ef8fdaa789448d53d7fbb823
/var/lib/k8e/data/5a7ced03412504a18bf3f49cbee5dafca7187d86ef8fdaa789448d53d7fbb823/bin/cilium installcilium After successful installation Pod Running successfully , You can see cilium state :
/var/lib/k8e/data/5a7ced03412504a18bf3f49cbee5dafca7187d86ef8fdaa789448d53d7fbb823/bin/cilium status /¯¯\ /¯¯\__/¯¯\ Cilium: OK \__/¯¯\__/ Operator: OK /¯¯\__/¯¯\ Hubble: disabled \__/¯¯\__/ ClusterMesh: disabled \__/DaemonSet cilium Desired: 1, Ready: 1/1, Available: 1/1Deployment cilium-operator Desired: 1, Ready: 1/1, Available: 1/1Containers: cilium Running: 1 cilium-operator Running: 1Cluster Pods: 3/3 managed by CiliumImage versions cilium quay.io/cilium/cilium:v1.10.5: 1 cilium-operator quay.io/cilium/operator-generic:v1.10.5: 1 Or perform cilium connectivity test Check the network .
The above is the deployment as a development verification environment , To deploy standards Kubernetes, You can refer to Official documents .
Compilation process analysis
k8e The compilation and deployment of can be completed with two simple commands :
make generatemake perform make generate Download several built-in tools :runc、nerdctl、cilium, Save in bin Directory .
.DEFAULT_GOAL yes ci, perform make Will perform target ci .
Dapper
stay makefile The first line is TARGETS := $(shell ls hack | grep -v \\.sh | grep -v package-airgap| grep -v clean) Defined variables TARGETS, then $(TARGETS): .dapper For a few target Specify preconditions . Among them ci, So in execution ci I'll do it before target .dapper.
target .dapper For downloading rancher dapper.dapper yes Docker Build wrapper for , It will be executed in the root directory of the source code Dockerfile.dapper Build a mirror image , And use it as a code building environment .
stay Dockerfile.dapper in , Will be ready to build the environment , And several settings that need attention :
WORKDIR:/go/src/github.com/xiaods/k8e/, That is, the working directory of the container .dapperAt startup, the source code content will be copied to the containerENTRYPOINT:["./hack/entry.sh"], Container enabled entrypoint.CMD:["ci"], Default for container runtime CMDENVDAPPER_SOURCE:/go/src/github.com/xiaods/k8e/DAPPER_OUTPUT:./bin ./dist ./build/out, After building , Will executedocker cp ${DAPPER_SOURCE}/${DAPPER_OUTPUT} .Copy the contents of the container to the outside of the container .- ...
dapper When the download is complete, execute ci The order of :./.dapper ci, according to Dockerfile.dapper Configuration of , It will be executed after startup ./hack/entry.sh ci.
CI
CI Process and k3s The process is much simpler than that of . stay ./hack/ci in , Will execute in turn :
- ./hack/validate: Code formatting 、 check
- ./hack/build: The code to compile
- ./hack/package: Download the previous 、 Compilation of
bin/The binaries in the directory are packaged into the same binary file ( Use go-bindata). - ./hack/binary_size_check.sh: Binary file size check , Is it more than 81 M(k3s Yes. 64M, Because of the addition of cilium etc. cli, The volume will increase ).
The article is issued in official account
The cloud points north
边栏推荐
- 牛客编程题--必刷101之动态规划(一文彻底了解动态规划)
- Redis Guide (8): principle and implementation of Qianfan Jingfa distributed lock
- 【力扣刷题】单调栈:84. 柱状图中最大的矩形
- 当一个程序员一天被打扰 10 次,后果很惊人!
- 构造函数和析构函数
- 长安链交易防重之布谷鸟过滤器
- JUnit unit test
- 用Attention和微调BERT进行自然语言推断-PyTorch
- Leetcode 1170. 比较字符串最小字母出现频次(可以,已解决)
- Leetcode 1169. 查询无效交易(如果数据量不大,这种题还是得暴力枚举解决)
猜你喜欢

Science | giant bacteria found in mangroves challenge the traditional concept of nuclear free membrane

Développer un opérateur basé sur kubebuilder (démarrer)
Scala Basics (II): variables and data types

我把它当副业月入3万多,新手月入过万的干货分享!
Scala Foundation (2): variables et types de données

100+ data science interview questions and answers Summary - basic knowledge and data analysis

【力扣刷题】单调栈:84. 柱状图中最大的矩形

Exquisite makeup has become the "soft power" of camping, and the sales of vipshop outdoor beauty and skin care products have surged

5g is not flat and 6G is restarted. China leads wireless communication. What is the biggest advantage of 6G?

Qt 5.9.8 安装教程
随机推荐
Codeforces Round #802 (Div. 2)
5G未平6G再启,中国引领无线通信,6G的最大优势在哪里?
Some instance methods of mono
Notes on key review of software engineering at the end of the term
IAR engineering adapts gd32 chip
【MATLAB项目实战】基于卷积神经网络与双向长短时(CNN-LSTM)融合的锂离子电池剩余使用寿命预测
[chat in 5] eight years after graduation, I have been pursuing my dream
架构实战营毕业设计
Greenplum database fault analysis - semop (id=2000421076, num=11) failed: invalid argument
知道这几个命令让你掌握Shell自带工具
Junit单元测试
Learn about common functional interfaces
How can I get the stock account opening discount link? Is online account opening safe?
Stm32h7b0 replaces the h750 program, causing the MCU to hang up and unable to burn the program
Supplement the short board - Open Source im project openim about initialization / login / friend interface document introduction
Solution for filtering by special string of microservice
Natural language inference with attention and fine tuning Bert pytorch
100+ data science interview questions and answers Summary - basic knowledge and data analysis
C language --- basic function realization of push box 01
Day10 daily 3 questions (1): sum gradually to get the minimum value of positive numbers
