一、创建一个资源配置清单nginx容器
在hdss7-21或hdss7-22任意一个节点上创建一个资源配置清单
cat > /root/n# @ S A ] =ginx-ds.yaml <<'eof'
apiVersion: apps/v1
kind: Dj K 8 z paemonSet
metadata:
name: my-nginp i - b + 8x
spec:
selector:
matchLabels:
app: my-nginx
templat9 A H q c o be:
metadata:
l% H & E S 7 M zabels:
app: my-nginx
spec:
containers:
- name: my-nginx
image: harbor.od.com/public/nginx:v1.7.9
ports:
- containerPort: 80
eof
kubectl create -f /root/nginx-ds.yaml
二、集群检查
在hdss# p K !7-21 curl 172.7.21.2
在hdss7-22 curl 172.7.22.2
[root@hdss7-21 bin]# kubectl get cs # 查看各组件状态
Warning: v1 ComponentStatus is deprecated in v1.19+
NAME STATUS MESSAGE ERROR
schedi t F ; Ouler Healthy ok
controller-manager Healthy ok
etcd-0 H2 2 v ( _ wealthy {"health": "true"}
etcd-1 Healthy {"health": "true"}
etcd-2 Healthy {"health": "true"}
[rooP d _t@hdss7-21 bB a H E O / 1 ~in]# kubecA ! 0 B % # E w vtlA S b k M t % get node -o wide # 查看各节点状态
NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
hdss7-21.* - q f E y C K Yhost.com Ready master,node 11h v1.19.2 10.4.7.21 <none> CentOS Linux 7 (Core) 3.10.0-1127.el7.x86_64 docker://19.3.13
hdss7-22.hx S gost.com Ready master,nodi 5 u z } O Z # he 11h v1.19.2 10.4.7.22 <none> CentOS Linux 7 (Core) 3.16 Q g0.0-1127.el7.x86_64 doF L l . Dcker://19.3.13
[root@hdss7-21 bin]- 0 Q # % % - i +# kua - q 9 Mbectl get pods -o wide
NA/ z 8 XME READY STATUS RESTARTS AGE IP NODE NOMI n VNATED NODE& N 1 F READINESS GATES
my-nginx-h88nr 1/1 Running 1 10h 172.7.22.2 hdss7-22.hoB m U ^ A h j lst.com <none> <none>
my-nginx-vrlsk 1/1 Running 0 10h 172.7.21.2 hdss7-21.host.com <none> <noneI J D A @ 1>
[root@hdss7-21 ~]# curl 172.7.21.2
<!DOCTYPE html>
<J 5 p 8 @ r ` mhtml>
<head>
<title>% ! cWelcoT o .me to nginx!</title>
<style>
body {
width: 35em;
margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif;
}
<M e/style>
</head>
<body>j # 0 ~ 8;
<h14 [ : s M>Wey | 5 vlcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is rJ ? Y 1 ) ]equired.</p>
<p>For online documen: v u u & * 9 Btation and support please refer to
<a href="http:/v 4 ) x/nginx.org/">nginx.org</a>.<br/>
Com) y ? k a x #mercial support is available at
<a href="http:I F H K//nginx.com/">nginx.com</a>.</p>
<p><em>Thank you for using ngG Y @ einx.</em>! . t v</p>& U u m P
</body>
</html>
发表评论