Ram*_*Ram 5 google-cloud-storage kubernetes google-kubernetes-engine docker-volume
我收到错误消息:
错误验证“ mysql.yaml”:错误验证数据:ValidationError(Deployment.spec.template.spec.volumes [0]):io.k8s.kubernetes.pkg.api.v1.Volume中的未知字段“ path”;)
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: mysql
labels:
app: mysql
spec:
replicas: 1
selector:
matchLabels:
app: mysql
template:
metadata:
labels:
app: mysql
spec:
containers:
- image: mysql:5.6
name: mysql
env:
- name: MYSQL_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: mysql
key: password
ports:
- containerPort: 3306
name: mysql
volumeMounts:
- name: mapping-sandbox-test
mountPath: /var/lib/mysql
volumes:
- name: mapping-sandbox-test
path: gs://<bucket-name>
Run Code Online (Sandbox Code Playgroud)
使用名称和路径作为键,您的Deployment对象看起来正确。您可以在此处看到有关如何在kubernetes上安装GCS存储桶的示例
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: gcsfuse-test
spec:
replicas: 1
template:
metadata:
labels:
app: gcsfuse-test
spec:
containers:
- name: gcsfuse-test
image: gcr.io/some-repo/gcs-fuse:latest
securityContext:
privileged: true
capabilities:
add:
- SYS_ADMIN
lifecycle:
postStart:
exec:
command: ["gcsfuse", "-o", "nonempty", "some-bucket", "/mnt/some-bucket"]
preStop:
exec:
command: ["fusermount", "-u", "/mnt/some-bucket"]
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5386 次 |
| 最近记录: |