k8s

发布时间 2023-10-03 15:23:00作者: 好人~

安装

裸机安装失败,有点麻烦以后再尝试。

运行一个名为testapp的pod:

kubectl run testapp --image=ccr.ccs.tencentyun.com/k8s-tutorial/test-k8s:v1
kubectl get pod

使用配置文件运行pod,配置文件使用yaml编写:

#  pod.yaml 
apiVersion: v1
kind: Pod 
metadata:
  name: test-pod
spec:
  # 定义容器,可以多个
  containers:
    - name: test-k8s # 容器名字
      image: ccr.ccs.tencentyun.com/k8s-tutorial/test-k8s:v1 # 镜像

kubectl apply -f pod.yaml