直接命令运行
kubectl run testapp --image=ccr.ccs.tencentyun.com/k8s-tutorial/test-k8s:v1
Pod
apiVersion: v1kind: Podmetadata:name: test-podspec: # 定义容器,可以多个containers:- name: test-k8s # 容器名字image: ccr.ccs.tencentyun.com/k8s-tutorial/test-k8s:v1 # 镜像
Deployment
apiVersion: apps/v1kind: Deploymentmetadata:# 部署名字name: test-k8sspec:replicas: 2# 用来查找关联的 Pod,所有标签都匹配才行selector:matchLabels:app: test-k8s# 定义 Pod 相关数据template:metadata:labels:app: test-k8sspec:# 定义容器,可以多个containers:- name: test-k8s # 容器名字image: ccr.ccs.tencentyun.com/k8s-tutorial/test-k8s:v1 # 镜像

