1.操作namespace
kubectl create ns hello kubectl delete ns hello
#yaml apiVersion: v1 kind: Namespace metadata: name: hello
2.pod:运行的一组容器,pod是kubernetes中应用最小的单位
3.k8s运行pod
kubectl run mynginx --image=nginx yaml:::::: apiVersion: v1 kind: Pod metadata: labels: run: mynginx name: mynginx spec: containers: - image: nginx name: mynginx
4.查看pod运行日志
kubectl logs pod
5.查看k8s分配的pod的ip是多少
kubectl get pod -owide
6.进入容器里面修改
kubectl exec -it mynginx -- /bin/bash
标签:实战,kubectl,name,核心,image,mynginx,pod,hello From: https://www.cnblogs.com/haoyun123/p/17133310.html