zoukankan      html  css  js  c++  java
  • 二进制部署K8S集群(十三)之验证集群

    1.创建一个资源配置清单nginx容器

    在hdss7-21或hdss7-22任意一个节点上创建一个资源配置清单:

    cat > /root/nginx-ds.yaml <<'eof'
    apiVersion: apps/v1
    kind: DaemonSet
    metadata:
      name: my-nginx
    spec:
      selector:
        matchLabels:
          app: my-nginx
      template:
        metadata:
          labels:
            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
    

    2.集群检查

    在hdss7-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
    scheduler            Healthy   ok                   
    controller-manager   Healthy   ok                   
    etcd-0               Healthy   {"health": "true"}   
    etcd-1               Healthy   {"health": "true"}   
    etcd-2               Healthy   {"health": "true"}   
    [root@hdss7-21 bin]# kubectl get node -o wide  # 查看各节点状态
    NAME                STATUS   ROLES         AGE   VERSION   INTERNAL-IP   EXTERNAL-IP   OS-IMAGE                KERNEL-VERSION           CONTAINER-RUNTIME
    hdss7-21.host.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.host.com   Ready    master,node   11h   v1.19.2   10.4.7.22     <none>        CentOS Linux 7 (Core)   3.10.0-1127.el7.x86_64   docker://19.3.13
    [root@hdss7-21 bin]# kubectl get pods -o wide
    NAME             READY   STATUS    RESTARTS   AGE   IP           NODE                NOMINATED NODE   READINESS GATES
    my-nginx-h88nr   1/1     Running   1          10h   172.7.22.2   hdss7-22.host.com   <none>           <none>
    my-nginx-vrlsk   1/1     Running   0          10h   172.7.21.2   hdss7-21.host.com   <none>           <none>
    [root@hdss7-21 ~]# curl 172.7.21.2
    <!DOCTYPE html>
    <html>
    <head>
    <title>Welcome to nginx!</title>
    <style>
        body {
             35em;
            margin: 0 auto;
            font-family: Tahoma, Verdana, Arial, sans-serif;
        }
    </style>
    </head>
    <body>
    Welcome to nginx!
    <p>If you see this page, the nginx web server is successfully installed and
    working. Further configuration is required.</p>
    
    <p>For online documentation and support please refer to
    <a rel="nofollow" href="http://nginx.org/">nginx.org</a>.<br/>
    Commercial support is available at
    <a rel="nofollow" href="http://nginx.com/">nginx.com</a>.</p>
    
    <p><em>Thank you for using nginx.</em></p>
    </body>
    </html>
    
  • 相关阅读:
    P3822 [NOI2017]整数
    P4630 [APIO2018] Duathlon 铁人两项
    P3230 [HNOI2013]比赛
    P2570 [ZJOI2010]贪吃的老鼠
    P4576 [CQOI2013]棋盘游戏
    P3256 [JLOI2013]赛车
    P3297 [SDOI2013]逃考
    CF487E Tourists
    设置一个双色球脚本(2)并带颜色输出
    设置一个双色球脚本
  • 原文地址:https://www.cnblogs.com/even160941/p/15044672.html
Copyright © 2011-2022 走看看