yaml語法

苦逼yw發表於2024-03-12

1、yaml複雜結構如下。線上轉換網站 https://tool.ip138.com/yamljson/

env:
    - name: PROVISIONER_NAME
      value: k8s-sigs.io/nfs-subdir-external-provisioner
    - name: NFS_SERVER
      value: 192.168.10.94
    - name: NFS_PATH
      value: /data/nfs/auto

轉換json後

{
  "env": [
    {
      "name": "PROVISIONER_NAME",
      "value": "k8s-sigs.io/nfs-subdir-external-provisioner"
    },
    {
      "name": "NFS_SERVER",
      "value": "192.168.10.94"
    },
    {
      "name": "NFS_PATH",
      "value": "/data/nfs/auto"
    }
  ]
}