apiVersion: v1
kind: Namespace
metadata:
name: shujubu
labels:
name: shujubu
执行文件创建 shujubu命名空间:
kubectl create -f create_shjujubu_namespace.yaml
1
需要的镜像列表:
nginx 1.17 62c261073ecf 3 months ago 109MB
1
定义pod文件 nginx-pod.yaml
apiVersion: v1
kind: Pod
metadata:
name: sjb-nginx
namespace: shujubu
labels:
name: sjb-nginx
spec:
containers:
- name: nginx
image: ccr.ccs.tencentyun.com/shujubu/nginx:1.17
imagePullPolicy: IfNotPresent
ports:
- containerPort: 80
volumeMounts:
- mountPath: /etc/nginx/nginx.conf
name: config
- mountPath: /etc/nginx/conf.d/default.conf
name: defa