gitRepo
Last updated
Last updated
apiVersion: v1
kind: Pod
metadata:
name: gitrepo-volume-pod
spec:
containers:
- image: nginx:alpine
name: web-server
volumeMounts: # 定义挂载点
- name: html # (必须) 挂载的卷名
mountPath: /usr/share/nginx/html # (必须)容器中的挂载点
readOnly: true # 对该卷只允许读
ports:
- containerPort: 80
protocol: TCP
volumes: # 定义卷
- name: html # (必须)卷名
gitRepo: # 创建的是gitRepo卷
repository: https://github.com/yangsijie666/kubia-website-example.git # (必须)仓库地址
revision: master # 分支名
directory: . # 克隆到卷的根目录