当前位置:网站首页>kubekey2.2.1 kubernetes1.23.7离线包制作+harbor部暑并上传镜像
kubekey2.2.1 kubernetes1.23.7离线包制作+harbor部暑并上传镜像
2022-06-29 17:49:00 【蝎】
1 离线安装–安装包制作(mutli_arch)
1.1 下载kubekey
install_path=/data
kkversion=v2.2.1
mkdir $install_path
cd $install_path
curl -L https://github.com/kubesphere/kubekey/releases/download/$kkversion/kubekey-$kkversion-linux-amd64.tar.gz -o kubekey-$kkversion-linux-amd64.tar.gz
tar zxvf kubekey-$kkversion-linux-amd64.tar.gz
#生成id_rsa key
ssh-keygen -f /root/.ssh/id_rsa -P ''
1.2 生成manifest-sample.yaml
#./kk create manifest
#修改manifest-sample.yaml
cat > manifest-sample.yaml << 'EOF'
apiVersion: kubekey.kubesphere.io/v1alpha2
kind: Manifest
metadata:
name: sample
spec:
arches:
- amd64
- arm64 #增加arm64架构
operatingSystems:
- arch: amd64
type: linux
id: centos
version: "7"
osImage: CentOS Linux 7 (Core)
repository:
iso:
localPath:
url: https://github.com/kubesphere/kubekey/releases/download/v2.2.0/centos7-rpms-amd64.iso
- arch: arm64 #增加arm64架构
type: linux
id: centos
version: "7"
osImage: CentOS Linux 7 (Core)
repository:
iso:
localPath:
url: https://github.com/kubesphere/kubekey/releases/download/v2.2.0/centos7-rpms-arm64.iso
kubernetesDistributions:
- type: kubernetes
version: v1.23.7
components:
helm:
version: v3.6.3
cni:
version: v0.9.1
etcd:
version: v3.4.13
containerRuntimes:
- type: containerd
version: 1.6.4
crictl:
version: v1.24.0
##
# docker-registry:
# version: "2"
harbor:
version: v2.4.1
docker-compose:
version: v2.2.2
images:
- registry.cn-beijing.aliyuncs.com/kubesphereio/cni:v3.20.0
- registry.cn-beijing.aliyuncs.com/kubesphereio/coredns:1.8.6
- registry.cn-beijing.aliyuncs.com/kubesphereio/k8s-dns-node-cache:1.15.12
- registry.cn-beijing.aliyuncs.com/kubesphereio/kube-apiserver:v1.23.7
- registry.cn-beijing.aliyuncs.com/kubesphereio/kube-controller-manager:v1.23.7
- registry.cn-beijing.aliyuncs.com/kubesphereio/kube-controllers:v3.20.0
- registry.cn-beijing.aliyuncs.com/kubesphereio/kube-proxy:v1.23.7
- registry.cn-beijing.aliyuncs.com/kubesphereio/kube-scheduler:v1.23.7
- registry.cn-beijing.aliyuncs.com/kubesphereio/node:v3.20.0
- registry.cn-beijing.aliyuncs.com/kubesphereio/pause:3.6
- registry.cn-beijing.aliyuncs.com/kubesphereio/pod2daemon-flexvol:v3.20.0
registry:
auths: {
}
EOF
1.2导出并生成离线安装包
export KKZONE=cn
./kk artifact export -m manifest-sample.yaml -o kubernetes_v1.23.7_mutli.tar.gz
2.2 生成离线集群配置文件
./kk create config --with-kubernetes v1.23.7 -f config-sample.yaml
#修改config-sample.yaml文件
kind: Cluster
metadata:
name: sample
spec:
hosts:
- {
name: master01, address: 192.168.11.101, internalAddress: 192.168.11.101, user: root, password: "123456"}
- {
name: node01, address: 192.168.11.102, internalAddress: 192.168.11.102, user: root, password: "123456"}
- {
name: registry, address: 192.168.11.100, internalAddress: 192.168.11.100, user: root, password: "123456"}
roleGroups:
etcd:
- master01
control-plane:
- master01
worker:
- master01
- node01
registry:
- registry
controlPlaneEndpoint:
## Internal loadbalancer for apiservers
# internalLoadbalancer: haproxy
domain: lb.lady.cn
address: ""
port: 6443
kubernetes:
version: v1.23.7
clusterName: cluster.local
autoRenewCerts: true
containerManager: containerd
etcd:
type: kubekey
network:
plugin: calico
kubePodsCIDR: 10.178.64.0/18
kubeServiceCIDR: 10.178.0.0/18
## multus support. https://github.com/k8snetworkplumbingwg/multus-cni
multusCNI:
enabled: false
registry:
type: harbor
auths:
"dockerhub.kubekey.local":
username: admin
password: Harbor12345
skipTLSVerify: true
plainHTTP: false
# 设置集群部署时使用的私有仓库
privateRegistry: "dockerhub.kubekey.local"
#privateRegistry: ""
namespaceOverride: "kubesphereio"
registryMirrors: []
insecureRegistries: []
addons: []
3.1、创建私仓库
./kk init registry -f config-sample.yaml -a kubernetes_v1.23.7_mutli.tar.gz
3.2创建仓库的project
cat > create_project_harbor.sh << 'EOF'
url="https://dockerhub.kubekey.local"
user="admin"
passwd="Harbor12345"
harbor_projects=(library
kubesphereio
kubesphere
calico
coredns
openebs
csiplugin
minio
mirrorgooglecontainers
osixia
prom
thanosio
jimmidyson
grafana
elastic
istio
jaegertracing
jenkins
weaveworks
openpitrix
joosthofman
nginxdemos
fluent
kubeedge
)
for project in "${harbor_projects[@]}"; do
echo "creating $project"
curl -u "${user}:${passwd}" -X POST -H "Content-Type: application/json" "${url}/api/v2.0/projects" -d "{ \"project_name\": \"${project}\", \"public\": true}" -k
done
EOF
bash create_project_harbor.sh
3.3 上传镜像包到私仓中(可略过)
./kk artifact images push -f config-sample.yaml -a kubernetes_v1.23.7_mutli.tar.gz


