java系统找不到指定文件怎么解决
231
2022-10-21
K8S基础:Pod管理
1、命名空间管理
#创建 [root@master ~]# kubectl create ns leoheng namespace/leoheng created #删除 [root@master ~]# kubectl delete ns leoheng namespace "leoheng" deleted
2、管理指定命名空间资源
#创建 [root@master server]# vim leoheng.yaml apiVersion: v1 kind: Namespace metadata: name: leoheng [root@master server]# kubectl apply -f leoheng.yaml namespace/leoheng created [root@master server]# kubectl get ns NAME STATUS AGE default Active 10h kube-node-lease Active 10h kube-public Active 10h kube-system Active 10h kubekey-system Active 10h kubernetes-dashboard Active 31m kubesphere-controls-system Active 10h kubesphere-monitoring-federated Active 10h kubesphere-monitoring-system Active 10h kubesphere-system Active 10h leoheng Active 106s [root@master server]# #删除 [root@master server]# kubectl delete -f leoheng.yaml namespace "leoheng" deleted [root@master server]#
3、kubectl管理命令行创建的Pod
#kubectl创建pod
[root@master server]# kubectl run mynginx --image=nginx
pod/mynginx created
[root@master server]# kubectl get pod mynginx
NAME READY STATUS RESTARTS AGE
mynginx 1/1 Running 0 82s
#查看POD创建信息
[root@master server]# kubectl describe pod mynginx
Name: mynginx
Namespace: default
Priority: 0
Node: node01/172.18.0.3
Start Time: Wed, 13 Apr 2022 10:38:48 +0800
Labels: run=mynginx
Annotations: cni.projectcalico.org/containerID: 7bfaaddc892626b58ccb6a8c9b376d25fc52387476f4475a17ed87d04cbd6258
cni.projectcalico.org/podIP: 10.233.82.18/32
cni.projectcalico.org/podIPs: 10.233.82.18/32
Status: Running
IP: 10.233.82.18
IPs:
IP: 10.233.82.18
Containers:
mynginx:
Container ID: docker://c3742edb8fd542d7131e73a626df41f1c43efda510c4de985ff6c3f0fc5ef86f
Image: nginx
Image ID: docker-pullable://nginx@sha256:2275af0f20d71b293916f1958f8497f987b8d8fd8113df54635f2a5915002bf1
Port:
4、管理yaml文件创建的pod
#编辑yaml文件,创建pod
[root@master server]# vim pod.yaml
apiVersion: v1
kind: Pod
metadata:
labels:
run: myinginx
name: myinginx
spec:
containers:
- image: nginx
name: nginx01
[root@master server]# kubectl apply -f pod.yaml
pod/myinginx created
[root@master server]# kubectl get pod myinginx
NAME READY STATUS RESTARTS AGE
myinginx 1/1 Running 0 17m
#查看pod创建过程
[root@master server]# kubectl describe pod myinginx
Name: myinginx
Namespace: default
Priority: 0
Node: node01/172.18.0.3
Start Time: Wed, 13 Apr 2022 10:55:46 +0800
Labels: run=myinginx
Annotations: cni.projectcalico.org/containerID: b988c64354fb9749c7a1bb5c209cd18d8c32d0994bea3c263707e82dcf9b5205
cni.projectcalico.org/podIP: 10.233.82.19/32
cni.projectcalico.org/podIPs: 10.233.82.19/32
Status: Running
IP: 10.233.82.19
IPs:
IP: 10.233.82.19
Containers:
nginx01:
Container ID: docker://af7d0f9fa682b1913f047186ac694b72b5313b973c3564fa634cb4765f0da913
Image: nginx
Image ID: docker-pullable://nginx@sha256:2275af0f20d71b293916f1958f8497f987b8d8fd8113df54635f2a5915002bf1
Port:
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~