其他分享
首页 > 其他分享> > cka练习记录

cka练习记录

作者:互联网

[root@master log]# kubectl create ns cka-test
[root@master log]# kubectl run nginx --image=nginx -n cka-test
pod/nginx created
[root@master log]# kubectl get pods -n cka-test
NAME    READY   STATUS    RESTARTS   AGE
nginx   1/1     Running   0          114s
[root@master log]# kubectl create deployment my-dep-tomcat --image=tomcat
[root@master log]# kubectl expose deployment my-dep-tomcat --port=8080 --target-port=8080
[root@master log]# kubectl get svc|grep my-dep-tomcat
my-dep-tomcat   ClusterIP   10.103.60.64    <none>        8080/TCP       18s
[root@master log]# kubectl get pods -n cka-test -l run=nginx
NAME    READY   STATUS    RESTARTS   AGE
nginx   1/1     Running   0          33m

标签:kubectl,cka,记录,创建,练习,nginx,deployment,pod,root
来源: https://www.cnblogs.com/scau-zeng/p/15923746.html