我找不到在POD创建或PVC创建期间可以传递有关Azure存储帐户的秘密的示例。一个示例确实有帮助。我遵循了示例here,但没有用。
答案 0 :(得分:1)
答案 1 :(得分:1)
创建pvc:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: azure-managed-disk
spec:
accessModes:
- ReadWriteOnce
storageClassName: managed-premium
resources:
requests:
storage: 5Gi
如果您使用的是非常老的AKS \,而不是AKS,则还需要创建存储类:
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: managed-premium
parameters:
cachingmode: ReadOnly
kind: Managed
storageaccounttype: Premium_LRS
provisioner: kubernetes.io/azure-disk
reclaimPolicy: Delete
volumeBindingMode: Immediate
使用pvc:
kind: Pod
apiVersion: v1
metadata:
name: mypod
spec:
containers:
- name: mypod
image: nginx:1.15.5
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 250m
memory: 256Mi
volumeMounts:
- mountPath: "/mnt/azure"
name: volume
volumes: // this is where you reference the pvc
- name: volume
persistentVolumeClaim:
claimName: azure-managed-disk