我目前尝试从“Container-Optimized Google Compute Engine Images”(https://cloud.google.com/compute/docs/containers/container_vms)切换到“Container-VM”Image(https://cloud. google.com/compute/docs/containers/vm-image/#overview)。在我的 containers.yaml 中,我定义了一个卷和一个使用该卷的容器。
apiVersion: v1
kind: Pod
metadata:
name: workhorse
spec:
containers:
- name: postgres
image: postgres:9.5
imagePullPolicy: Always
volumeMounts:
- name: postgres-storage
mountPath: /var/lib/postgresql/data
volumes:
- name: postgres-storage
gcePersistentDisk:
pdName: disk-name
fsType: ext4
此设置适用于“Container-Optimized Google Compute Engine Images”,但“Container-VM”失败。在日志中,我可以看到以下错误:
May 24 18:33:43 battleship kubelet[629]: E0524 18:33:43.405470 629 gce_util.go:176]
Error getting GCECloudProvider while detaching PD "disk-name":
Failed to get GCE Cloud Provider. plugin.host.GetCloudProvider returned <nil> instead
提前感谢您的任何提示!