diff --git a/README.md b/README.md index 54732dd..1851811 100644 --- a/README.md +++ b/README.md @@ -1,32 +1,575 @@ -# Terraform Module to Deploy Kubernetes Yaml Files # +# Kubernetes-Terraform-Yaml Module # +## Terraform Module to Deploy Multiple Application Configurations into Kubernetes Cluster # +### Sourcing Application Configuration from outside Terraform code as YAML or JSON # - This module makes Terraform possible to use YAML files as a source for every operation that is provided by official Kubernetes provider. +Terraform is a tool for building, changing, and versioning infrastructure safely and efficiently. Terraform can manage popular cloud providers by means of plugins.Infrastructure is described using a high-level configuration syntax. This allows a blueprint of your datacenter to be versioned and treated as you would any other code. Additionally, infrastructure can be shared and re-used. This concept is called Infrastructure as Code. -### Example Usage ### +See https://www.terraform.io/intro/index.html for more information. + +#### Motivation #### + + * Sourcing application deployment configuration for YAML files creates a single source of truth. Same configuration can be used both in declarative approach (Terraform) and Kubectl (Imperative Approach) + * Configuring application from outside Terraform using bare configuration text in terms of YAML or JSON makes it possible to an API access and modify the configuration easily. + * Terraform does not provide this feature embedded in the application, as a plugin or module. + * Any application can be installed into cluster without writing a particular module for that application. + + This module makes [Terraform](https://www.terraform.io/) possible to use YAML or JSON files as a source for every resource that is provided by official [Kubernetes provider](https://www.terraform.io/docs/providers/kubernetes/). + +![Terraform-Yaml-Kubernetes Diagram](k8s-terraform-yaml-diagram.png) + + +### Prerequisites ### + +* Pre-configured, running and locally accesible kubernetes cluster. See [AWS EKS](https://aws.amazon.com/eks/) +* [Terraform Installation](https://www.terraform.io/downloads.html) , version >= 0.12 + + +### Example Usage with [YAML](https://yaml.org) ### ```terraform + +# Use your own configuration or leave it blank to use current kubeconfig context. provider "kubernetes" { } +# Reads yaml files then merges it into appConfig object. locals { appConfig = merge ( { - test-app = { - k8s = { - deployment = yamldecode(file("deployment.yml")) - service = yamldecode(file("service.yml")) - } - } + test-app = { + k8s = { + deployment = yamldecode(file("deployment.yml")) + service = yamldecode(file("service.yml")) + } + } } ) } +# Terraform module to utilize yaml fields in configuration. module "k8s_yaml_tf" { - source = "../k8s-yaml-tf" - + source = "github.com/brcnblc/k8s-terraform-yaml" appConfig = local.appConfig - module_enabled=true } ``` +**Note:** Use the names "deployment", "service" from below list in Further Reading part. You can also use respective resource file name. + +[YAML Basic Example Link](https://github.com/brcnblc/k8s-terraform-yaml/tree/master/examples/basic-yaml-sample) + + +--- + +**Note:** *This project is under heavy development period. Use with caution and please feel free to open issue about problems.* + +--- + +### Example Usage with [JSON](https://www.json.org/) Configuration file ### + +Create `app.auto.tfvar.json` in your terraform project. You can rename app. part but keep the rest of it. Such as `my-app.auto.tfvar.jso`or `config-auto.tfvar.json` + +See: [app.auto.tfvar.json](https://github.com/brcnblc/k8s-terraform-yaml/blob/master/app.auto.tfvars.json) for full example configuration file. + +Edit it as follows: + +```json +{ + "appConfig": { + "application-1":{ + "k8s":{ + "deployment":{ + + }, + "service":{ + + }, + "configuration_field_name" :{ + + } + } + }, + "app-2":{ + + } + } +} +``` + +[JSON Basic Example Link](https://github.com/brcnblc/k8s-terraform-yaml/tree/master/examples/basic-json-config) + +Place following code in your terraform project. (Eg: `main.tf`) + +```terraform +module "k8s_yaml_tf" { + source = "github.com/brcnblc/k8s-terraform-yaml" + + appConfig = var.appConfig +} +``` + +Thats it. + +Run: + +```sh +terraform apply +``` + +If you have already access your cluster it should deploy related apps and services. If not please let me know. + +Please notice that you can install as many application as you want with as many resources as they need without changing the code. You can then use an Api backend to configure JSON file and restructure your configuration. + +Hope it helps. Happy coding :wink: + +--- + +#### Output of k8s-tarraform-yaml module: #### + +``` +Plan: 4 to add, 0 to change, 0 to destroy. + +Do you want to perform these actions? + Terraform will perform the actions described above. + Only 'yes' will be accepted to approve. + + Enter a value: yes + +kubernetes_service.instance["sec-app"]: Creating... +kubernetes_service.instance["my-app"]: Creating... +kubernetes_deployment.instance["my-app"]: Creating... +kubernetes_deployment.instance["sec-app"]: Creating... +kubernetes_service.instance["my-app"]: Creation complete after 2s [id=default/my-app-7rckh] +kubernetes_service.instance["sec-app"]: Creation complete after 4s [id=default/sec-app-w8qhd] +kubernetes_deployment.instance["sec-app"]: Creation complete after 6s [id=default/sec-app-dqjsm] +kubernetes_deployment.instance["my-app"]: Creation complete after 6s [id=default/my-app-gpnn7] + +Apply complete! Resources: 4 added, 0 changed, 0 destroyed. + +Outputs: + +output = { + "my-app" = { + "deployment" = { + "metadata" = { + "generation" = 1 + "name" = "my-app-gpnn7" + "resourceVersion" = "476350" + "selfLink" = "/apis/apps/v1/namespaces/default/deployments/my-app-gpnn7" + "uid" = "479576b2-c2b8-4eda-b344-f3cf58286811" + } + } + "spec_template_spec_container" = { + "imagePullPolicy" = "Always" + } + "spec_template_spec_container_resources_limits" = { + "cpu" = "500m" + "memory" = "512Mi" + } + "spec_template_spec_container_resources_requests" = { + "cpu" = "250m" + "memory" = "50Mi" + } + } + "service" = { + "loadBalancerIngress" = [] + "metadata" = { + "generation" = 0 + "name" = "my-app-7rckh" + "resourceVersion" = "476316" + "selfLink" = "/api/v1/namespaces/default/services/my-app-7rckh" + "uid" = "74740f99-4ce1-4d72-8562-2867c9c6632d" + } + "spec" = { + "clusterIp" = "10.100.77.16" + "externalTrafficPolicy" = "Cluster" + } + "spec_port" = { + "nodePort" = 30931 + "targetPort" = "80" + } + } + } + "sec-app" = { + "deployment" = { + "metadata" = { + "generation" = 1 + "name" = "sec-app-dqjsm" + "resourceVersion" = "476354" + "selfLink" = "/apis/apps/v1/namespaces/default/deployments/sec-app-dqjsm" + "uid" = "3171af8a-f17b-48ce-8b72-fca3fc877632" + } + "spec_template_spec_container" = { + "imagePullPolicy" = "Always" + } + "spec_template_spec_container_resources_limits" = { + "cpu" = "500m" + "memory" = "512Mi" + } + "spec_template_spec_container_resources_requests" = { + "cpu" = "250m" + "memory" = "50Mi" + } + } + "service" = { + "loadBalancerIngress" = [ + { + "hostname" = "a4e9c0...truncated.....d4....3f1-1....322.eu-central-1.elb.amazonaws.com" + "ip" = "" + }, + ] + "metadata" = { + "generation" = 0 + "name" = "sec-app-w8qhd" + "resourceVersion" = "476346" + "selfLink" = "/api/v1/namespaces/default/services/sec-app-w8qhd" + "uid" = "4e9c01fc-36e9-448f-86f9-d434ea373f15" + } + "spec" = { + "clusterIp" = "10.100.240.18" + "externalTrafficPolicy" = "Cluster" + } + "spec_port" = { + "nodePort" = 30663 + "targetPort" = "80" + } + } + } +} + +``` + +Note that the above output includes 4 deployments for 2 applications. + * my-app + - deployment + - service - LoadBalancer + * sec-app + - deployment + - service - NodePort + +__my-app__ also includes a Load Balancer service which exposes the application to internet. In this case it creates an AWS ELB. + +The configuration file for the above deployment is a json file located in the root folder. `app.auto.tfvar.json`. As you may already know when you put json extension terraform interprets these files as JSON. Please keep the same structure when you prepare your configuration. Such as: + +```json +{ + "appConfig": { + "application-1":{ + "k8s":{ + "deployment":{ + + }, + "service":{ + + }, + "what-ever-you-use" :{ + "take the names of the resource from related file name": "" + } + } + }, + "app-2":{ + + } + } +} +``` +See the full content of the file [app.auto.tfvar.json](https://github.com/brcnblc/k8s-terraform-yaml/blob/master/app.auto.tfvars.json) in root folder. + +You can define as many applications as you need with as many resources as your specific requirements. Program is designed so that every resource iterates for every application in the config file where unused resources are not created. + +You can also disable applications or, part of the application such as service partially using `disabled : true` in config file. If you want to uninstall all of deployments you can use `module_enabled : false` in the config file. Note that this will destroy all applications at once. + +Below application-1 deployment section is disabled, app-2 completely disabled, so that terraform will uninstall the deployment when applied. + +(see `app.auto.tfvar.json`) file +```json +{ + "module_enabled":true, + "appConfig": { + "application-1":{ + "k8s":{ + "disabled": true, + "deployment":{ + + } + }, + "app-2":{ + "disabled":true + + } + } +} +``` +------ + +### Further Reading ### + +Following names are valid for configuration_field_name: + + * api_service + * cluster_role + * cluster_role_binding + * config_map + * cron_job + * daemonset + * deployment + * endpoints + * horizontal_pod_autoscaler + * ingress + * job + * limit_range + * namespace + * network_policy + * persistent_volume + * persistent_volume_claim + * pod + * pod_disruption_budget + * priority_class + * replication_controller + * resource_quota + * role + * role_binding + * secret + * service + * service_account + * stateful_set + * storage_class + +See https://www.terraform.io/docs/providers/kubernetes/ for more details about each section. + +Also visit https://kubernetes.io/docs/concepts/ for more information about these concepts. + +#### NOTES: #### + * Do not change __appConfig__ field name + * Do not change __k8s__ field name + * Use __configuration_field_name__ from above list + * Put your custom definitions under **custom** field under application field such as: +```json +{ + "appConfig": { + "my-app":{ + "k8s":{ + "custom":{ + "Anything can": "go", + "here": 0 + } + } +} +``` + * Write your configuration according to Kubernetes [YAML](https://yaml.org) configuration parameters. See [kubernetes-api/v1.18](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/) or visit [Kubernetes Concepts](https://kubernetes.io/docs/concepts/) to have some idea about configuration files. + * Use camelCase in configuration fields, since it is default behavior in kubernetes YAML files and program uses camelCased field names as default. + * Use square brackets indicating that field is an array if it is a list in YAML config file. Eg: + +```json +"ports": [ + { + "containerPort": 3000, + "name": "http" + } + ] +``` + +Sourcing from: + +```yaml +ports: +- containerPort : 3000 + name: http +``` + + +-------- + +## Advanced Topics ## + +Since version 0.12 Terraform introduced new iterators such as for_each. Module heavily utilizes for_each to create resources depending on the demand. for_each also enables us to disable infrastructure since iterator may have zero elements making it posible to enable/disable resources. + +### Resource Files ### + +Resource is multiplied by the amount of application. Also every section is conditionally created depending on the configuration. + +```terraform +resource "kubernetes_deployment" "instance" { + depends_on = [null_resource.module_depends_on] + for_each = local.deployment.applications + + dynamic "metadata" { # Nesting Mode: list Min Items : 1 Max Items : 1 + for_each = contains(keys(each.value), "metadata") ? {item = each.value["metadata"]} : {} + + content { + annotations = lookup(metadata.value, "annotations", null) + # Type: ['map', 'string'] Optional + # An unstructured key value map stored with the deployment that may be used to store arbitrary metadata. More info: http://kubernetes.io/docs/user-guide/annotations +. +. +. + dynamic "spec" { # Nesting Mode: list Min Items : 1 Max Items : 1 + for_each = contains(keys(template.value), "spec") ? {item = template.value["spec"]} : {} + + content { + active_deadline_seconds = lookup(spec.value, "activeDeadlineSeconds", null) + # Type: number 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. +. +. +. + dynamic "container" { # Nesting Mode: list + for_each = lookup(spec.value, "containers", {}) + + content { + args = lookup(container.value, "args", null) + # Type: ['list', 'string'] 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 + command = lookup(container.value, "command", null + ) + # Type: ['list', 'string'] 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 + + image = lookup(container.value, "image", null) + # Type: string Optional + # Docker image name. More info: http://kubernetes.io/docs/user-guide/images + +``` + +### Locals ### + +Configuration is imported from `var.appConfig` into `local.appConfig` then evaluated to create sub objects for each resource, having application name as key and resource configuration as value. Enabling/Disabling is also handled here. + +```terraform +locals { + api_service = { + applications = { + for key, value in var.appConfig : + key => lookup(lookup(value, "k8s", {}), "api_service", null) + if contains(keys(lookup(value, "k8s", {})), "api_service") && var.module_enabled && !lookup(lookup(value, "k8s", {}), "disabled", false) && !lookup(lookup(lookup(value, "k8s", {}), "api_service", {}), "disabled", false) + } + } + + cluster_role = { + applications = { + for key, value in var.appConfig : + key => lookup(lookup(value, "k8s", {}), "cluster_role", null) + if contains(keys(lookup(value, "k8s", {})), "cluster_role") && var.module_enabled && !lookup(lookup(value, "k8s", {}), "disabled", false) && !lookup(lookup(lookup(value, "k8s", {}), "cluster_role", {}), "disabled", false) + } + } + . + . + . +``` + +### Outputs ### + +Aside from `locals.tf` and respective resource files, program generates `outputs.tf`. So do not edit these files since they are subject to be re-generated by python script.A map of resource computed values are generated to work conditionally according to resource demand. Terraform [try](https://www.terraform.io/docs/configuration/functions/try.html) function guarantees that terraform does not throw error in case of empty resources. + + +```terraform +output "output" { +value = { + for app, config in var.appConfig: + app => { + api_service = contains(keys(local.api_service.applications), app) ? { + metadata = { + generation = try(kubernetes_api_service.instance[app].metadata.0.generation,null) + # A sequence number representing a specific generation of the desired state. + + name = try(kubernetes_api_service.instance[app].metadata.0.name,null) + # Name of the api_service, must be unique. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names + + resourceVersion = try(kubernetes_api_service.instance[app].metadata.0.resource_version,null) + # An opaque value that represents the internal version of this api_service that can be used by clients to determine when api_service has changed. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + + selfLink = try(kubernetes_api_service.instance[app].metadata.0.self_link,null) + # A URL representing this api_service. + + uid = try(kubernetes_api_service.instance[app].metadata.0.uid,null) + # The unique in time and space value for this api_service. More info: http://kubernetes.io/docs/user-guide/identifiers#uids + + } + + } : null +. +. +. +``` + +------ + +### About Python Script ### + +There is a python script (`prepare.py`) in the root folder. This is a python 3 script, which reads `provider.json` file to extract resources then prepare terraform files accordingly. It is not needed to run this script every time. The root folder already contains kubernetes resource files created by the script. + +You may run the script when ever you want to make a change in the tf files, locals or output. + +### How to create provider.json ### + +Terraform presents an inline command to create provider file. In the terminal execute the following command if you would like obtain an updated file. (This file already exists in the repository root folder) + +```sh +terraform providers schema -json > provider.json +``` + +When executed terraform cli prepares an output including all providers used in the project. You can access structure of the resources within this file. + +You can also get a tree view of the providers using following command. +```sh +terraform providers +``` + +Output: +``` +. +├── provider.kubernetes +└── provider.null +``` + +### Considerations ### + +The structure does not present an explicit variable to indicate that the attribute is an argument or an output. But there is a field named `computed`. In general I use this field to separate outputs from arguments. However some arguments such as metadata.name has `computed : true` as well. Some manual exception tables are utilized to overcome this unfortunate situation. :grimacing: + + +The program is started in `prepare.py` as follows: + +```python +process_json( + json_file = 'provider.json', + config_var = "appConfig", + filter = [], + debug = False, + verbose = 1, + long_out = True + ) +``` + +Run: + +``` +python prepare.py +``` +In order to re-generate files: + * resource files ending with `.tf` extension + * locals.tf + * outputs.tf + + +#### Output of the python program: #### +``` +Processing kubernetes_api_service... +Processing kubernetes_cluster_role... +Processing kubernetes_deployment... +. +. +. +Processing kubernetes_service_account... +Processing kubernetes_stateful_set... +Processing kubernetes_storage_class... +``` + +### Future Plans ### + + * Run YAML configurations from a folder. + * Merge YAML configuration with JSON configuration + - Override Configuration + - Append Configuration + - Output resulting configuration to YAML +Any contribution is welcome. +bircanbilici@gmail.com diff --git a/app.auto.tfvars.json b/app.auto.tfvars.json index e8c4955..69a9cb3 100644 --- a/app.auto.tfvars.json +++ b/app.auto.tfvars.json @@ -1,5 +1,5 @@ { - "module_enabled": false, + "module_enabled": true, "appConfig": { "sec-app": { "disabled": false, @@ -175,13 +175,6 @@ } } } - }, - "test-app":{ - "k8s":{ - "deployment":{ - "importYaml" : "deployment.yml" - } - } } } } \ No newline at end of file diff --git a/d.json b/d.json deleted file mode 100644 index af1a1e7..0000000 --- a/d.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "apiVersion": "apps/v1", - "kind": "Deployment", - "metadata": { - "labels": { - "test": "MyExampleApp" - }, - "name": "terraform-example" - }, - "spec": { - "replicas": 1, - "selector": { - "matchLabels": { - "test": "MyExampleApp" - } - }, - "template": { - "metadata": { - "labels": { - "test": "MyExampleApp" - } - }, - "spec": { - "containers": [ - { - "image": "277341187485.dkr.ecr.eu-central-1.amazonaws.com/sample-app:latest", - "name": "example", - "ports": [ - { - "containerPort": 80 - } - ] - } - ] - } - } - } -} \ No newline at end of file diff --git a/examples/basic-json-config/app.auto.tfvars.json b/examples/basic-json-config/app.auto.tfvars.json new file mode 100644 index 0000000..69a9cb3 --- /dev/null +++ b/examples/basic-json-config/app.auto.tfvars.json @@ -0,0 +1,180 @@ +{ + "module_enabled": true, + "appConfig": { + "sec-app": { + "disabled": false, + "k8s": { + "deployment": { + "disabled": false, + "metadata": { + "generateName": "sec-app-", + "labels": { + "app": "sec-app", + "env": "test" + } + }, + "spec": { + "replicas": 1, + "selector": { + "matchLabels": { + "app": "sec-app" + } + }, + "template": { + "metadata": { + "labels": { + "app": "sec-app", + "env": "test" + } + }, + "spec": { + "containers": [ + { + "name": "sample-app", + "image": "277341187485.dkr.ecr.eu-central-1.amazonaws.com/sample-app:latest", + "ports": [ + { + "containerPort": 3000, + "name": "http" + } + ], + "resources": { + "limits": { + "cpu": "0.5", + "memory": "512Mi" + }, + "requests": { + "cpu": "250m", + "memory": "50Mi" + } + }, + "livenessProbe": { + "httpGet": { + "path": "/", + "port": 3000, + "httpHeaders": [ + { + "name": "X-Custom-Header-Znnn", + "value": "Awesome" + } + ], + "initialDelaySeconds": 15, + "timeoutSeconds": 1 + } + }, + "restartPolicy": "always" + } + ] + } + } + } + }, + "service": { + "metadata": { + "generateName": "sec-app-" + }, + "spec": { + "selector": { + "app": "sec-app" + }, + "ports": [ + { + "protocol": "TCP", + "port": 80, + "target_port": 3000 + } + ], + "type": "LoadBalancer" + } + } + } + }, + "my-app": { + "disabled": false, + "k8s": { + "deployment": { + "metadata": { + "generateName": "my-app-", + "labels": { + "app": "my-app", + "env": "test" + } + }, + "spec": { + "replicas": 1, + "selector": { + "matchLabels": { + "app": "my-app" + } + }, + "template": { + "metadata": { + "labels": { + "app": "my-app", + "env": "test" + } + }, + "spec": { + "containers": [ + { + "name": "my-app", + "image": "277341187485.dkr.ecr.eu-central-1.amazonaws.com/sample-app:latest", + "ports": [ + { + "containerPort": 3000, + "name": "http" + } + ], + "resources": { + "limits": { + "cpu": "0.5", + "memory": "512Mi" + }, + "requests": { + "cpu": "250m", + "memory": "50Mi" + } + }, + "livenessProbe": { + "httpGet": { + "path": "/", + "port": 3000, + "httpHeaders": [ + { + "name": "X-Custom-Header-Znnn", + "value": "Awesome" + } + ], + "initialDelaySeconds": 15, + "timeoutSeconds": 1 + } + }, + "restartPolicy": "always" + } + ] + } + } + } + }, + "service": { + "metadata": { + "generateName": "my-app-" + }, + "spec": { + "selector": { + "app": "my-app" + }, + "ports": [ + { + "protocol": "TCP", + "port": 80, + "target_port": 3000 + } + ], + "type": "NodePort" + } + } + } + } + } +} \ No newline at end of file diff --git a/examples/basic-json-config/main.tf b/examples/basic-json-config/main.tf new file mode 100644 index 0000000..93b91c1 --- /dev/null +++ b/examples/basic-json-config/main.tf @@ -0,0 +1,12 @@ +provider "kubernetes" { + # Use your custom configuration here or leave it blank so that + # it uses your default configuration in kubeconfig file +} + + +module "k8s_yaml_tf" { + #source = "github.com/brcnblc/k8s-terraform-yaml" + source = "../.." # Use above source in your project + + appConfig = var.appConfig +} \ No newline at end of file diff --git a/examples/basic-json-config/variables.tf b/examples/basic-json-config/variables.tf new file mode 100644 index 0000000..58baa1c --- /dev/null +++ b/examples/basic-json-config/variables.tf @@ -0,0 +1,5 @@ +variable "appConfig" { + description = "Deployment Configurations" + type = any + default = {} +} \ No newline at end of file diff --git a/examples/basic-yaml-sample/main.tf b/examples/basic-yaml-sample/main.tf index bae6381..9a48819 100644 --- a/examples/basic-yaml-sample/main.tf +++ b/examples/basic-yaml-sample/main.tf @@ -16,8 +16,7 @@ locals { } module "k8s_yaml_tf" { - source = "github.com/brcnblc/k8s-terraform-yaml" - + #source = "github.com/brcnblc/k8s-terraform-yaml" + source = "../.." appConfig = local.appConfig - module_enabled=true } diff --git a/k8s-terraform-yaml-diagram.png b/k8s-terraform-yaml-diagram.png new file mode 100644 index 0000000..d7c8565 Binary files /dev/null and b/k8s-terraform-yaml-diagram.png differ diff --git a/output.tf b/output.tf deleted file mode 100644 index e69de29..0000000 diff --git a/outputs.tf b/outputs.tf index e69de29..b925cbd 100644 --- a/outputs.tf +++ b/outputs.tf @@ -0,0 +1,1292 @@ +output "output" { +value = { + for app, config in var.appConfig: + app => { + api_service = contains(keys(local.api_service.applications), app) ? { + metadata = { + generation = try(kubernetes_api_service.instance[app].metadata.0.generation,null) + # A sequence number representing a specific generation of the desired state. + + name = try(kubernetes_api_service.instance[app].metadata.0.name,null) + # Name of the api_service, must be unique. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names + + resourceVersion = try(kubernetes_api_service.instance[app].metadata.0.resource_version,null) + # An opaque value that represents the internal version of this api_service that can be used by clients to determine when api_service has changed. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + + selfLink = try(kubernetes_api_service.instance[app].metadata.0.self_link,null) + # A URL representing this api_service. + + uid = try(kubernetes_api_service.instance[app].metadata.0.uid,null) + # The unique in time and space value for this api_service. More info: http://kubernetes.io/docs/user-guide/identifiers#uids + + } + + } : null + + cluster_role = contains(keys(local.cluster_role.applications), app) ? { + metadata = { + generation = try(kubernetes_cluster_role.instance[app].metadata.0.generation,null) + # A sequence number representing a specific generation of the desired state. + + name = try(kubernetes_cluster_role.instance[app].metadata.0.name,null) + # Name of the clusterRole, must be unique. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names + + resourceVersion = try(kubernetes_cluster_role.instance[app].metadata.0.resource_version,null) + # An opaque value that represents the internal version of this clusterRole that can be used by clients to determine when clusterRole has changed. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + + selfLink = try(kubernetes_cluster_role.instance[app].metadata.0.self_link,null) + # A URL representing this clusterRole. + + uid = try(kubernetes_cluster_role.instance[app].metadata.0.uid,null) + # The unique in time and space value for this clusterRole. More info: http://kubernetes.io/docs/user-guide/identifiers#uids + + } + + } : null + + cluster_role_binding = contains(keys(local.cluster_role_binding.applications), app) ? { + metadata = { + generation = try(kubernetes_cluster_role_binding.instance[app].metadata.0.generation,null) + # A sequence number representing a specific generation of the desired state. + + name = try(kubernetes_cluster_role_binding.instance[app].metadata.0.name,null) + # Name of the clusterRoleBinding, must be unique. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names + + resourceVersion = try(kubernetes_cluster_role_binding.instance[app].metadata.0.resource_version,null) + # An opaque value that represents the internal version of this clusterRoleBinding that can be used by clients to determine when clusterRoleBinding has changed. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + + selfLink = try(kubernetes_cluster_role_binding.instance[app].metadata.0.self_link,null) + # A URL representing this clusterRoleBinding. + + uid = try(kubernetes_cluster_role_binding.instance[app].metadata.0.uid,null) + # The unique in time and space value for this clusterRoleBinding. More info: http://kubernetes.io/docs/user-guide/identifiers#uids + + } + + subject = { + apiGroup = try(kubernetes_cluster_role_binding.instance[app].subject.0.api_group,null) + # The API group of the subject resource. + + } + + } : null + + config_map = contains(keys(local.config_map.applications), app) ? { + metadata = { + generation = try(kubernetes_config_map.instance[app].metadata.0.generation,null) + # A sequence number representing a specific generation of the desired state. + + name = try(kubernetes_config_map.instance[app].metadata.0.name,null) + # Name of the config map, must be unique. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names + + resourceVersion = try(kubernetes_config_map.instance[app].metadata.0.resource_version,null) + # An opaque value that represents the internal version of this config map that can be used by clients to determine when config map has changed. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + + selfLink = try(kubernetes_config_map.instance[app].metadata.0.self_link,null) + # A URL representing this config map. + + uid = try(kubernetes_config_map.instance[app].metadata.0.uid,null) + # The unique in time and space value for this config map. More info: http://kubernetes.io/docs/user-guide/identifiers#uids + + } + + } : null + + cron_job = contains(keys(local.cron_job.applications), app) ? { + metadata = { + generation = try(kubernetes_cron_job.instance[app].metadata.0.generation,null) + # A sequence number representing a specific generation of the desired state. + + name = try(kubernetes_cron_job.instance[app].metadata.0.name,null) + # Name of the cronjob, must be unique. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names + + resourceVersion = try(kubernetes_cron_job.instance[app].metadata.0.resource_version,null) + # An opaque value that represents the internal version of this cronjob that can be used by clients to determine when cronjob has changed. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + + selfLink = try(kubernetes_cron_job.instance[app].metadata.0.self_link,null) + # A URL representing this cronjob. + + uid = try(kubernetes_cron_job.instance[app].metadata.0.uid,null) + # The unique in time and space value for this cronjob. More info: http://kubernetes.io/docs/user-guide/identifiers#uids + + } + + spec_job_template_metadata = { + generation = try(kubernetes_cron_job.instance[app].spec.0.job_template.0.metadata.0.generation,null) + # A sequence number representing a specific generation of the desired state. + + name = try(kubernetes_cron_job.instance[app].spec.0.job_template.0.metadata.0.name,null) + # Name of the jobTemplateSpec, must be unique. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names + + resourceVersion = try(kubernetes_cron_job.instance[app].spec.0.job_template.0.metadata.0.resource_version,null) + # An opaque value that represents the internal version of this jobTemplateSpec that can be used by clients to determine when jobTemplateSpec has changed. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + + selfLink = try(kubernetes_cron_job.instance[app].spec.0.job_template.0.metadata.0.self_link,null) + # A URL representing this jobTemplateSpec. + + uid = try(kubernetes_cron_job.instance[app].spec.0.job_template.0.metadata.0.uid,null) + # The unique in time and space value for this jobTemplateSpec. More info: http://kubernetes.io/docs/user-guide/identifiers#uids + + } + + spec_job_template_spec_template_metadata = { + generation = try(kubernetes_cron_job.instance[app].spec.0.job_template.0.spec.0.template.0.metadata.0.generation,null) + # A sequence number representing a specific generation of the desired state. + + name = try(kubernetes_cron_job.instance[app].spec.0.job_template.0.spec.0.template.0.metadata.0.name,null) + # Name of the job, must be unique. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names + + resourceVersion = try(kubernetes_cron_job.instance[app].spec.0.job_template.0.spec.0.template.0.metadata.0.resource_version,null) + # An opaque value that represents the internal version of this job that can be used by clients to determine when job has changed. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + + selfLink = try(kubernetes_cron_job.instance[app].spec.0.job_template.0.spec.0.template.0.metadata.0.self_link,null) + # A URL representing this job. + + uid = try(kubernetes_cron_job.instance[app].spec.0.job_template.0.spec.0.template.0.metadata.0.uid,null) + # The unique in time and space value for this job. More info: http://kubernetes.io/docs/user-guide/identifiers#uids + + } + + spec_job_template_spec_template_spec = { + hostname = try(kubernetes_cron_job.instance[app].spec.0.job_template.0.spec.0.template.0.spec.0.hostname,null) + # Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value. + + nodeName = try(kubernetes_cron_job.instance[app].spec.0.job_template.0.spec.0.template.0.spec.0.node_name,null) + # 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. + + serviceAccountName = try(kubernetes_cron_job.instance[app].spec.0.job_template.0.spec.0.template.0.spec.0.service_account_name,null) + # 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. + + } + + spec_job_template_spec_template_spec_container = { + imagePullPolicy = try(kubernetes_cron_job.instance[app].spec.0.job_template.0.spec.0.template.0.spec.0.container.0.image_pull_policy,null) + # 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 + + } + + spec_job_template_spec_template_spec_container_resources_limits = { + cpu = try(kubernetes_cron_job.instance[app].spec.0.job_template.0.spec.0.template.0.spec.0.container.0.resources.0.limits.0.cpu,null) + memory = try(kubernetes_cron_job.instance[app].spec.0.job_template.0.spec.0.template.0.spec.0.container.0.resources.0.limits.0.memory,null) + } + + spec_job_template_spec_template_spec_container_resources_requests = { + cpu = try(kubernetes_cron_job.instance[app].spec.0.job_template.0.spec.0.template.0.spec.0.container.0.resources.0.requests.0.cpu,null) + memory = try(kubernetes_cron_job.instance[app].spec.0.job_template.0.spec.0.template.0.spec.0.container.0.resources.0.requests.0.memory,null) + } + + spec_job_template_spec_template_spec_init_container = { + imagePullPolicy = try(kubernetes_cron_job.instance[app].spec.0.job_template.0.spec.0.template.0.spec.0.init_container.0.image_pull_policy,null) + # 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 + + } + + spec_job_template_spec_template_spec_init_container_resources_limits = { + cpu = try(kubernetes_cron_job.instance[app].spec.0.job_template.0.spec.0.template.0.spec.0.init_container.0.resources.0.limits.0.cpu,null) + memory = try(kubernetes_cron_job.instance[app].spec.0.job_template.0.spec.0.template.0.spec.0.init_container.0.resources.0.limits.0.memory,null) + } + + spec_job_template_spec_template_spec_init_container_resources_requests = { + cpu = try(kubernetes_cron_job.instance[app].spec.0.job_template.0.spec.0.template.0.spec.0.init_container.0.resources.0.requests.0.cpu,null) + memory = try(kubernetes_cron_job.instance[app].spec.0.job_template.0.spec.0.template.0.spec.0.init_container.0.resources.0.requests.0.memory,null) + } + + spec_job_template_spec_template_spec_volume_rbd = { + keyring = try(kubernetes_cron_job.instance[app].spec.0.job_template.0.spec.0.template.0.spec.0.volume.0.rbd.0.keyring,null) + # 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 + + } + + } : null + + daemonset = contains(keys(local.daemonset.applications), app) ? { + metadata = { + generation = try(kubernetes_daemonset.instance[app].metadata.0.generation,null) + # A sequence number representing a specific generation of the desired state. + + name = try(kubernetes_daemonset.instance[app].metadata.0.name,null) + # Name of the daemonset, must be unique. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names + + resourceVersion = try(kubernetes_daemonset.instance[app].metadata.0.resource_version,null) + # An opaque value that represents the internal version of this daemonset that can be used by clients to determine when daemonset has changed. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + + selfLink = try(kubernetes_daemonset.instance[app].metadata.0.self_link,null) + # A URL representing this daemonset. + + uid = try(kubernetes_daemonset.instance[app].metadata.0.uid,null) + # The unique in time and space value for this daemonset. More info: http://kubernetes.io/docs/user-guide/identifiers#uids + + } + + spec_template_metadata = { + generation = try(kubernetes_daemonset.instance[app].spec.0.template.0.metadata.0.generation,null) + # A sequence number representing a specific generation of the desired state. + + name = try(kubernetes_daemonset.instance[app].spec.0.template.0.metadata.0.name,null) + # Name of the daemon set, must be unique. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names + + resourceVersion = try(kubernetes_daemonset.instance[app].spec.0.template.0.metadata.0.resource_version,null) + # An opaque value that represents the internal version of this daemon set that can be used by clients to determine when daemon set has changed. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + + selfLink = try(kubernetes_daemonset.instance[app].spec.0.template.0.metadata.0.self_link,null) + # A URL representing this daemon set. + + uid = try(kubernetes_daemonset.instance[app].spec.0.template.0.metadata.0.uid,null) + # The unique in time and space value for this daemon set. More info: http://kubernetes.io/docs/user-guide/identifiers#uids + + } + + spec_template_spec = { + hostname = try(kubernetes_daemonset.instance[app].spec.0.template.0.spec.0.hostname,null) + # Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value. + + nodeName = try(kubernetes_daemonset.instance[app].spec.0.template.0.spec.0.node_name,null) + # 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. + + serviceAccountName = try(kubernetes_daemonset.instance[app].spec.0.template.0.spec.0.service_account_name,null) + # 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. + + } + + spec_template_spec_container = { + imagePullPolicy = try(kubernetes_daemonset.instance[app].spec.0.template.0.spec.0.container.0.image_pull_policy,null) + # 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 + + } + + spec_template_spec_container_resources_limits = { + cpu = try(kubernetes_daemonset.instance[app].spec.0.template.0.spec.0.container.0.resources.0.limits.0.cpu,null) + memory = try(kubernetes_daemonset.instance[app].spec.0.template.0.spec.0.container.0.resources.0.limits.0.memory,null) + } + + spec_template_spec_container_resources_requests = { + cpu = try(kubernetes_daemonset.instance[app].spec.0.template.0.spec.0.container.0.resources.0.requests.0.cpu,null) + memory = try(kubernetes_daemonset.instance[app].spec.0.template.0.spec.0.container.0.resources.0.requests.0.memory,null) + } + + spec_template_spec_init_container = { + imagePullPolicy = try(kubernetes_daemonset.instance[app].spec.0.template.0.spec.0.init_container.0.image_pull_policy,null) + # 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 + + } + + spec_template_spec_init_container_resources_limits = { + cpu = try(kubernetes_daemonset.instance[app].spec.0.template.0.spec.0.init_container.0.resources.0.limits.0.cpu,null) + memory = try(kubernetes_daemonset.instance[app].spec.0.template.0.spec.0.init_container.0.resources.0.limits.0.memory,null) + } + + spec_template_spec_init_container_resources_requests = { + cpu = try(kubernetes_daemonset.instance[app].spec.0.template.0.spec.0.init_container.0.resources.0.requests.0.cpu,null) + memory = try(kubernetes_daemonset.instance[app].spec.0.template.0.spec.0.init_container.0.resources.0.requests.0.memory,null) + } + + spec_template_spec_volume_rbd = { + keyring = try(kubernetes_daemonset.instance[app].spec.0.template.0.spec.0.volume.0.rbd.0.keyring,null) + # 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 + + } + + } : null + + deployment = contains(keys(local.deployment.applications), app) ? { + metadata = { + generation = try(kubernetes_deployment.instance[app].metadata.0.generation,null) + # A sequence number representing a specific generation of the desired state. + + name = try(kubernetes_deployment.instance[app].metadata.0.name,null) + # Name of the deployment, must be unique. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names + + resourceVersion = try(kubernetes_deployment.instance[app].metadata.0.resource_version,null) + # An opaque value that represents the internal version of this deployment that can be used by clients to determine when deployment has changed. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + + selfLink = try(kubernetes_deployment.instance[app].metadata.0.self_link,null) + # A URL representing this deployment. + + uid = try(kubernetes_deployment.instance[app].metadata.0.uid,null) + # The unique in time and space value for this deployment. More info: http://kubernetes.io/docs/user-guide/identifiers#uids + + } + + spec_template_metadata = { + generation = try(kubernetes_deployment.instance[app].spec.0.template.0.metadata.0.generation,null) + # A sequence number representing a specific generation of the desired state. + + name = try(kubernetes_deployment.instance[app].spec.0.template.0.metadata.0.name,null) + # Name of the pod, must be unique. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names + + resourceVersion = try(kubernetes_deployment.instance[app].spec.0.template.0.metadata.0.resource_version,null) + # 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/sig-architecture/api-conventions.md#concurrency-control-and-consistency + + selfLink = try(kubernetes_deployment.instance[app].spec.0.template.0.metadata.0.self_link,null) + # A URL representing this pod. + + uid = try(kubernetes_deployment.instance[app].spec.0.template.0.metadata.0.uid,null) + # The unique in time and space value for this pod. More info: http://kubernetes.io/docs/user-guide/identifiers#uids + + } + + spec_template_spec = { + hostname = try(kubernetes_deployment.instance[app].spec.0.template.0.spec.0.hostname,null) + # Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value. + + nodeName = try(kubernetes_deployment.instance[app].spec.0.template.0.spec.0.node_name,null) + # 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. + + serviceAccountName = try(kubernetes_deployment.instance[app].spec.0.template.0.spec.0.service_account_name,null) + # 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. + + } + + spec_template_spec_container = { + imagePullPolicy = try(kubernetes_deployment.instance[app].spec.0.template.0.spec.0.container.0.image_pull_policy,null) + # 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 + + } + + spec_template_spec_container_resources_limits = { + cpu = try(kubernetes_deployment.instance[app].spec.0.template.0.spec.0.container.0.resources.0.limits.0.cpu,null) + memory = try(kubernetes_deployment.instance[app].spec.0.template.0.spec.0.container.0.resources.0.limits.0.memory,null) + } + + spec_template_spec_container_resources_requests = { + cpu = try(kubernetes_deployment.instance[app].spec.0.template.0.spec.0.container.0.resources.0.requests.0.cpu,null) + memory = try(kubernetes_deployment.instance[app].spec.0.template.0.spec.0.container.0.resources.0.requests.0.memory,null) + } + + spec_template_spec_init_container = { + imagePullPolicy = try(kubernetes_deployment.instance[app].spec.0.template.0.spec.0.init_container.0.image_pull_policy,null) + # 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 + + } + + spec_template_spec_init_container_resources_limits = { + cpu = try(kubernetes_deployment.instance[app].spec.0.template.0.spec.0.init_container.0.resources.0.limits.0.cpu,null) + memory = try(kubernetes_deployment.instance[app].spec.0.template.0.spec.0.init_container.0.resources.0.limits.0.memory,null) + } + + spec_template_spec_init_container_resources_requests = { + cpu = try(kubernetes_deployment.instance[app].spec.0.template.0.spec.0.init_container.0.resources.0.requests.0.cpu,null) + memory = try(kubernetes_deployment.instance[app].spec.0.template.0.spec.0.init_container.0.resources.0.requests.0.memory,null) + } + + spec_template_spec_volume_rbd = { + keyring = try(kubernetes_deployment.instance[app].spec.0.template.0.spec.0.volume.0.rbd.0.keyring,null) + # 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 + + } + + } : null + + endpoints = contains(keys(local.endpoints.applications), app) ? { + metadata = { + generation = try(kubernetes_endpoints.instance[app].metadata.0.generation,null) + # A sequence number representing a specific generation of the desired state. + + name = try(kubernetes_endpoints.instance[app].metadata.0.name,null) + # Name of the endpoints, must be unique. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names + + resourceVersion = try(kubernetes_endpoints.instance[app].metadata.0.resource_version,null) + # An opaque value that represents the internal version of this endpoints that can be used by clients to determine when endpoints has changed. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + + selfLink = try(kubernetes_endpoints.instance[app].metadata.0.self_link,null) + # A URL representing this endpoints. + + uid = try(kubernetes_endpoints.instance[app].metadata.0.uid,null) + # The unique in time and space value for this endpoints. More info: http://kubernetes.io/docs/user-guide/identifiers#uids + + } + + } : null + + horizontal_pod_autoscaler = contains(keys(local.horizontal_pod_autoscaler.applications), app) ? { + metadata = { + generation = try(kubernetes_horizontal_pod_autoscaler.instance[app].metadata.0.generation,null) + # A sequence number representing a specific generation of the desired state. + + name = try(kubernetes_horizontal_pod_autoscaler.instance[app].metadata.0.name,null) + # Name of the horizontal pod autoscaler, must be unique. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names + + resourceVersion = try(kubernetes_horizontal_pod_autoscaler.instance[app].metadata.0.resource_version,null) + # An opaque value that represents the internal version of this horizontal pod autoscaler that can be used by clients to determine when horizontal pod autoscaler has changed. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + + selfLink = try(kubernetes_horizontal_pod_autoscaler.instance[app].metadata.0.self_link,null) + # A URL representing this horizontal pod autoscaler. + + uid = try(kubernetes_horizontal_pod_autoscaler.instance[app].metadata.0.uid,null) + # The unique in time and space value for this horizontal pod autoscaler. More info: http://kubernetes.io/docs/user-guide/identifiers#uids + + } + + spec = { + targetCpuUtilizationPercentage = try(kubernetes_horizontal_pod_autoscaler.instance[app].spec.0.target_cpu_utilization_percentage,null) + # Target average CPU utilization (represented as a percentage of requested CPU) over all the pods. If not specified the default autoscaling policy will be used. + + } + + } : null + + ingress = contains(keys(local.ingress.applications), app) ? { + loadBalancerIngress = try(kubernetes_ingress.instance[app].load_balancer_ingress,null) + metadata = { + generation = try(kubernetes_ingress.instance[app].metadata.0.generation,null) + # A sequence number representing a specific generation of the desired state. + + name = try(kubernetes_ingress.instance[app].metadata.0.name,null) + # Name of the ingress, must be unique. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names + + resourceVersion = try(kubernetes_ingress.instance[app].metadata.0.resource_version,null) + # An opaque value that represents the internal version of this ingress that can be used by clients to determine when ingress has changed. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + + selfLink = try(kubernetes_ingress.instance[app].metadata.0.self_link,null) + # A URL representing this ingress. + + uid = try(kubernetes_ingress.instance[app].metadata.0.uid,null) + # The unique in time and space value for this ingress. More info: http://kubernetes.io/docs/user-guide/identifiers#uids + + } + + spec_backend = { + servicePort = try(kubernetes_ingress.instance[app].spec.0.backend.0.service_port,null) + # Specifies the port of the referenced service. + + } + + spec_rule_http_path_backend = { + servicePort = try(kubernetes_ingress.instance[app].spec.0.rule.0.http.0.path.0.backend.0.service_port,null) + # Specifies the port of the referenced service. + + } + + } : null + + job = contains(keys(local.job.applications), app) ? { + metadata = { + generation = try(kubernetes_job.instance[app].metadata.0.generation,null) + # A sequence number representing a specific generation of the desired state. + + labels = try(kubernetes_job.instance[app].metadata.0.labels,null) + # Map of string keys and values that can be used to organize and categorize (scope and select) the job. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels + + name = try(kubernetes_job.instance[app].metadata.0.name,null) + # Name of the job, must be unique. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names + + resourceVersion = try(kubernetes_job.instance[app].metadata.0.resource_version,null) + # An opaque value that represents the internal version of this job that can be used by clients to determine when job has changed. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + + selfLink = try(kubernetes_job.instance[app].metadata.0.self_link,null) + # A URL representing this job. + + uid = try(kubernetes_job.instance[app].metadata.0.uid,null) + # The unique in time and space value for this job. More info: http://kubernetes.io/docs/user-guide/identifiers#uids + + } + + spec_template_metadata = { + generation = try(kubernetes_job.instance[app].spec.0.template.0.metadata.0.generation,null) + # A sequence number representing a specific generation of the desired state. + + name = try(kubernetes_job.instance[app].spec.0.template.0.metadata.0.name,null) + # Name of the job, must be unique. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names + + resourceVersion = try(kubernetes_job.instance[app].spec.0.template.0.metadata.0.resource_version,null) + # An opaque value that represents the internal version of this job that can be used by clients to determine when job has changed. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + + selfLink = try(kubernetes_job.instance[app].spec.0.template.0.metadata.0.self_link,null) + # A URL representing this job. + + uid = try(kubernetes_job.instance[app].spec.0.template.0.metadata.0.uid,null) + # The unique in time and space value for this job. More info: http://kubernetes.io/docs/user-guide/identifiers#uids + + } + + spec_template_spec = { + hostname = try(kubernetes_job.instance[app].spec.0.template.0.spec.0.hostname,null) + # Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value. + + nodeName = try(kubernetes_job.instance[app].spec.0.template.0.spec.0.node_name,null) + # 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. + + serviceAccountName = try(kubernetes_job.instance[app].spec.0.template.0.spec.0.service_account_name,null) + # 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. + + } + + spec_template_spec_container = { + imagePullPolicy = try(kubernetes_job.instance[app].spec.0.template.0.spec.0.container.0.image_pull_policy,null) + # 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 + + } + + spec_template_spec_container_resources_limits = { + cpu = try(kubernetes_job.instance[app].spec.0.template.0.spec.0.container.0.resources.0.limits.0.cpu,null) + memory = try(kubernetes_job.instance[app].spec.0.template.0.spec.0.container.0.resources.0.limits.0.memory,null) + } + + spec_template_spec_container_resources_requests = { + cpu = try(kubernetes_job.instance[app].spec.0.template.0.spec.0.container.0.resources.0.requests.0.cpu,null) + memory = try(kubernetes_job.instance[app].spec.0.template.0.spec.0.container.0.resources.0.requests.0.memory,null) + } + + spec_template_spec_init_container = { + imagePullPolicy = try(kubernetes_job.instance[app].spec.0.template.0.spec.0.init_container.0.image_pull_policy,null) + # 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 + + } + + spec_template_spec_init_container_resources_limits = { + cpu = try(kubernetes_job.instance[app].spec.0.template.0.spec.0.init_container.0.resources.0.limits.0.cpu,null) + memory = try(kubernetes_job.instance[app].spec.0.template.0.spec.0.init_container.0.resources.0.limits.0.memory,null) + } + + spec_template_spec_init_container_resources_requests = { + cpu = try(kubernetes_job.instance[app].spec.0.template.0.spec.0.init_container.0.resources.0.requests.0.cpu,null) + memory = try(kubernetes_job.instance[app].spec.0.template.0.spec.0.init_container.0.resources.0.requests.0.memory,null) + } + + spec_template_spec_volume_rbd = { + keyring = try(kubernetes_job.instance[app].spec.0.template.0.spec.0.volume.0.rbd.0.keyring,null) + # 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 + + } + + } : null + + limit_range = contains(keys(local.limit_range.applications), app) ? { + metadata = { + generation = try(kubernetes_limit_range.instance[app].metadata.0.generation,null) + # A sequence number representing a specific generation of the desired state. + + name = try(kubernetes_limit_range.instance[app].metadata.0.name,null) + # Name of the limit range, must be unique. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names + + resourceVersion = try(kubernetes_limit_range.instance[app].metadata.0.resource_version,null) + # An opaque value that represents the internal version of this limit range that can be used by clients to determine when limit range has changed. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + + selfLink = try(kubernetes_limit_range.instance[app].metadata.0.self_link,null) + # A URL representing this limit range. + + uid = try(kubernetes_limit_range.instance[app].metadata.0.uid,null) + # The unique in time and space value for this limit range. More info: http://kubernetes.io/docs/user-guide/identifiers#uids + + } + + spec_limit = { + defaultRequest = try(kubernetes_limit_range.instance[app].spec.0.limit.0.default_request,null) + # The default resource requirement request value by resource name if resource request is omitted. + + } + + } : null + + namespace = contains(keys(local.namespace.applications), app) ? { + metadata = { + generation = try(kubernetes_namespace.instance[app].metadata.0.generation,null) + # A sequence number representing a specific generation of the desired state. + + name = try(kubernetes_namespace.instance[app].metadata.0.name,null) + # Name of the namespace, must be unique. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names + + resourceVersion = try(kubernetes_namespace.instance[app].metadata.0.resource_version,null) + # An opaque value that represents the internal version of this namespace that can be used by clients to determine when namespace has changed. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + + selfLink = try(kubernetes_namespace.instance[app].metadata.0.self_link,null) + # A URL representing this namespace. + + uid = try(kubernetes_namespace.instance[app].metadata.0.uid,null) + # The unique in time and space value for this namespace. More info: http://kubernetes.io/docs/user-guide/identifiers#uids + + } + + } : null + + network_policy = contains(keys(local.network_policy.applications), app) ? { + metadata = { + generation = try(kubernetes_network_policy.instance[app].metadata.0.generation,null) + # A sequence number representing a specific generation of the desired state. + + name = try(kubernetes_network_policy.instance[app].metadata.0.name,null) + # Name of the network policy, must be unique. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names + + resourceVersion = try(kubernetes_network_policy.instance[app].metadata.0.resource_version,null) + # An opaque value that represents the internal version of this network policy that can be used by clients to determine when network policy has changed. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + + selfLink = try(kubernetes_network_policy.instance[app].metadata.0.self_link,null) + # A URL representing this network policy. + + uid = try(kubernetes_network_policy.instance[app].metadata.0.uid,null) + # The unique in time and space value for this network policy. More info: http://kubernetes.io/docs/user-guide/identifiers#uids + + } + + } : null + + persistent_volume = contains(keys(local.persistent_volume.applications), app) ? { + metadata = { + generation = try(kubernetes_persistent_volume.instance[app].metadata.0.generation,null) + # A sequence number representing a specific generation of the desired state. + + name = try(kubernetes_persistent_volume.instance[app].metadata.0.name,null) + # Name of the persistent volume, must be unique. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names + + resourceVersion = try(kubernetes_persistent_volume.instance[app].metadata.0.resource_version,null) + # An opaque value that represents the internal version of this persistent volume that can be used by clients to determine when persistent volume has changed. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + + selfLink = try(kubernetes_persistent_volume.instance[app].metadata.0.self_link,null) + # A URL representing this persistent volume. + + uid = try(kubernetes_persistent_volume.instance[app].metadata.0.uid,null) + # The unique in time and space value for this persistent volume. More info: http://kubernetes.io/docs/user-guide/identifiers#uids + + } + + spec_persistent_volume_source_rbd = { + keyring = try(kubernetes_persistent_volume.instance[app].spec.0.persistent_volume_source.0.rbd.0.keyring,null) + # 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 + + } + + } : null + + persistent_volume_claim = contains(keys(local.persistent_volume_claim.applications), app) ? { + metadata = { + generation = try(kubernetes_persistent_volume_claim.instance[app].metadata.0.generation,null) + # A sequence number representing a specific generation of the desired state. + + name = try(kubernetes_persistent_volume_claim.instance[app].metadata.0.name,null) + # Name of the persistent volume claim, must be unique. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names + + resourceVersion = try(kubernetes_persistent_volume_claim.instance[app].metadata.0.resource_version,null) + # An opaque value that represents the internal version of this persistent volume claim that can be used by clients to determine when persistent volume claim has changed. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + + selfLink = try(kubernetes_persistent_volume_claim.instance[app].metadata.0.self_link,null) + # A URL representing this persistent volume claim. + + uid = try(kubernetes_persistent_volume_claim.instance[app].metadata.0.uid,null) + # The unique in time and space value for this persistent volume claim. More info: http://kubernetes.io/docs/user-guide/identifiers#uids + + } + + spec = { + storageClassName = try(kubernetes_persistent_volume_claim.instance[app].spec.0.storage_class_name,null) + # Name of the storage class requested by the claim + + volumeName = try(kubernetes_persistent_volume_claim.instance[app].spec.0.volume_name,null) + # The binding reference to the PersistentVolume backing this claim. + + } + + } : null + + pod = contains(keys(local.pod.applications), app) ? { + metadata = { + generation = try(kubernetes_pod.instance[app].metadata.0.generation,null) + # A sequence number representing a specific generation of the desired state. + + name = try(kubernetes_pod.instance[app].metadata.0.name,null) + # Name of the pod, must be unique. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names + + resourceVersion = try(kubernetes_pod.instance[app].metadata.0.resource_version,null) + # 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/sig-architecture/api-conventions.md#concurrency-control-and-consistency + + selfLink = try(kubernetes_pod.instance[app].metadata.0.self_link,null) + # A URL representing this pod. + + uid = try(kubernetes_pod.instance[app].metadata.0.uid,null) + # The unique in time and space value for this pod. More info: http://kubernetes.io/docs/user-guide/identifiers#uids + + } + + spec = { + hostname = try(kubernetes_pod.instance[app].spec.0.hostname,null) + # Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value. + + nodeName = try(kubernetes_pod.instance[app].spec.0.node_name,null) + # 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. + + serviceAccountName = try(kubernetes_pod.instance[app].spec.0.service_account_name,null) + # 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. + + } + + spec_container = { + imagePullPolicy = try(kubernetes_pod.instance[app].spec.0.container.0.image_pull_policy,null) + # 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 + + } + + spec_container_resources_limits = { + cpu = try(kubernetes_pod.instance[app].spec.0.container.0.resources.0.limits.0.cpu,null) + memory = try(kubernetes_pod.instance[app].spec.0.container.0.resources.0.limits.0.memory,null) + } + + spec_container_resources_requests = { + cpu = try(kubernetes_pod.instance[app].spec.0.container.0.resources.0.requests.0.cpu,null) + memory = try(kubernetes_pod.instance[app].spec.0.container.0.resources.0.requests.0.memory,null) + } + + spec_init_container = { + imagePullPolicy = try(kubernetes_pod.instance[app].spec.0.init_container.0.image_pull_policy,null) + # 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 + + } + + spec_init_container_resources_limits = { + cpu = try(kubernetes_pod.instance[app].spec.0.init_container.0.resources.0.limits.0.cpu,null) + memory = try(kubernetes_pod.instance[app].spec.0.init_container.0.resources.0.limits.0.memory,null) + } + + spec_init_container_resources_requests = { + cpu = try(kubernetes_pod.instance[app].spec.0.init_container.0.resources.0.requests.0.cpu,null) + memory = try(kubernetes_pod.instance[app].spec.0.init_container.0.resources.0.requests.0.memory,null) + } + + spec_volume_rbd = { + keyring = try(kubernetes_pod.instance[app].spec.0.volume.0.rbd.0.keyring,null) + # 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 + + } + + } : null + + pod_disruption_budget = contains(keys(local.pod_disruption_budget.applications), app) ? { + metadata = { + generation = try(kubernetes_pod_disruption_budget.instance[app].metadata.0.generation,null) + # A sequence number representing a specific generation of the desired state. + + name = try(kubernetes_pod_disruption_budget.instance[app].metadata.0.name,null) + # Name of the pod disruption budget, must be unique. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names + + resourceVersion = try(kubernetes_pod_disruption_budget.instance[app].metadata.0.resource_version,null) + # An opaque value that represents the internal version of this pod disruption budget that can be used by clients to determine when pod disruption budget has changed. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + + selfLink = try(kubernetes_pod_disruption_budget.instance[app].metadata.0.self_link,null) + # A URL representing this pod disruption budget. + + uid = try(kubernetes_pod_disruption_budget.instance[app].metadata.0.uid,null) + # The unique in time and space value for this pod disruption budget. More info: http://kubernetes.io/docs/user-guide/identifiers#uids + + } + + } : null + + priority_class = contains(keys(local.priority_class.applications), app) ? { + metadata = { + generation = try(kubernetes_priority_class.instance[app].metadata.0.generation,null) + # A sequence number representing a specific generation of the desired state. + + name = try(kubernetes_priority_class.instance[app].metadata.0.name,null) + # Name of the priority class, must be unique. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names + + resourceVersion = try(kubernetes_priority_class.instance[app].metadata.0.resource_version,null) + # An opaque value that represents the internal version of this priority class that can be used by clients to determine when priority class has changed. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + + selfLink = try(kubernetes_priority_class.instance[app].metadata.0.self_link,null) + # A URL representing this priority class. + + uid = try(kubernetes_priority_class.instance[app].metadata.0.uid,null) + # The unique in time and space value for this priority class. More info: http://kubernetes.io/docs/user-guide/identifiers#uids + + } + + } : null + + replication_controller = contains(keys(local.replication_controller.applications), app) ? { + metadata = { + generation = try(kubernetes_replication_controller.instance[app].metadata.0.generation,null) + # A sequence number representing a specific generation of the desired state. + + name = try(kubernetes_replication_controller.instance[app].metadata.0.name,null) + # Name of the replication controller, must be unique. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names + + resourceVersion = try(kubernetes_replication_controller.instance[app].metadata.0.resource_version,null) + # An opaque value that represents the internal version of this replication controller that can be used by clients to determine when replication controller has changed. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + + selfLink = try(kubernetes_replication_controller.instance[app].metadata.0.self_link,null) + # A URL representing this replication controller. + + uid = try(kubernetes_replication_controller.instance[app].metadata.0.uid,null) + # The unique in time and space value for this replication controller. More info: http://kubernetes.io/docs/user-guide/identifiers#uids + + } + + spec_template = { + activeDeadlineSeconds = try(kubernetes_replication_controller.instance[app].spec.0.template.0.active_deadline_seconds,null) + # 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. + + dnsPolicy = try(kubernetes_replication_controller.instance[app].spec.0.template.0.dns_policy,null) + # Set DNS policy for containers within the pod. Valid values are 'ClusterFirstWithHostNet', 'ClusterFirst', 'Default' or 'None'. DNS parameters given in DNSConfig will be merged with the policy selected with DNSPolicy. To have DNS options set along with hostNetwork, you have to specify DNS policy explicitly to 'ClusterFirstWithHostNet'. Optional: Defaults to 'ClusterFirst', see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-policy). + + hostIpc = try(kubernetes_replication_controller.instance[app].spec.0.template.0.host_ipc,null) + # Use the host's ipc namespace. Optional: Defaults to false. + + hostNetwork = try(kubernetes_replication_controller.instance[app].spec.0.template.0.host_network,null) + # 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. + + hostPid = try(kubernetes_replication_controller.instance[app].spec.0.template.0.host_pid,null) + # Use the host's pid namespace. + + hostname = try(kubernetes_replication_controller.instance[app].spec.0.template.0.hostname,null) + # Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value. + + nodeName = try(kubernetes_replication_controller.instance[app].spec.0.template.0.node_name,null) + # 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. + + nodeSelector = try(kubernetes_replication_controller.instance[app].spec.0.template.0.node_selector,null) + # 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. + + priorityClassName = try(kubernetes_replication_controller.instance[app].spec.0.template.0.priority_class_name,null) + # If specified, indicates the pod's priority. "system-node-critical" and "system-cluster-critical" are two special keywords which indicate the highest priorities with the former being the highest priority. Any other name must be defined by creating a PriorityClass object with that name. If not specified, the pod priority will be default or zero if there is no default. + + restartPolicy = try(kubernetes_replication_controller.instance[app].spec.0.template.0.restart_policy,null) + # Restart policy for all containers within the pod. One of Always, OnFailure, Never. More info: http://kubernetes.io/docs/user-guide/pod-states#restartpolicy. + + serviceAccountName = try(kubernetes_replication_controller.instance[app].spec.0.template.0.service_account_name,null) + # 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. + + subdomain = try(kubernetes_replication_controller.instance[app].spec.0.template.0.subdomain,null) + # If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will not have a domainname at all.. + + terminationGracePeriodSeconds = try(kubernetes_replication_controller.instance[app].spec.0.template.0.termination_grace_period_seconds,null) + # 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. + + } + + spec_template_container = { + imagePullPolicy = try(kubernetes_replication_controller.instance[app].spec.0.template.0.container.0.image_pull_policy,null) + # 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 + + } + + spec_template_container_resources_limits = { + cpu = try(kubernetes_replication_controller.instance[app].spec.0.template.0.container.0.resources.0.limits.0.cpu,null) + memory = try(kubernetes_replication_controller.instance[app].spec.0.template.0.container.0.resources.0.limits.0.memory,null) + } + + spec_template_container_resources_requests = { + cpu = try(kubernetes_replication_controller.instance[app].spec.0.template.0.container.0.resources.0.requests.0.cpu,null) + memory = try(kubernetes_replication_controller.instance[app].spec.0.template.0.container.0.resources.0.requests.0.memory,null) + } + + spec_template_init_container = { + imagePullPolicy = try(kubernetes_replication_controller.instance[app].spec.0.template.0.init_container.0.image_pull_policy,null) + # 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 + + } + + spec_template_init_container_resources_limits = { + cpu = try(kubernetes_replication_controller.instance[app].spec.0.template.0.init_container.0.resources.0.limits.0.cpu,null) + memory = try(kubernetes_replication_controller.instance[app].spec.0.template.0.init_container.0.resources.0.limits.0.memory,null) + } + + spec_template_init_container_resources_requests = { + cpu = try(kubernetes_replication_controller.instance[app].spec.0.template.0.init_container.0.resources.0.requests.0.cpu,null) + memory = try(kubernetes_replication_controller.instance[app].spec.0.template.0.init_container.0.resources.0.requests.0.memory,null) + } + + spec_template_metadata = { + generation = try(kubernetes_replication_controller.instance[app].spec.0.template.0.metadata.0.generation,null) + # A sequence number representing a specific generation of the desired state. + + name = try(kubernetes_replication_controller.instance[app].spec.0.template.0.metadata.0.name,null) + # Name of the replication controller's template, must be unique. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names + + resourceVersion = try(kubernetes_replication_controller.instance[app].spec.0.template.0.metadata.0.resource_version,null) + # An opaque value that represents the internal version of this replication controller's template that can be used by clients to determine when replication controller's template has changed. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + + selfLink = try(kubernetes_replication_controller.instance[app].spec.0.template.0.metadata.0.self_link,null) + # A URL representing this replication controller's template. + + uid = try(kubernetes_replication_controller.instance[app].spec.0.template.0.metadata.0.uid,null) + # The unique in time and space value for this replication controller's template. More info: http://kubernetes.io/docs/user-guide/identifiers#uids + + } + + spec_template_spec = { + activeDeadlineSeconds = try(kubernetes_replication_controller.instance[app].spec.0.template.0.spec.0.active_deadline_seconds,null) + # 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. + + dnsPolicy = try(kubernetes_replication_controller.instance[app].spec.0.template.0.spec.0.dns_policy,null) + # Set DNS policy for containers within the pod. Valid values are 'ClusterFirstWithHostNet', 'ClusterFirst', 'Default' or 'None'. DNS parameters given in DNSConfig will be merged with the policy selected with DNSPolicy. To have DNS options set along with hostNetwork, you have to specify DNS policy explicitly to 'ClusterFirstWithHostNet'. Optional: Defaults to 'ClusterFirst', see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-policy). + + hostIpc = try(kubernetes_replication_controller.instance[app].spec.0.template.0.spec.0.host_ipc,null) + # Use the host's ipc namespace. Optional: Defaults to false. + + hostNetwork = try(kubernetes_replication_controller.instance[app].spec.0.template.0.spec.0.host_network,null) + # 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. + + hostPid = try(kubernetes_replication_controller.instance[app].spec.0.template.0.spec.0.host_pid,null) + # Use the host's pid namespace. + + hostname = try(kubernetes_replication_controller.instance[app].spec.0.template.0.spec.0.hostname,null) + # Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value. + + nodeName = try(kubernetes_replication_controller.instance[app].spec.0.template.0.spec.0.node_name,null) + # 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. + + nodeSelector = try(kubernetes_replication_controller.instance[app].spec.0.template.0.spec.0.node_selector,null) + # 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. + + priorityClassName = try(kubernetes_replication_controller.instance[app].spec.0.template.0.spec.0.priority_class_name,null) + # If specified, indicates the pod's priority. "system-node-critical" and "system-cluster-critical" are two special keywords which indicate the highest priorities with the former being the highest priority. Any other name must be defined by creating a PriorityClass object with that name. If not specified, the pod priority will be default or zero if there is no default. + + restartPolicy = try(kubernetes_replication_controller.instance[app].spec.0.template.0.spec.0.restart_policy,null) + # Restart policy for all containers within the pod. One of Always, OnFailure, Never. More info: http://kubernetes.io/docs/user-guide/pod-states#restartpolicy. + + serviceAccountName = try(kubernetes_replication_controller.instance[app].spec.0.template.0.spec.0.service_account_name,null) + # 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. + + subdomain = try(kubernetes_replication_controller.instance[app].spec.0.template.0.spec.0.subdomain,null) + # If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will not have a domainname at all.. + + terminationGracePeriodSeconds = try(kubernetes_replication_controller.instance[app].spec.0.template.0.spec.0.termination_grace_period_seconds,null) + # 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. + + } + + spec_template_spec_container = { + imagePullPolicy = try(kubernetes_replication_controller.instance[app].spec.0.template.0.spec.0.container.0.image_pull_policy,null) + # 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 + + } + + spec_template_spec_container_resources_limits = { + cpu = try(kubernetes_replication_controller.instance[app].spec.0.template.0.spec.0.container.0.resources.0.limits.0.cpu,null) + memory = try(kubernetes_replication_controller.instance[app].spec.0.template.0.spec.0.container.0.resources.0.limits.0.memory,null) + } + + spec_template_spec_container_resources_requests = { + cpu = try(kubernetes_replication_controller.instance[app].spec.0.template.0.spec.0.container.0.resources.0.requests.0.cpu,null) + memory = try(kubernetes_replication_controller.instance[app].spec.0.template.0.spec.0.container.0.resources.0.requests.0.memory,null) + } + + spec_template_spec_init_container = { + imagePullPolicy = try(kubernetes_replication_controller.instance[app].spec.0.template.0.spec.0.init_container.0.image_pull_policy,null) + # 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 + + } + + spec_template_spec_init_container_resources_limits = { + cpu = try(kubernetes_replication_controller.instance[app].spec.0.template.0.spec.0.init_container.0.resources.0.limits.0.cpu,null) + memory = try(kubernetes_replication_controller.instance[app].spec.0.template.0.spec.0.init_container.0.resources.0.limits.0.memory,null) + } + + spec_template_spec_init_container_resources_requests = { + cpu = try(kubernetes_replication_controller.instance[app].spec.0.template.0.spec.0.init_container.0.resources.0.requests.0.cpu,null) + memory = try(kubernetes_replication_controller.instance[app].spec.0.template.0.spec.0.init_container.0.resources.0.requests.0.memory,null) + } + + spec_template_spec_volume_rbd = { + keyring = try(kubernetes_replication_controller.instance[app].spec.0.template.0.spec.0.volume.0.rbd.0.keyring,null) + # 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 + + } + + spec_template_volume_rbd = { + keyring = try(kubernetes_replication_controller.instance[app].spec.0.template.0.volume.0.rbd.0.keyring,null) + # 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 + + } + + } : null + + resource_quota = contains(keys(local.resource_quota.applications), app) ? { + metadata = { + generation = try(kubernetes_resource_quota.instance[app].metadata.0.generation,null) + # A sequence number representing a specific generation of the desired state. + + name = try(kubernetes_resource_quota.instance[app].metadata.0.name,null) + # Name of the resource quota, must be unique. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names + + resourceVersion = try(kubernetes_resource_quota.instance[app].metadata.0.resource_version,null) + # An opaque value that represents the internal version of this resource quota that can be used by clients to determine when resource quota has changed. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + + selfLink = try(kubernetes_resource_quota.instance[app].metadata.0.self_link,null) + # A URL representing this resource quota. + + uid = try(kubernetes_resource_quota.instance[app].metadata.0.uid,null) + # The unique in time and space value for this resource quota. More info: http://kubernetes.io/docs/user-guide/identifiers#uids + + } + + } : null + + role = contains(keys(local.role.applications), app) ? { + metadata = { + generation = try(kubernetes_role.instance[app].metadata.0.generation,null) + # A sequence number representing a specific generation of the desired state. + + name = try(kubernetes_role.instance[app].metadata.0.name,null) + # Name of the role, must be unique. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names + + resourceVersion = try(kubernetes_role.instance[app].metadata.0.resource_version,null) + # An opaque value that represents the internal version of this role that can be used by clients to determine when role has changed. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + + selfLink = try(kubernetes_role.instance[app].metadata.0.self_link,null) + # A URL representing this role. + + uid = try(kubernetes_role.instance[app].metadata.0.uid,null) + # The unique in time and space value for this role. More info: http://kubernetes.io/docs/user-guide/identifiers#uids + + } + + } : null + + role_binding = contains(keys(local.role_binding.applications), app) ? { + metadata = { + generation = try(kubernetes_role_binding.instance[app].metadata.0.generation,null) + # A sequence number representing a specific generation of the desired state. + + name = try(kubernetes_role_binding.instance[app].metadata.0.name,null) + # Name of the roleBinding, must be unique. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names + + resourceVersion = try(kubernetes_role_binding.instance[app].metadata.0.resource_version,null) + # An opaque value that represents the internal version of this roleBinding that can be used by clients to determine when roleBinding has changed. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + + selfLink = try(kubernetes_role_binding.instance[app].metadata.0.self_link,null) + # A URL representing this roleBinding. + + uid = try(kubernetes_role_binding.instance[app].metadata.0.uid,null) + # The unique in time and space value for this roleBinding. More info: http://kubernetes.io/docs/user-guide/identifiers#uids + + } + + subject = { + apiGroup = try(kubernetes_role_binding.instance[app].subject.0.api_group,null) + # The API group of the subject resource. + + } + + } : null + + secret = contains(keys(local.secret.applications), app) ? { + metadata = { + generation = try(kubernetes_secret.instance[app].metadata.0.generation,null) + # A sequence number representing a specific generation of the desired state. + + name = try(kubernetes_secret.instance[app].metadata.0.name,null) + # Name of the secret, must be unique. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names + + resourceVersion = try(kubernetes_secret.instance[app].metadata.0.resource_version,null) + # An opaque value that represents the internal version of this secret that can be used by clients to determine when secret has changed. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + + selfLink = try(kubernetes_secret.instance[app].metadata.0.self_link,null) + # A URL representing this secret. + + uid = try(kubernetes_secret.instance[app].metadata.0.uid,null) + # The unique in time and space value for this secret. More info: http://kubernetes.io/docs/user-guide/identifiers#uids + + } + + } : null + + service = contains(keys(local.service.applications), app) ? { + loadBalancerIngress = try(kubernetes_service.instance[app].load_balancer_ingress,null) + metadata = { + generation = try(kubernetes_service.instance[app].metadata.0.generation,null) + # A sequence number representing a specific generation of the desired state. + + name = try(kubernetes_service.instance[app].metadata.0.name,null) + # Name of the service, must be unique. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names + + resourceVersion = try(kubernetes_service.instance[app].metadata.0.resource_version,null) + # An opaque value that represents the internal version of this service that can be used by clients to determine when service has changed. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + + selfLink = try(kubernetes_service.instance[app].metadata.0.self_link,null) + # A URL representing this service. + + uid = try(kubernetes_service.instance[app].metadata.0.uid,null) + # The unique in time and space value for this service. More info: http://kubernetes.io/docs/user-guide/identifiers#uids + + } + + spec = { + clusterIp = try(kubernetes_service.instance[app].spec.0.cluster_ip,null) + # The IP address of the service. It is usually assigned randomly by the master. If an address is specified manually and is not in use by others, it will be allocated to the service; otherwise, creation of the service will fail. `None` can be specified for headless services when proxying is not required. Ignored if type is `ExternalName`. More info: http://kubernetes.io/docs/user-guide/services#virtual-ips-and-service-proxies + + externalTrafficPolicy = try(kubernetes_service.instance[app].spec.0.external_traffic_policy,null) + # Denotes if this Service desires to route external traffic to node-local or cluster-wide endpoints. `Local` preserves the client source IP and avoids a second hop for LoadBalancer and Nodeport type services, but risks potentially imbalanced traffic spreading. `Cluster` obscures the client source IP and may cause a second hop to another node, but should have good overall load-spreading. More info: https://kubernetes.io/docs/tutorials/services/source-ip/ + + } + + spec_port = { + nodePort = try(kubernetes_service.instance[app].spec.0.port.0.node_port,null) + # The port on each node on which this service is exposed when `type` is `NodePort` or `LoadBalancer`. Usually assigned by the system. If specified, it will be allocated to the service if unused or else creation of the service will fail. Default is to auto-allocate a port if the `type` of this service requires one. More info: http://kubernetes.io/docs/user-guide/services#type--nodeport + + targetPort = try(kubernetes_service.instance[app].spec.0.port.0.target_port,null) + # Number or name of the port to access on the pods targeted by the service. Number must be in the range 1 to 65535. This field is ignored for services with `cluster_ip = "None"`. More info: http://kubernetes.io/docs/user-guide/services#defining-a-service + + } + + } : null + + service_account = contains(keys(local.service_account.applications), app) ? { + defaultSecretName = try(kubernetes_service_account.instance[app].default_secret_name,null) + metadata = { + generation = try(kubernetes_service_account.instance[app].metadata.0.generation,null) + # A sequence number representing a specific generation of the desired state. + + name = try(kubernetes_service_account.instance[app].metadata.0.name,null) + # Name of the service account, must be unique. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names + + resourceVersion = try(kubernetes_service_account.instance[app].metadata.0.resource_version,null) + # An opaque value that represents the internal version of this service account that can be used by clients to determine when service account has changed. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + + selfLink = try(kubernetes_service_account.instance[app].metadata.0.self_link,null) + # A URL representing this service account. + + uid = try(kubernetes_service_account.instance[app].metadata.0.uid,null) + # The unique in time and space value for this service account. More info: http://kubernetes.io/docs/user-guide/identifiers#uids + + } + + } : null + + stateful_set = contains(keys(local.stateful_set.applications), app) ? { + metadata = { + generation = try(kubernetes_stateful_set.instance[app].metadata.0.generation,null) + # A sequence number representing a specific generation of the desired state. + + name = try(kubernetes_stateful_set.instance[app].metadata.0.name,null) + # Name of the stateful set, must be unique. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names + + resourceVersion = try(kubernetes_stateful_set.instance[app].metadata.0.resource_version,null) + # An opaque value that represents the internal version of this stateful set that can be used by clients to determine when stateful set has changed. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + + selfLink = try(kubernetes_stateful_set.instance[app].metadata.0.self_link,null) + # A URL representing this stateful set. + + uid = try(kubernetes_stateful_set.instance[app].metadata.0.uid,null) + # The unique in time and space value for this stateful set. More info: http://kubernetes.io/docs/user-guide/identifiers#uids + + } + + spec = { + podManagementPolicy = try(kubernetes_stateful_set.instance[app].spec.0.pod_management_policy,null) + # Controls how pods are created during initial scale up, when replacing pods on nodes, or when scaling down. + + revisionHistoryLimit = try(kubernetes_stateful_set.instance[app].spec.0.revision_history_limit,null) + # The maximum number of revisions that will be maintained in the StatefulSet's revision history. The default value is 10. + + } + + spec_template_metadata = { + generation = try(kubernetes_stateful_set.instance[app].spec.0.template.0.metadata.0.generation,null) + # A sequence number representing a specific generation of the desired state. + + name = try(kubernetes_stateful_set.instance[app].spec.0.template.0.metadata.0.name,null) + # Name of the stateful set, must be unique. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names + + resourceVersion = try(kubernetes_stateful_set.instance[app].spec.0.template.0.metadata.0.resource_version,null) + # An opaque value that represents the internal version of this stateful set that can be used by clients to determine when stateful set has changed. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + + selfLink = try(kubernetes_stateful_set.instance[app].spec.0.template.0.metadata.0.self_link,null) + # A URL representing this stateful set. + + uid = try(kubernetes_stateful_set.instance[app].spec.0.template.0.metadata.0.uid,null) + # The unique in time and space value for this stateful set. More info: http://kubernetes.io/docs/user-guide/identifiers#uids + + } + + spec_template_spec = { + hostname = try(kubernetes_stateful_set.instance[app].spec.0.template.0.spec.0.hostname,null) + # Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value. + + nodeName = try(kubernetes_stateful_set.instance[app].spec.0.template.0.spec.0.node_name,null) + # 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. + + serviceAccountName = try(kubernetes_stateful_set.instance[app].spec.0.template.0.spec.0.service_account_name,null) + # 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. + + } + + spec_template_spec_container = { + imagePullPolicy = try(kubernetes_stateful_set.instance[app].spec.0.template.0.spec.0.container.0.image_pull_policy,null) + # 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 + + } + + spec_template_spec_container_resources_limits = { + cpu = try(kubernetes_stateful_set.instance[app].spec.0.template.0.spec.0.container.0.resources.0.limits.0.cpu,null) + memory = try(kubernetes_stateful_set.instance[app].spec.0.template.0.spec.0.container.0.resources.0.limits.0.memory,null) + } + + spec_template_spec_container_resources_requests = { + cpu = try(kubernetes_stateful_set.instance[app].spec.0.template.0.spec.0.container.0.resources.0.requests.0.cpu,null) + memory = try(kubernetes_stateful_set.instance[app].spec.0.template.0.spec.0.container.0.resources.0.requests.0.memory,null) + } + + spec_template_spec_init_container = { + imagePullPolicy = try(kubernetes_stateful_set.instance[app].spec.0.template.0.spec.0.init_container.0.image_pull_policy,null) + # 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 + + } + + spec_template_spec_init_container_resources_limits = { + cpu = try(kubernetes_stateful_set.instance[app].spec.0.template.0.spec.0.init_container.0.resources.0.limits.0.cpu,null) + memory = try(kubernetes_stateful_set.instance[app].spec.0.template.0.spec.0.init_container.0.resources.0.limits.0.memory,null) + } + + spec_template_spec_init_container_resources_requests = { + cpu = try(kubernetes_stateful_set.instance[app].spec.0.template.0.spec.0.init_container.0.resources.0.requests.0.cpu,null) + memory = try(kubernetes_stateful_set.instance[app].spec.0.template.0.spec.0.init_container.0.resources.0.requests.0.memory,null) + } + + spec_template_spec_volume_rbd = { + keyring = try(kubernetes_stateful_set.instance[app].spec.0.template.0.spec.0.volume.0.rbd.0.keyring,null) + # 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 + + } + + spec_volume_claim_template_metadata = { + generation = try(kubernetes_stateful_set.instance[app].spec.0.volume_claim_template.0.metadata.0.generation,null) + # A sequence number representing a specific generation of the desired state. + + name = try(kubernetes_stateful_set.instance[app].spec.0.volume_claim_template.0.metadata.0.name,null) + # Name of the persistent volume claim, must be unique. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names + + resourceVersion = try(kubernetes_stateful_set.instance[app].spec.0.volume_claim_template.0.metadata.0.resource_version,null) + # An opaque value that represents the internal version of this persistent volume claim that can be used by clients to determine when persistent volume claim has changed. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + + selfLink = try(kubernetes_stateful_set.instance[app].spec.0.volume_claim_template.0.metadata.0.self_link,null) + # A URL representing this persistent volume claim. + + uid = try(kubernetes_stateful_set.instance[app].spec.0.volume_claim_template.0.metadata.0.uid,null) + # The unique in time and space value for this persistent volume claim. More info: http://kubernetes.io/docs/user-guide/identifiers#uids + + } + + spec_volume_claim_template_spec = { + storageClassName = try(kubernetes_stateful_set.instance[app].spec.0.volume_claim_template.0.spec.0.storage_class_name,null) + # Name of the storage class requested by the claim + + volumeName = try(kubernetes_stateful_set.instance[app].spec.0.volume_claim_template.0.spec.0.volume_name,null) + # The binding reference to the PersistentVolume backing this claim. + + } + + } : null + + storage_class = contains(keys(local.storage_class.applications), app) ? { + metadata = { + generation = try(kubernetes_storage_class.instance[app].metadata.0.generation,null) + # A sequence number representing a specific generation of the desired state. + + name = try(kubernetes_storage_class.instance[app].metadata.0.name,null) + # Name of the storage class, must be unique. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names + + resourceVersion = try(kubernetes_storage_class.instance[app].metadata.0.resource_version,null) + # An opaque value that represents the internal version of this storage class that can be used by clients to determine when storage class has changed. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + + selfLink = try(kubernetes_storage_class.instance[app].metadata.0.self_link,null) + # A URL representing this storage class. + + uid = try(kubernetes_storage_class.instance[app].metadata.0.uid,null) + # The unique in time and space value for this storage class. More info: http://kubernetes.io/docs/user-guide/identifiers#uids + + } + + } : null + + } + } +}