当前位置:网站首页>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、 验证

边栏推荐
- 小白月赛51 补题 E G F
- Mac installation php7.2
- 自定義HandlerInterceptor攔截器實現用戶鑒權
- selenium 组合键操作
- Teach you how to install the latest version of mysql8.0 database on windows, nanny level teaching
- The R language uses the KAP function (kap.2.raters function) of epidisplay package to calculate the value of kappa statistics (total consistency, expected consistency), analyze the consistency of the
- How to use the chart control of the b/s development tool devextreme - customize the axis position?
- 回文子串的最大长度(字符串哈希+二分)
- 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]
- 最长异或路径(dfs+01trie)
猜你喜欢

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

Industry application of smart city based on GIS 3D visualization

Detailed introduction and Simulation of bitmap

selenium 文件上传方法

The soft youth under the blessing of devcloud makes education "smart" in the cloud

Basic operations such as MySQL startup under Windows platform

Bloom filter:

关于日期相加减问题

Selenium upload file

YoloV6+TensorRT+ONNX:基于WIN10+TensorRT8+YoloV6+ONNX的部署
随机推荐
Epoll analysis
What technology is an applet container? Can it help Internet of things enterprises break through the red sea?
R language uses user-defined functions to write deep learning linear activation functions and visualize linear activation functions
迈动互联中标大家保险集团
How MySQL queries character set codes of tables
两种Controller层接口鉴权方式
与爱同行,育润走进贫困家庭,助推公益事业
How to use the chart control of the b/s development tool devextreme - customize the axis position?
Does MySQL support foreign keys
基于gis三维可视化的智慧城市行业运用
育润多维发力慈善领域,勇抗企业公益大旗
0 basic self-study STM32 (wildfire) - register lit LED
Prevent form resubmission based on annotations and interceptors
R language uses user-defined functions to write deep learning leaky relu activation functions and visualize leaky relu activation functions
Detailed introduction and Simulation of bitmap
How to solve MySQL 1045 error in Linux
Custom handlerinterceptor interceptor for user authentication
数字孪生能源系统,打造低碳时代“透视”眼
Mysql database literacy, do you really know what a database is
基于STM32F103ZET6库函数PWM输出实验