github.com/skyscape-cloud-services/terraform@v0.9.2-0.20170609144644-7ece028a1747/builtin/providers/kubernetes/schema_volume_source.go (about) 1 package kubernetes 2 3 import ( 4 "github.com/hashicorp/terraform/helper/schema" 5 ) 6 7 func persistentVolumeSourceSchema() *schema.Resource { 8 return &schema.Resource{ 9 Schema: commonVolumeSources(), 10 } 11 } 12 13 // Common volume sources between Persistent Volumes and Pod Volumes 14 func commonVolumeSources() map[string]*schema.Schema { 15 return map[string]*schema.Schema{ 16 "host_path": { 17 Type: schema.TypeList, 18 Description: "Represents a directory on the host. Provisioned by a developer or tester. This is useful for single-node development and testing only! On-host storage is not supported in any way and WILL NOT WORK in a multi-node cluster. More info: http://kubernetes.io/docs/user-guide/volumes#hostpath", 19 Optional: true, 20 MaxItems: 1, 21 Elem: &schema.Resource{ 22 Schema: map[string]*schema.Schema{ 23 "path": { 24 Type: schema.TypeString, 25 Description: "Path of the directory on the host. More info: http://kubernetes.io/docs/user-guide/volumes#hostpath", 26 Optional: true, 27 }, 28 }, 29 }, 30 }, 31 "aws_elastic_block_store": { 32 Type: schema.TypeList, 33 Description: "Represents an AWS Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: http://kubernetes.io/docs/user-guide/volumes#awselasticblockstore", 34 Optional: true, 35 MaxItems: 1, 36 Elem: &schema.Resource{ 37 Schema: map[string]*schema.Schema{ 38 "fs_type": { 39 Type: schema.TypeString, 40 Description: "Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: http://kubernetes.io/docs/user-guide/volumes#awselasticblockstore", 41 Optional: true, 42 }, 43 "partition": { 44 Type: schema.TypeInt, 45 Description: "The partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as \"1\". Similarly, the volume partition for /dev/sda is \"0\" (or you can leave the property empty).", 46 Optional: true, 47 }, 48 "read_only": { 49 Type: schema.TypeBool, 50 Description: "Whether to set the read-only property in VolumeMounts to \"true\". If omitted, the default is \"false\". More info: http://kubernetes.io/docs/user-guide/volumes#awselasticblockstore", 51 Optional: true, 52 }, 53 "volume_id": { 54 Type: schema.TypeString, 55 Description: "Unique ID of the persistent disk resource in AWS (Amazon EBS volume). More info: http://kubernetes.io/docs/user-guide/volumes#awselasticblockstore", 56 Required: true, 57 }, 58 }, 59 }, 60 }, 61 "azure_disk": { 62 Type: schema.TypeList, 63 Description: "Represents an Azure Data Disk mount on the host and bind mount to the pod.", 64 Optional: true, 65 MaxItems: 1, 66 Elem: &schema.Resource{ 67 Schema: map[string]*schema.Schema{ 68 "caching_mode": { 69 Type: schema.TypeString, 70 Description: "Host Caching mode: None, Read Only, Read Write.", 71 Required: true, 72 }, 73 "data_disk_uri": { 74 Type: schema.TypeString, 75 Description: "The URI the data disk in the blob storage", 76 Required: true, 77 }, 78 "disk_name": { 79 Type: schema.TypeString, 80 Description: "The Name of the data disk in the blob storage", 81 Required: true, 82 }, 83 "fs_type": { 84 Type: schema.TypeString, 85 Description: "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.", 86 Optional: true, 87 }, 88 "read_only": { 89 Type: schema.TypeBool, 90 Description: "Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write).", 91 Optional: true, 92 Default: false, 93 }, 94 }, 95 }, 96 }, 97 "azure_file": { 98 Type: schema.TypeList, 99 Description: "Represents an Azure File Service mount on the host and bind mount to the pod.", 100 Optional: true, 101 MaxItems: 1, 102 Elem: &schema.Resource{ 103 Schema: map[string]*schema.Schema{ 104 "read_only": { 105 Type: schema.TypeBool, 106 Description: "Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write).", 107 Optional: true, 108 }, 109 "secret_name": { 110 Type: schema.TypeString, 111 Description: "The name of secret that contains Azure Storage Account Name and Key", 112 Required: true, 113 }, 114 "share_name": { 115 Type: schema.TypeString, 116 Description: "Share Name", 117 Required: true, 118 }, 119 }, 120 }, 121 }, 122 "ceph_fs": { 123 Type: schema.TypeList, 124 Description: "Represents a Ceph FS mount on the host that shares a pod's lifetime", 125 Optional: true, 126 MaxItems: 1, 127 Elem: &schema.Resource{ 128 Schema: map[string]*schema.Schema{ 129 "monitors": { 130 Type: schema.TypeSet, 131 Description: "Monitors is a collection of Ceph monitors More info: http://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it", 132 Required: true, 133 Elem: &schema.Schema{Type: schema.TypeString}, 134 Set: schema.HashString, 135 }, 136 "path": { 137 Type: schema.TypeString, 138 Description: "Used as the mounted root, rather than the full Ceph tree, default is /", 139 Optional: true, 140 }, 141 "read_only": { 142 Type: schema.TypeBool, 143 Description: "Whether to force the read-only setting in VolumeMounts. Defaults to `false` (read/write). More info: http://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it", 144 Optional: true, 145 }, 146 "secret_file": { 147 Type: schema.TypeString, 148 Description: "The path to key ring for User, default is /etc/ceph/user.secret More info: http://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it", 149 Optional: true, 150 }, 151 "secret_ref": { 152 Type: schema.TypeList, 153 Description: "Reference to the authentication secret for User, default is empty. More info: http://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it", 154 Optional: true, 155 MaxItems: 1, 156 Elem: &schema.Resource{ 157 Schema: map[string]*schema.Schema{ 158 "name": { 159 Type: schema.TypeString, 160 Description: "Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names", 161 Optional: true, 162 }, 163 }, 164 }, 165 }, 166 "user": { 167 Type: schema.TypeString, 168 Description: "User is the rados user name, default is admin. More info: http://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it", 169 Optional: true, 170 }, 171 }, 172 }, 173 }, 174 "cinder": { 175 Type: schema.TypeList, 176 Description: "Represents a cinder volume attached and mounted on kubelets host machine. More info: http://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md", 177 Optional: true, 178 MaxItems: 1, 179 Elem: &schema.Resource{ 180 Schema: map[string]*schema.Schema{ 181 "fs_type": { 182 Type: schema.TypeString, 183 Description: "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: http://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md", 184 Optional: true, 185 }, 186 "read_only": { 187 Type: schema.TypeBool, 188 Description: "Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). More info: http://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md", 189 Optional: true, 190 }, 191 "volume_id": { 192 Type: schema.TypeString, 193 Description: "Volume ID used to identify the volume in Cinder. More info: http://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md", 194 Required: true, 195 }, 196 }, 197 }, 198 }, 199 "fc": { 200 Type: schema.TypeList, 201 Description: "Represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod.", 202 Optional: true, 203 MaxItems: 1, 204 Elem: &schema.Resource{ 205 Schema: map[string]*schema.Schema{ 206 "fs_type": { 207 Type: schema.TypeString, 208 Description: "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.", 209 Optional: true, 210 }, 211 "lun": { 212 Type: schema.TypeInt, 213 Description: "FC target lun number", 214 Required: true, 215 }, 216 "read_only": { 217 Type: schema.TypeBool, 218 Description: "Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write).", 219 Optional: true, 220 }, 221 "target_ww_ns": { 222 Type: schema.TypeSet, 223 Description: "FC target worldwide names (WWNs)", 224 Required: true, 225 Elem: &schema.Schema{Type: schema.TypeString}, 226 Set: schema.HashString, 227 }, 228 }, 229 }, 230 }, 231 "flex_volume": { 232 Type: schema.TypeList, 233 Description: "Represents a generic volume resource that is provisioned/attached using an exec based plugin. This is an alpha feature and may change in future.", 234 Optional: true, 235 MaxItems: 1, 236 Elem: &schema.Resource{ 237 Schema: map[string]*schema.Schema{ 238 "driver": { 239 Type: schema.TypeString, 240 Description: "Driver is the name of the driver to use for this volume.", 241 Required: true, 242 }, 243 "fs_type": { 244 Type: schema.TypeString, 245 Description: "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". The default filesystem depends on FlexVolume script.", 246 Optional: true, 247 }, 248 "options": { 249 Type: schema.TypeMap, 250 Description: "Extra command options if any.", 251 Optional: true, 252 }, 253 "read_only": { 254 Type: schema.TypeBool, 255 Description: "Whether to force the ReadOnly setting in VolumeMounts. Defaults to false (read/write).", 256 Optional: true, 257 }, 258 "secret_ref": { 259 Type: schema.TypeList, 260 Description: "Reference to the secret object containing sensitive information to pass to the plugin scripts. This may be empty if no secret object is specified. If the secret object contains more than one secret, all secrets are passed to the plugin scripts.", 261 Optional: true, 262 MaxItems: 1, 263 Elem: &schema.Resource{ 264 Schema: map[string]*schema.Schema{ 265 "name": { 266 Type: schema.TypeString, 267 Description: "Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names", 268 Optional: true, 269 }, 270 }, 271 }, 272 }, 273 }, 274 }, 275 }, 276 "flocker": { 277 Type: schema.TypeList, 278 Description: "Represents a Flocker volume attached to a kubelet's host machine and exposed to the pod for its usage. This depends on the Flocker control service being running", 279 Optional: true, 280 MaxItems: 1, 281 Elem: &schema.Resource{ 282 Schema: map[string]*schema.Schema{ 283 "dataset_name": { 284 Type: schema.TypeString, 285 Description: "Name of the dataset stored as metadata -> name on the dataset for Flocker should be considered as deprecated", 286 Optional: true, 287 }, 288 "dataset_uuid": { 289 Type: schema.TypeString, 290 Description: "UUID of the dataset. This is unique identifier of a Flocker dataset", 291 Optional: true, 292 }, 293 }, 294 }, 295 }, 296 "gce_persistent_disk": { 297 Type: schema.TypeList, 298 Description: "Represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. More info: http://kubernetes.io/docs/user-guide/volumes#gcepersistentdisk", 299 Optional: true, 300 MaxItems: 1, 301 Elem: &schema.Resource{ 302 Schema: map[string]*schema.Schema{ 303 "fs_type": { 304 Type: schema.TypeString, 305 Description: "Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: http://kubernetes.io/docs/user-guide/volumes#gcepersistentdisk", 306 Optional: true, 307 }, 308 "partition": { 309 Type: schema.TypeInt, 310 Description: "The partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as \"1\". Similarly, the volume partition for /dev/sda is \"0\" (or you can leave the property empty). More info: http://kubernetes.io/docs/user-guide/volumes#gcepersistentdisk", 311 Optional: true, 312 }, 313 "pd_name": { 314 Type: schema.TypeString, 315 Description: "Unique name of the PD resource in GCE. Used to identify the disk in GCE. More info: http://kubernetes.io/docs/user-guide/volumes#gcepersistentdisk", 316 Required: true, 317 }, 318 "read_only": { 319 Type: schema.TypeBool, 320 Description: "Whether to force the ReadOnly setting in VolumeMounts. Defaults to false. More info: http://kubernetes.io/docs/user-guide/volumes#gcepersistentdisk", 321 Optional: true, 322 }, 323 }, 324 }, 325 }, 326 "glusterfs": { 327 Type: schema.TypeList, 328 Description: "Represents a Glusterfs volume that is attached to a host and exposed to the pod. Provisioned by an admin. More info: http://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md", 329 Optional: true, 330 MaxItems: 1, 331 Elem: &schema.Resource{ 332 Schema: map[string]*schema.Schema{ 333 "endpoints_name": { 334 Type: schema.TypeString, 335 Description: "The endpoint name that details Glusterfs topology. More info: http://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md#create-a-pod", 336 Required: true, 337 }, 338 "path": { 339 Type: schema.TypeString, 340 Description: "The Glusterfs volume path. More info: http://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md#create-a-pod", 341 Required: true, 342 }, 343 "read_only": { 344 Type: schema.TypeBool, 345 Description: "Whether to force the Glusterfs volume to be mounted with read-only permissions. Defaults to false. More info: http://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md#create-a-pod", 346 Optional: true, 347 }, 348 }, 349 }, 350 }, 351 "iscsi": { 352 Type: schema.TypeList, 353 Description: "Represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin.", 354 Optional: true, 355 MaxItems: 1, 356 Elem: &schema.Resource{ 357 Schema: map[string]*schema.Schema{ 358 "fs_type": { 359 Type: schema.TypeString, 360 Description: "Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: http://kubernetes.io/docs/user-guide/volumes#iscsi", 361 Optional: true, 362 }, 363 "iqn": { 364 Type: schema.TypeString, 365 Description: "Target iSCSI Qualified Name.", 366 Required: true, 367 }, 368 "iscsi_interface": { 369 Type: schema.TypeString, 370 Description: "iSCSI interface name that uses an iSCSI transport. Defaults to 'default' (tcp).", 371 Optional: true, 372 Default: "default", 373 }, 374 "lun": { 375 Type: schema.TypeInt, 376 Description: "iSCSI target lun number.", 377 Optional: true, 378 }, 379 "read_only": { 380 Type: schema.TypeBool, 381 Description: "Whether to force the read-only setting in VolumeMounts. Defaults to false.", 382 Optional: true, 383 }, 384 "target_portal": { 385 Type: schema.TypeString, 386 Description: "iSCSI target portal. The portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260).", 387 Required: true, 388 }, 389 }, 390 }, 391 }, 392 "nfs": { 393 Type: schema.TypeList, 394 Description: "Represents an NFS mount on the host. Provisioned by an admin. More info: http://kubernetes.io/docs/user-guide/volumes#nfs", 395 Optional: true, 396 MaxItems: 1, 397 Elem: &schema.Resource{ 398 Schema: map[string]*schema.Schema{ 399 "path": { 400 Type: schema.TypeString, 401 Description: "Path that is exported by the NFS server. More info: http://kubernetes.io/docs/user-guide/volumes#nfs", 402 Required: true, 403 }, 404 "read_only": { 405 Type: schema.TypeBool, 406 Description: "Whether to force the NFS export to be mounted with read-only permissions. Defaults to false. More info: http://kubernetes.io/docs/user-guide/volumes#nfs", 407 Optional: true, 408 }, 409 "server": { 410 Type: schema.TypeString, 411 Description: "Server is the hostname or IP address of the NFS server. More info: http://kubernetes.io/docs/user-guide/volumes#nfs", 412 Required: true, 413 }, 414 }, 415 }, 416 }, 417 "photon_persistent_disk": { 418 Type: schema.TypeList, 419 Description: "Represents a PhotonController persistent disk attached and mounted on kubelets host machine", 420 Optional: true, 421 MaxItems: 1, 422 Elem: &schema.Resource{ 423 Schema: map[string]*schema.Schema{ 424 "fs_type": { 425 Type: schema.TypeString, 426 Description: "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.", 427 Optional: true, 428 }, 429 "pd_id": { 430 Type: schema.TypeString, 431 Description: "ID that identifies Photon Controller persistent disk", 432 Required: true, 433 }, 434 }, 435 }, 436 }, 437 "quobyte": { 438 Type: schema.TypeList, 439 Description: "Quobyte represents a Quobyte mount on the host that shares a pod's lifetime", 440 Optional: true, 441 MaxItems: 1, 442 Elem: &schema.Resource{ 443 Schema: map[string]*schema.Schema{ 444 "group": { 445 Type: schema.TypeString, 446 Description: "Group to map volume access to Default is no group", 447 Optional: true, 448 }, 449 "read_only": { 450 Type: schema.TypeBool, 451 Description: "Whether to force the Quobyte volume to be mounted with read-only permissions. Defaults to false.", 452 Optional: true, 453 }, 454 "registry": { 455 Type: schema.TypeString, 456 Description: "Registry represents a single or multiple Quobyte Registry services specified as a string as host:port pair (multiple entries are separated with commas) which acts as the central registry for volumes", 457 Required: true, 458 }, 459 "user": { 460 Type: schema.TypeString, 461 Description: "User to map volume access to Defaults to serivceaccount user", 462 Optional: true, 463 }, 464 "volume": { 465 Type: schema.TypeString, 466 Description: "Volume is a string that references an already created Quobyte volume by name.", 467 Required: true, 468 }, 469 }, 470 }, 471 }, 472 "rbd": { 473 Type: schema.TypeList, 474 Description: "Represents a Rados Block Device mount on the host that shares a pod's lifetime. More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md", 475 Optional: true, 476 MaxItems: 1, 477 Elem: &schema.Resource{ 478 Schema: map[string]*schema.Schema{ 479 "ceph_monitors": { 480 Type: schema.TypeSet, 481 Description: "A collection of Ceph monitors. More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it", 482 Required: true, 483 Elem: &schema.Schema{Type: schema.TypeString}, 484 Set: schema.HashString, 485 }, 486 "fs_type": { 487 Type: schema.TypeString, 488 Description: "Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: http://kubernetes.io/docs/user-guide/volumes#rbd", 489 Optional: true, 490 }, 491 "keyring": { 492 Type: schema.TypeString, 493 Description: "Keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it", 494 Optional: true, 495 Computed: true, 496 }, 497 "rados_user": { 498 Type: schema.TypeString, 499 Description: "The rados user name. Default is admin. More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it", 500 Optional: true, 501 Default: "admin", 502 }, 503 "rbd_image": { 504 Type: schema.TypeString, 505 Description: "The rados image name. More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it", 506 Required: true, 507 }, 508 "rbd_pool": { 509 Type: schema.TypeString, 510 Description: "The rados pool name. Default is rbd. More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it.", 511 Optional: true, 512 Default: "rbd", 513 }, 514 "read_only": { 515 Type: schema.TypeBool, 516 Description: "Whether to force the read-only setting in VolumeMounts. Defaults to false. More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it", 517 Optional: true, 518 Default: false, 519 }, 520 "secret_ref": { 521 Type: schema.TypeList, 522 Description: "Name of the authentication secret for RBDUser. If provided overrides keyring. Default is nil. More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it", 523 Optional: true, 524 MaxItems: 1, 525 Elem: &schema.Resource{ 526 Schema: map[string]*schema.Schema{ 527 "name": { 528 Type: schema.TypeString, 529 Description: "Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names", 530 Optional: true, 531 }, 532 }, 533 }, 534 }, 535 }, 536 }, 537 }, 538 "vsphere_volume": { 539 Type: schema.TypeList, 540 Description: "Represents a vSphere volume attached and mounted on kubelets host machine", 541 Optional: true, 542 MaxItems: 1, 543 Elem: &schema.Resource{ 544 Schema: map[string]*schema.Schema{ 545 "fs_type": { 546 Type: schema.TypeString, 547 Description: "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.", 548 Optional: true, 549 }, 550 "volume_path": { 551 Type: schema.TypeString, 552 Description: "Path that identifies vSphere volume vmdk", 553 Required: true, 554 }, 555 }, 556 }, 557 }, 558 } 559 }