k8s 命令创建pod

[root@master kubernetes]# kubectl create deploy ngx-dep --image=nginx:1.14-alpine
deployment.apps/ngx-dep created

创建成功 

使用kubectl命令查看当前pod 

[root@master kubernetes]# kubectl get pods
NAME                       READY   STATUS    RESTARTS   AGE
nginx-6b78bbf6d6-pwfhp     1/1     Running   0          11h
ngx-dep-5c8d96d457-r9qjn   1/1     Running   0          50s
[root@master kubernetes]# kubectl get pods -o wide
NAME                       READY   STATUS    RESTARTS   AGE   IP               NODE     NOMINATED NODE   READINESS GATES
nginx-6b78bbf6d6-pwfhp     1/1     Running   0          11h   10.100.219.71    master   <none>           <none>
ngx-dep-5c8d96d457-r9qjn   1/1     Running   0          58s   10.100.166.129   node1    <none>           <none>
[root@master kubernetes]# curl 10.100.166.129
<!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>
<h1>Welcome to nginx!</h1>
<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 href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>

<p><em>Thank you for using nginx.</em></p>
</body>
</html>
[root@master kubernetes]#

发现 ngx-dep已经创建成功 并且可以访问 到kuboard界面也能看到

原文地址:https://www.cnblogs.com/brady-wang/p/13796232.html