kubernetes_pod

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.

Read more at Kubernetes reference

Example Usage

data "kubernetes_pod" "test" {
  metadata {
    name = "terraform-example"
  }
}

Argument Reference

The following arguments are supported:

Nested Blocks

metadata

Arguments

Attributes

spec

Attributes

affinity

Attributes

container

Attributes

config_map

Attributes

config_map_ref

Attributes

config_map_key_ref

Attributes

dns_config

Attributes

The option block supports the following:

downward_api

Attributes

empty_dir

Attributes

env

Attributes

env_from

Attributes

exec

Attributes

grpc

Arguments

image_pull_secrets

Attributes

lifecycle

Attributes

limits

Attributes

liveness_probe

Attributes

nfs

Attributes

persistent_volume_claim

Attributes

photon_persistent_disk

Attributes

port

Attributes

post_start

Attributes

pre_stop

Attributes

quobyte

Attributes

rbd

Attributes

readiness_probe

Attributes

resources

Arguments

resources is a computed attribute and thus if it is not configured in terraform code, the value will be computed from the returned Kubernetes object. That causes a situation when removing resources from terraform code does not update the Kubernetes object. In order to delete resources from the Kubernetes object, configure an empty attribute in your code.

Please, look at the example below:

resources {
  limits   = {}
  requests = {}
}

requests

Attributes

resource_field_ref

Attributes

seccomp_profile

Attributes

se_linux_options

Attributes

secret

Attributes

The items block supports the following:

secret_ref

Attributes

secret_key_ref

Attributes

secret_ref

Attributes

container security_context

ArgumAttributesents

capabilities

Attributes

pod security_context

Attributes

tcp_socket

Attributes

value_from

Attributes

volume_mount

Attributes

Argument Reference

The following attributes are exported:

Import

Pod can be imported using the namespace and name, e.g.

$ terraform import kubernetes_pod.example default/terraform-example