github.com/skyscape-cloud-services/terraform@v0.9.2-0.20170609144644-7ece028a1747/website/source/docs/providers/kubernetes/r/pod.html.markdown (about) 1 --- 2 layout: "kubernetes" 3 page_title: "Kubernetes: kubernetes_pod" 4 sidebar_current: "docs-kubernetes-resource-pod" 5 description: |- 6 A pod is a group of one or more containers, the shared storage for those containers, and options about how to run the containers. Pods are always co-located and co-scheduled, and run in a shared context. 7 --- 8 9 # kubernetes_pod 10 11 A pod is a group of one or more containers, the shared storage for those containers, and options about how to run the containers. Pods are always co-located and co-scheduled, and run in a shared context. 12 13 Read more at https://kubernetes.io/docs/concepts/workloads/pods/pod/ 14 15 ## Example Usage 16 17 ```hcl 18 resource "kubernetes_pod" "test" { 19 metadata { 20 name = "terraform-example" 21 } 22 23 spec { 24 container { 25 image = "nginx:1.7.9" 26 name = "example" 27 } 28 } 29 } 30 ``` 31 32 ## Argument Reference 33 34 The following arguments are supported: 35 36 * `metadata` - (Required) Standard pod's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#metadata 37 * `spec` - (Required) Spec of the pod owned by the cluster 38 39 ## Nested Blocks 40 41 ### `metadata` 42 43 #### Arguments 44 45 * `annotations` - (Optional) An unstructured key value map stored with the pod that may be used to store arbitrary metadata. More info: http://kubernetes.io/docs/user-guide/annotations 46 * `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#idempotency 47 * `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the pod. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels 48 * `name` - (Optional) Name of the pod, must be unique. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names 49 * `namespace` - (Optional) Namespace defines the space within which name of the pod must be unique. 50 51 #### Attributes 52 53 * `generation` - A sequence number representing a specific generation of the desired state. 54 * `resource_version` - An opaque value that represents the internal version of this pod that can be used by clients to determine when pod has changed. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#concurrency-control-and-consistency 55 * `self_link` - A URL representing this pod. 56 * `uid` - The unique in time and space value for this pod. More info: http://kubernetes.io/docs/user-guide/identifiers#uids 57 58 ### `spec` 59 60 #### Arguments 61 62 * `active_deadline_seconds` - (Optional) Optional duration in seconds the pod may be active on the node relative to StartTime before the system will actively try to mark it failed and kill associated containers. Value must be a positive integer. 63 * `container` - (Optional) List of containers belonging to the pod. Containers cannot currently be added or removed. There must be at least one container in a Pod. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/containers 64 * `dns_policy` - (Optional) Set DNS policy for containers within the pod. One of 'ClusterFirst' or 'Default'. Defaults to 'ClusterFirst'. 65 * `host_ipc` - (Optional) Use the host's ipc namespace. Optional: Default to false. 66 * `host_network` - (Optional) Host networking requested for this pod. Use the host's network namespace. If this option is set, the ports that will be used must be specified. 67 * `host_pid` - (Optional) Use the host's pid namespace. 68 * `hostname` - (Optional) Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value. 69 * `image_pull_secrets` - (Optional) ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. If specified, these secrets will be passed to individual puller implementations for them to use. For example, in the case of docker, only DockerConfig type secrets are honored. More info: http://kubernetes.io/docs/user-guide/images#specifying-imagepullsecrets-on-a-pod 70 * `node_name` - (Optional) NodeName is a request to schedule this pod onto a specific node. If it is non-empty, the scheduler simply schedules this pod onto that node, assuming that it fits resource requirements. 71 * `node_selector` - (Optional) NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node's labels for the pod to be scheduled on that node. More info: http://kubernetes.io/docs/user-guide/node-selection. 72 * `restart_policy` - (Optional) Restart policy for all containers within the pod. One of Always, OnFailure, Never. More info: http://kubernetes.io/docs/user-guide/pod-states#restartpolicy. 73 * `security_context` - (Optional) SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty 74 * `service_account_name` - (Optional) ServiceAccountName is the name of the ServiceAccount to use to run this pod. More info: http://releases.k8s.io/HEAD/docs/design/service_accounts.md. 75 * `subdomain` - (Optional) If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will not have a domainname at all.. 76 * `termination_grace_period_seconds` - (Optional) Optional duration in seconds the pod needs to terminate gracefully. May be decreased in delete request. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period will be used instead. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. 77 * `volume` - (Optional) List of volumes that can be mounted by containers belonging to the pod. More info: http://kubernetes.io/docs/user-guide/volumes 78 79 ### `container` 80 81 #### Arguments 82 83 * `args` - (Optional) Arguments to the entrypoint. The docker image's CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/containers#containers-and-commands 84 * `command` - (Optional) Entrypoint array. Not executed within a shell. The docker image's ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/containers#containers-and-commands 85 * `env` - (Optional) List of environment variables to set in the container. Cannot be updated. 86 * `image` - (Optional) Docker image name. More info: http://kubernetes.io/docs/user-guide/images 87 * `image_pull_policy` - (Optional) Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/images#updating-images 88 * `lifecycle` - (Optional) Actions that the management system should take in response to container lifecycle events 89 * `liveness_probe` - (Optional) Periodic probe of container liveness. Container will be restarted if the probe fails. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/pod-states#container-probes 90 * `name` - (Required) Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. 91 * `port` - (Optional) List of ports to expose from the container. Exposing a port here gives the system additional information about the network connections a container uses, but is primarily informational. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is listening on the default "0.0.0.0" address inside a container will be accessible from the network. Cannot be updated. 92 * `readiness_probe` - (Optional) Periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/pod-states#container-probes 93 * `resources` - (Optional) Compute Resources required by this container. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/persistent-volumes#resources 94 * `security_context` - (Optional) Security options the pod should run with. More info: http://releases.k8s.io/HEAD/docs/design/security_context.md 95 * `stdin` - (Optional) Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. 96 * `stdin_once` - (Optional) Whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container processes that reads from stdin will never receive an EOF. 97 * `termination_message_path` - (Optional) Optional: Path at which the file to which the container's termination message will be written is mounted into the container's filesystem. Message written is intended to be brief final status, such as an assertion failure message. Defaults to /dev/termination-log. Cannot be updated. 98 * `tty` - (Optional) Whether this container should allocate a TTY for itself 99 * `volume_mount` - (Optional) Pod volumes to mount into the container's filesystem. Cannot be updated. 100 * `working_dir` - (Optional) Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated. 101 102 ### `aws_elastic_block_store` 103 104 #### Arguments 105 106 * `fs_type` - (Optional) 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 107 * `partition` - (Optional) 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). 108 * `read_only` - (Optional) 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 109 * `volume_id` - (Required) Unique ID of the persistent disk resource in AWS (Amazon EBS volume). More info: http://kubernetes.io/docs/user-guide/volumes#awselasticblockstore 110 111 ### `azure_disk` 112 113 #### Arguments 114 115 * `caching_mode` - (Required) Host Caching mode: None, Read Only, Read Write. 116 * `data_disk_uri` - (Required) The URI the data disk in the blob storage 117 * `disk_name` - (Required) The Name of the data disk in the blob storage 118 * `fs_type` - (Optional) 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. 119 * `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). 120 121 ### `azure_file` 122 123 #### Arguments 124 125 * `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). 126 * `secret_name` - (Required) The name of secret that contains Azure Storage Account Name and Key 127 * `share_name` - (Required) Share Name 128 129 ### `capabilities` 130 131 #### Arguments 132 133 * `add` - (Optional) Added capabilities 134 * `drop` - (Optional) Removed capabilities 135 136 ### `ceph_fs` 137 138 #### Arguments 139 140 * `monitors` - (Required) Monitors is a collection of Ceph monitors More info: http://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it 141 * `path` - (Optional) Used as the mounted root, rather than the full Ceph tree, default is / 142 * `read_only` - (Optional) 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 143 * `secret_file` - (Optional) 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 144 * `secret_ref` - (Optional) 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 145 * `user` - (Optional) 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 146 147 ### `cinder` 148 149 #### Arguments 150 151 * `fs_type` - (Optional) 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 152 * `read_only` - (Optional) 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 153 * `volume_id` - (Required) Volume ID used to identify the volume in Cinder. More info: http://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md 154 155 ### `config_map` 156 157 #### Arguments 158 159 * `default_mode` - (Optional) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set. 160 * `items` - (Optional) If unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error. Paths must be relative and may not contain the '..' path or start with '..'. 161 * `name` - (Optional) Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names 162 163 ### `config_map_key_ref` 164 165 #### Arguments 166 167 * `key` - (Optional) The key to select. 168 * `name` - (Optional) Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names 169 170 ### `downward_api` 171 172 #### Arguments 173 174 * `default_mode` - (Optional) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set. 175 * `items` - (Optional) If unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error. Paths must be relative and may not contain the '..' path or start with '..'. 176 177 ### `empty_dir` 178 179 #### Arguments 180 181 * `medium` - (Optional) What type of storage medium should back this directory. The default is "" which means to use the node's default medium. Must be an empty string (default) or Memory. More info: http://kubernetes.io/docs/user-guide/volumes#emptydir 182 183 ### `env` 184 185 #### Arguments 186 187 * `name` - (Required) Name of the environment variable. Must be a C_IDENTIFIER 188 * `value` - (Optional) Variable references $(VAR_NAME) are expanded using the previous defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "". 189 * `value_from` - (Optional) Source for the environment variable's value 190 191 ### `exec` 192 193 #### Arguments 194 195 * `command` - (Optional) Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. 196 197 ### `fc` 198 199 #### Arguments 200 201 * `fs_type` - (Optional) 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. 202 * `lun` - (Required) FC target lun number 203 * `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). 204 * `target_ww_ns` - (Required) FC target worldwide names (WWNs) 205 206 ### `field_ref` 207 208 #### Arguments 209 210 * `api_version` - (Optional) Version of the schema the FieldPath is written in terms of, defaults to "v1". 211 * `field_path` - (Optional) Path of the field to select in the specified API version 212 213 ### `flex_volume` 214 215 #### Arguments 216 217 * `driver` - (Required) Driver is the name of the driver to use for this volume. 218 * `fs_type` - (Optional) 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. 219 * `options` - (Optional) Extra command options if any. 220 * `read_only` - (Optional) Whether to force the ReadOnly setting in VolumeMounts. Defaults to false (read/write). 221 * `secret_ref` - (Optional) 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. 222 223 ### `flocker` 224 225 #### Arguments 226 227 * `dataset_name` - (Optional) Name of the dataset stored as metadata -> name on the dataset for Flocker should be considered as deprecated 228 * `dataset_uuid` - (Optional) UUID of the dataset. This is unique identifier of a Flocker dataset 229 230 ### `gce_persistent_disk` 231 232 #### Arguments 233 234 * `fs_type` - (Optional) 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 235 * `partition` - (Optional) 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 236 * `pd_name` - (Required) 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 237 * `read_only` - (Optional) Whether to force the ReadOnly setting in VolumeMounts. Defaults to false. More info: http://kubernetes.io/docs/user-guide/volumes#gcepersistentdisk 238 239 ### `git_repo` 240 241 #### Arguments 242 243 * `directory` - (Optional) Target directory name. Must not contain or start with '..'. If '.' is supplied, the volume directory will be the git repository. Otherwise, if specified, the volume will contain the git repository in the subdirectory with the given name. 244 * `repository` - (Optional) Repository URL 245 * `revision` - (Optional) Commit hash for the specified revision. 246 247 ### `glusterfs` 248 249 #### Arguments 250 251 * `endpoints_name` - (Required) The endpoint name that details Glusterfs topology. More info: http://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md#create-a-pod 252 * `path` - (Required) The Glusterfs volume path. More info: http://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md#create-a-pod 253 * `read_only` - (Optional) 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 254 255 ### `host_path` 256 257 #### Arguments 258 259 * `path` - (Optional) Path of the directory on the host. More info: http://kubernetes.io/docs/user-guide/volumes#hostpath 260 261 ### `http_get` 262 263 #### Arguments 264 265 * `host` - (Optional) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. 266 * `http_header` - (Optional) Scheme to use for connecting to the host. 267 * `path` - (Optional) Path to access on the HTTP server. 268 * `port` - (Optional) Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. 269 * `scheme` - (Optional) Scheme to use for connecting to the host. 270 271 ### `http_header` 272 273 #### Arguments 274 275 * `name` - (Optional) The header field name 276 * `value` - (Optional) The header field value 277 278 ### `image_pull_secrets` 279 280 #### Arguments 281 282 * `name` - (Required) Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names 283 284 ### `iscsi` 285 286 #### Arguments 287 288 * `fs_type` - (Optional) 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 289 * `iqn` - (Required) Target iSCSI Qualified Name. 290 * `iscsi_interface` - (Optional) iSCSI interface name that uses an iSCSI transport. Defaults to 'default' (tcp). 291 * `lun` - (Optional) iSCSI target lun number. 292 * `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false. 293 * `target_portal` - (Required) 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). 294 295 ### `items` 296 297 #### Arguments 298 299 * `key` - (Optional) The key to project. 300 * `mode` - (Optional) Optional: mode bits to use on this file, must be a value between 0 and 0777. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set. 301 * `path` - (Optional) The relative path of the file to map the key to. May not be an absolute path. May not contain the path element '..'. May not start with the string '..'. 302 303 ### `lifecycle` 304 305 #### Arguments 306 307 * `post_start` - (Optional) post_start is called immediately after a container is created. If the handler fails, the container is terminated and restarted according to its restart policy. Other management of the container blocks until the hook completes. More info: http://kubernetes.io/docs/user-guide/container-environment#hook-details 308 * `pre_stop` - (Optional) pre_stop is called immediately before a container is terminated. The container is terminated after the handler completes. The reason for termination is passed to the handler. Regardless of the outcome of the handler, the container is eventually terminated. Other management of the container blocks until the hook completes. More info: http://kubernetes.io/docs/user-guide/container-environment#hook-details 309 310 ### `limits` 311 312 #### Arguments 313 314 * `cpu` - (Optional) CPU 315 * `memory` - (Optional) Memory 316 317 ### `liveness_probe` 318 319 #### Arguments 320 321 * `exec` - (Optional) exec specifies the action to take. 322 * `failure_threshold` - (Optional) Minimum consecutive failures for the probe to be considered failed after having succeeded. 323 * `http_get` - (Optional) Specifies the http request to perform. 324 * `initial_delay_seconds` - (Optional) Number of seconds after the container has started before liveness probes are initiated. More info: http://kubernetes.io/docs/user-guide/pod-states#container-probes 325 * `period_seconds` - (Optional) How often (in seconds) to perform the probe 326 * `success_threshold` - (Optional) Minimum consecutive successes for the probe to be considered successful after having failed. 327 * `tcp_socket` - (Optional) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported 328 * `timeout_seconds` - (Optional) Number of seconds after which the probe times out. More info: http://kubernetes.io/docs/user-guide/pod-states#container-probes 329 330 ### `nfs` 331 332 #### Arguments 333 334 * `path` - (Required) Path that is exported by the NFS server. More info: http://kubernetes.io/docs/user-guide/volumes#nfs 335 * `read_only` - (Optional) 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 336 * `server` - (Required) Server is the hostname or IP address of the NFS server. More info: http://kubernetes.io/docs/user-guide/volumes#nfs 337 338 ### `persistent_volume_claim` 339 340 #### Arguments 341 342 * `claim_name` - (Optional) ClaimName is the name of a PersistentVolumeClaim in the same 343 * `read_only` - (Optional) Will force the ReadOnly setting in VolumeMounts. 344 345 ### `photon_persistent_disk` 346 347 #### Arguments 348 349 * `fs_type` - (Optional) 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. 350 * `pd_id` - (Required) ID that identifies Photon Controller persistent disk 351 352 ### `port` 353 354 #### Arguments 355 356 * `container_port` - (Required) Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. 357 * `host_ip` - (Optional) What host IP to bind the external port to. 358 * `host_port` - (Optional) Number of port to expose on the host. If specified, this must be a valid port number, 0 < x < 65536. If HostNetwork is specified, this must match ContainerPort. Most containers do not need this. 359 * `name` - (Optional) If specified, this must be an IANA_SVC_NAME and unique within the pod. Each named port in a pod must have a unique name. Name for the port that can be referred to by services 360 * `protocol` - (Optional) Protocol for port. Must be UDP or TCP. Defaults to "TCP". 361 362 ### `post_start` 363 364 #### Arguments 365 366 * `exec` - (Optional) exec specifies the action to take. 367 * `http_get` - (Optional) Specifies the http request to perform. 368 * `tcp_socket` - (Optional) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported 369 370 ### `pre_stop` 371 372 #### Arguments 373 374 * `exec` - (Optional) exec specifies the action to take. 375 * `http_get` - (Optional) Specifies the http request to perform. 376 * `tcp_socket` - (Optional) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported 377 378 ### `quobyte` 379 380 #### Arguments 381 382 * `group` - (Optional) Group to map volume access to Default is no group 383 * `read_only` - (Optional) Whether to force the Quobyte volume to be mounted with read-only permissions. Defaults to false. 384 * `registry` - (Required) 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 385 * `user` - (Optional) User to map volume access to Defaults to serivceaccount user 386 * `volume` - (Required) Volume is a string that references an already created Quobyte volume by name. 387 388 ### `rbd` 389 390 #### Arguments 391 392 * `ceph_monitors` - (Required) A collection of Ceph monitors. More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it 393 * `fs_type` - (Optional) 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 394 * `keyring` - (Optional) 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 395 * `rados_user` - (Optional) The rados user name. Default is admin. More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it 396 * `rbd_image` - (Required) The rados image name. More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it 397 * `rbd_pool` - (Optional) The rados pool name. Default is rbd. More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it. 398 * `read_only` - (Optional) 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 399 * `secret_ref` - (Optional) 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 400 401 ### `readiness_probe` 402 403 #### Arguments 404 405 * `exec` - (Optional) exec specifies the action to take. 406 * `failure_threshold` - (Optional) Minimum consecutive failures for the probe to be considered failed after having succeeded. 407 * `http_get` - (Optional) Specifies the http request to perform. 408 * `initial_delay_seconds` - (Optional) Number of seconds after the container has started before liveness probes are initiated. More info: http://kubernetes.io/docs/user-guide/pod-states#container-probes 409 * `period_seconds` - (Optional) How often (in seconds) to perform the probe 410 * `success_threshold` - (Optional) Minimum consecutive successes for the probe to be considered successful after having failed. 411 * `tcp_socket` - (Optional) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported 412 * `timeout_seconds` - (Optional) Number of seconds after which the probe times out. More info: http://kubernetes.io/docs/user-guide/pod-states#container-probes 413 414 ### `resources` 415 416 #### Arguments 417 418 * `limits` - (Optional) Describes the maximum amount of compute resources allowed. More info: http://kubernetes.io/docs/user-guide/compute-resources/ 419 * `requests` - (Optional) Describes the minimum amount of compute resources required. 420 421 ### `requests` 422 423 #### Arguments 424 425 * `cpu` - (Optional) CPU 426 * `memory` - (Optional) Memory 427 428 ### `resource_field_ref` 429 430 #### Arguments 431 432 * `container_name` - (Optional) The name of the container 433 * `resource` - (Required) Resource to select 434 435 ### `se_linux_options` 436 437 #### Arguments 438 439 * `level` - (Optional) Level is SELinux level label that applies to the container. 440 * `role` - (Optional) Role is a SELinux role label that applies to the container. 441 * `type` - (Optional) Type is a SELinux type label that applies to the container. 442 * `user` - (Optional) User is a SELinux user label that applies to the container. 443 444 ### `secret` 445 446 #### Arguments 447 448 * `secret_name` - (Optional) Name of the secret in the pod's namespace to use. More info: http://kubernetes.io/docs/user-guide/volumes#secrets 449 450 ### `secret_key_ref` 451 452 #### Arguments 453 454 * `key` - (Optional) The key of the secret to select from. Must be a valid secret key. 455 * `name` - (Optional) Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names 456 457 ### `secret_ref` 458 459 #### Arguments 460 461 * `name` - (Optional) Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names 462 463 ### `security_context` 464 465 #### Arguments 466 467 * `fs_group` - (Optional) A special supplemental group that applies to all containers in a pod. Some volume types allow the Kubelet to change the ownership of that volume to be owned by the pod: 1. The owning GID will be the FSGroup 2. The setgid bit is set (new files created in the volume will be owned by FSGroup) 3. The permission bits are OR'd with rw-rw---- If unset, the Kubelet will not modify the ownership and permissions of any volume. 468 * `run_as_non_root` - (Optional) Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. 469 * `run_as_user` - (Optional) The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified 470 * `se_linux_options` - (Optional) The SELinux context to be applied to all containers. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. 471 * `supplemental_groups` - (Optional) A list of groups applied to the first process run in each container, in addition to the container's primary GID. If unspecified, no groups will be added to any container. 472 473 ### `tcp_socket` 474 475 #### Arguments 476 477 * `port` - (Required) Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. 478 479 ### `value_from` 480 481 #### Arguments 482 483 * `config_map_key_ref` - (Optional) Selects a key of a ConfigMap. 484 * `field_ref` - (Optional) Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.podIP.. 485 * `resource_field_ref` - (Optional) Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.podIP.. 486 * `secret_key_ref` - (Optional) Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.podIP.. 487 488 ### `volume` 489 490 #### Arguments 491 492 * `aws_elastic_block_store` - (Optional) 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 493 * `azure_disk` - (Optional) Represents an Azure Data Disk mount on the host and bind mount to the pod. 494 * `azure_file` - (Optional) Represents an Azure File Service mount on the host and bind mount to the pod. 495 * `ceph_fs` - (Optional) Represents a Ceph FS mount on the host that shares a pod's lifetime 496 * `cinder` - (Optional) Represents a cinder volume attached and mounted on kubelets host machine. More info: http://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md 497 * `config_map` - (Optional) ConfigMap represents a configMap that should populate this volume 498 * `downward_api` - (Optional) DownwardAPI represents downward API about the pod that should populate this volume 499 * `empty_dir` - (Optional) EmptyDir represents a temporary directory that shares a pod's lifetime. More info: http://kubernetes.io/docs/user-guide/volumes#emptydir 500 * `fc` - (Optional) Represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod. 501 * `flex_volume` - (Optional) Represents a generic volume resource that is provisioned/attached using an exec based plugin. This is an alpha feature and may change in future. 502 * `flocker` - (Optional) 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 503 * `gce_persistent_disk` - (Optional) 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 504 * `git_repo` - (Optional) GitRepo represents a git repository at a particular revision. 505 * `glusterfs` - (Optional) 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 506 * `host_path` - (Optional) 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 507 * `iscsi` - (Optional) Represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. 508 * `name` - (Optional) Volume's name. Must be a DNS_LABEL and unique within the pod. More info: http://kubernetes.io/docs/user-guide/identifiers#names 509 * `nfs` - (Optional) Represents an NFS mount on the host. Provisioned by an admin. More info: http://kubernetes.io/docs/user-guide/volumes#nfs 510 * `persistent_volume_claim` - (Optional) The specification of a persistent volume. 511 * `photon_persistent_disk` - (Optional) Represents a PhotonController persistent disk attached and mounted on kubelets host machine 512 * `quobyte` - (Optional) Quobyte represents a Quobyte mount on the host that shares a pod's lifetime 513 * `rbd` - (Optional) 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 514 * `secret` - (Optional) Secret represents a secret that should populate this volume. More info: http://kubernetes.io/docs/user-guide/volumes#secrets 515 * `vsphere_volume` - (Optional) Represents a vSphere volume attached and mounted on kubelets host machine 516 517 ### `volume_mount` 518 519 #### Arguments 520 521 * `mount_path` - (Required) Path within the container at which the volume should be mounted. Must not contain ':'. 522 * `name` - (Required) This must match the Name of a Volume. 523 * `read_only` - (Optional) Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. 524 * `sub_path` - (Optional) Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root). 525 526 ### `vsphere_volume` 527 528 #### Arguments 529 530 * `fs_type` - (Optional) 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. 531 * `volume_path` - (Required) Path that identifies vSphere volume vmdk 532 533 ## Import 534 535 Pod can be imported using the namespace and name, e.g. 536 537 ``` 538 $ terraform import kubernetes_pod.example default/terraform-example 539 ```