当前位置:网站首页>kubernetes 二进制安装(v1.20.16)(五)验证 master 部署
kubernetes 二进制安装(v1.20.16)(五)验证 master 部署
2022-06-10 15:34:00 【看,未来】
状况
书接上文:kubernetes 二进制安装(v1.20.16)(四)部署 master
停了一天没有更新,因为出了点状况,在排查。
检查集群组件状态
生成连接集群证书配置
cd /opt/TLS/k8s/ssl
cat > admin-csr.json <<EOF { "CN": "admin", "hosts": [], "key": { "algo": "rsa", "size": 2048 }, "names": [ { "C": "CN", "L": "BeiJing", "ST": "BeiJing", "O": "system:masters", "OU": "System" } ] } EOF
生成连接证书
[[email protected] ssl]# cfssl gencert -ca=ca.pem -ca-key=ca-key.pem -config=ca-config.json -profile=kubernetes admin-csr.json | cfssljson -bare admin
....
#查看已生成的证书
[[email protected] ssl]# ll admin*
-rw-r--r-- 1 root root 1009 Apr 3 14:52 admin.csr
-rw-r--r-- 1 root root 229 Apr 3 14:52 admin-csr.json
-rw------- 1 root root 1679 Apr 3 14:52 admin-key.pem
-rw-r--r-- 1 root root 1399 Apr 3 14:52 admin.pem
生成kubeconfig文件
cd /opt/TLS/k8s/cfg
# 设置集群参数
kubectl config set-cluster kubernetes \
--certificate-authority=/opt/kubernetes/ssl/ca.pem \
--embed-certs=true \
--server=https://192.168.190.147:6443 \
--kubeconfig=/opt/TLS/k8s/cfg/config
# 设置客户端认证参数
kubectl config set-credentials cluster-admin \
--client-certificate=/opt/TLS/k8s/ssl/admin.pem \
--client-key=/opt/TLS/k8s/ssl/admin-key.pem \
--embed-certs=true \
--kubeconfig=/opt/TLS/k8s/cfg/config
#设置上下文参数
kubectl config set-context default \
--cluster=kubernetes \
--user=cluster-admin \
--kubeconfig=/opt/TLS/k8s/cfg/config
#设置默认上下文
kubectl config use-context default --kubeconfig=/opt/TLS/k8s/cfg/config
分发文件
mkdir /root/.kube
scp /opt/TLS/k8s/cfg/config /root/.kube/config
查看集群组件状态
#通过kubectl工具查看当前集群组件状态
[[email protected] cfg]# kubectl get cs
Warning: v1 ComponentStatus is deprecated in v1.19+
NAME STATUS MESSAGE ERROR
scheduler Healthy ok
etcd-0 Healthy {
"health":"true"}
controller-manager Healthy ok
etcd-2 Healthy {
"health":"true"}
etcd-1 Healthy {
"health":"true"}
#输出以上信息说明Master节点组件运行正常
我在排查的过程中添加了一个 apiserver 向外部访问的 client 证书,然后重新部署了一遍。
所以如果说你们部署到现在出现了失败,及时私信我,教程到这里还是没有问题的。
边栏推荐
- terminator如何设置字体显示不同颜色
- 【无标题】
- 竟然还有人说ArrayList是2倍扩容,今天带你手撕ArrayList源码
- QT interface nested movement based on qscrollarea
- CAP 6.1 版本发布通告
- Using GDB to quickly read the kernel code of PostgreSQL
- Cap version 6.1 Release Notice
- CentOS Linux is dead! Oracle Linux may be a better alternative
- 2290. Minimum Obstacle Removal to Reach Corner
- After class assignment for module 8 of phase 6 of the construction practice camp
猜你喜欢

Guanghetong cooperates with China Mobile, HP, MediaTek and Intel to build 5g fully connected PC pan terminal products

Yuntu says that every successful business system cannot be separated from apig

Explore the secrets behind the open source data visualization development platform flyfish!

安霸CV2FS/CV22FS获得ASIL C芯片功能安全认证,超越市场同类芯片水平

姿态估计之2D人体姿态估计 - Numerical Coordinate Regression with Convolutional Neural Networks(DSNT)

VINS理論與代碼詳解4——初始化

凸函数的Hessian矩阵与高斯牛顿下降法增量矩阵半正定性的理解

Vins theory and code explanation 4 - initialization

Solution to some problems of shadow knife RPA learning and meeting Excel

This and object prototypes
随机推荐
ORB_SLAM2视觉惯性紧耦合定位技术路线与代码详解3——紧耦合优化模型
Overview of cann interface calling process
广和通携手中国移动、惠普、联发科、英特尔合作打造5G全互联PC泛终端系列产品
After class assignment for module 8 of phase 6 of the construction practice camp
顺应医改,积极布局——集采背景下的高值医用耗材发展洞察2022
C# 游戏雏形 人物地图双重移动
Using GDB to quickly read the kernel code of PostgreSQL
Even some people say that ArrayList is twice as large. Today, I will take you to tear up the ArrayList source code
作用域和闭包
[MySQL basics]
Odoo authority management (access authority and record rules) is applied to upgrade role management
Anba cv2fs/cv22fs obtained ASIL C chip function safety certification, surpassing the level of similar chips in the market
竟然还有人说ArrayList是2倍扩容,今天带你手撕ArrayList源码
How the terminator sets the font to display different colors
Explore the secrets behind the open source data visualization development platform flyfish!
探索数据可视化开发平台FlyFish开源背后的秘密!
Net core Tianma XingKong series - Interface Implementation for dependency injection and mutual conversion of database tables and C entity classes
terminator如何设置字体显示不同颜色
VINS理论与代码详解0——理论基础白话篇
opencv神经网络库之SVM和ANN_MLP的使用