当前位置:网站首页>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、 验证
边栏推荐
- 自定義HandlerInterceptor攔截器實現用戶鑒權
- 基于STM32F103ZET6库函数定时器中断实验
- How to solve MySQL 1045 error in Linux
- 布隆过滤器:
- How to create and delete MySQL triggers
- What is the SRM system? How do I apply the SRM system?
- Prevent form resubmission based on annotations and interceptors
- Web Scraping with Beautiful Soup for Data Scientist
- 基于STM32F103ZET6库函数PWM输出实验
- 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
猜你喜欢
OpenFeign使用步骤 轮询策略与权重 log4j使用 openFeign拦截器的配置
2022 spring summer collection koreano essential reshapes the vitality of fashion
What technology is an applet container? Can it help Internet of things enterprises break through the red sea?
Bottom level internal skill cultivation
Two controller layer interface authentication methods
Parental delegation mechanism
Let's start with a bug that was cheated by the app store
Selenium upload file
Visio annotation, annotation location
Basic operations such as MySQL startup under Windows platform
随机推荐
关于日期相加减问题
一次采集JSON解析错误的修复
R language uses user-defined functions to write deep learning leaky relu activation functions and visualize leaky relu activation functions
R language ggplot2 visualization: use the patchwork package (directly use the plus sign +) to horizontally combine a ggplot2 visualization result and a plot function visualization result to form the f
lodash深拷贝使用
与爱同行,育润走进贫困家庭,助推公益事业
数字孪生能源系统,打造低碳时代“透视”眼
The dplyr package filter function of R language filters the data in dataframe data through combinatorial logic (and logic). The content of one field is equal to one of the specified vectors, and the v
Sword finger offer 13 Robot range of motion (BFS)
基于STM32F103ZET6库函数串口实验
最受欢迎的30款开源软件
selenium 文件上传方法
SSH protocol learning notes
R语言dplyr包filter函数通过组合逻辑(与逻辑)过滤dataframe数据中的数据、其中一个字段的内容等于指定向量中的其中一个,并且另外一个字段值大于某一阈值
Does MySQL support foreign keys
从一个被应用商店坑了的BUG说起
The R language inputs the distance matrix to the hclust function for hierarchical clustering analysis. The method parameter specifies the distance calculation method between two combined data points,
Split palindrome string [dp + DFS combination]
分割回文串[dp + dfs组合]
Openfeign use step polling strategy and weight log4j configuration of openfeign interceptor