3、通过离线包安装kubernetes集群
./kk create cluster -f config-sample.yaml -a kubernetes_v1.23.7_mutli.tar.gz --with-packages -y
4、 验证

边栏推荐
- Self taught structure (small turtle C language)
- 迈动互联中标大家保险集团
- selenium上传文件
- Split palindrome string [dp + DFS combination]
- 剑桥大学教授:经常吃早餐害处多,很危险 - 知乎
- The aggregate function in the epidisplay package of R language divides numerical variables into different subsets based on factor variables, and calculates the summary statistics and aggregate data. W
- ISO 32000-2 international standard 7.7
- Can MySQL views create indexes
- R语言dplyr包filter函数通过组合逻辑(与逻辑)过滤dataframe数据中的数据、其中一个字段的内容等于指定向量中的其中一个,并且另外一个字段值大于某一阈值
- YoloV6+TensorRT+ONNX:基于WIN10+TensorRT8+YoloV6+ONNX的部署
猜你喜欢

Visio标注、批注位置

与爱同行,育润走进贫困家庭,助推公益事业

selenium 文件上传方法

基于gis三维可视化的智慧城市行业运用

selenium上传文件

How to solve the 2003 error of MySQL in Linux

How to create a virtual image

Walk with love, educate and run poor families, and promote public welfare undertakings

YoloV6+TensorRT+ONNX:基于WIN10+TensorRT8+YoloV6+ONNX的部署

Serial port experiment based on stm32f103zet6 library function
随机推荐
R language ggplot2 visualization: use the patchwork package (directly use the plus sign +) to horizontally combine the two ggplot2 visualization results, and then horizontally combine them with the th
基于STM32F103ZET6库函数串口实验
How to create and delete MySQL triggers
How to solve the 2003 error of MySQL in Linux
Fill in the next right node pointer of each node [make good use of each point - > reduce the space-time complexity as much as possible]
Yurun multidimensional makes efforts in the charity field and bravely resists the corporate public welfare banner
R language uses GLM of mass package The Nb function establishes the negative binomial generalized linear model, and the summary function obtains the summary statistical information of the negative bin
R语言dplyr包filter函数通过组合逻辑(与逻辑)过滤dataframe数据中的数据、其中一个字段的内容等于指定向量中的其中一个,并且另外一个字段值大于某一阈值
与爱同行,育润走进贫困家庭,助推公益事业
数字孪生能源系统,打造低碳时代“透视”眼
R语言使用glm函数构建泊松对数线性回归模型处理三维列联表数据构建饱和模型、使用exp函数和coef函数获取模型所有变量的事件密度比(Incidence Density Ratio,IDR)并解读
ISO 32000-2 international standard 7.7
The soft youth under the blessing of devcloud makes education "smart" in the cloud
Does rapid software delivery really need to be at the cost of security?
【WebDriver】使用AutoIt上传文件
Distributed | several steps of rapid read / write separation
MATLAB 最远点采样(FPS)
[try to hack] cookies and sessions
跨境独立站语言unicode转希伯来语
Createstore for Redux source code analysis