Skip to content

Commit

Permalink
Merge pull request #3 from aidanmelen/output-server-manifest
Browse files Browse the repository at this point in the history
Output Verbose Objects from Kubernetes Server
  • Loading branch information
aidanmelen authored Aug 1, 2022
2 parents fd68579 + ead1df1 commit 848ef08
Show file tree
Hide file tree
Showing 27 changed files with 22,566 additions and 19,138 deletions.
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ clean Clean project
| Name | Type |
|------|------|
| [kubernetes_manifest.components](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/manifest) | resource |
| [kubernetes_resource.components](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/data-sources/resource) | data source |
## Inputs

| Name | Description | Type | Default | Required |
Expand All @@ -150,7 +151,7 @@ clean Clean project
| <a name="input_create_zookeeper"></a> [create\_zookeeper](#input\_create\_zookeeper) | Controls if the Zookeeper component of the Confluent Platform should be created. | `bool` | `true` | no |
| <a name="input_delete_timeout"></a> [delete\_timeout](#input\_delete\_timeout) | The delete timeout for each Conlfuent Platform component. | `string` | `"10m"` | no |
| <a name="input_kafka"></a> [kafka](#input\_kafka) | The Kafka override values. | `any` | `{}` | no |
| <a name="input_kafka_topics"></a> [kafka\_topics](#input\_kafka\_topics) | The Kafka Topics to create. | `any` | `[]` | no |
| <a name="input_kafka_topics"></a> [kafka\_topics](#input\_kafka\_topics) | The Kafka Topics to create. | `any` | `{}` | no |
| <a name="input_kafkarestproxy"></a> [kafkarestproxy](#input\_kafkarestproxy) | The KafkaRestProxy override values. | `any` | `{}` | no |
| <a name="input_ksqldb"></a> [ksqldb](#input\_ksqldb) | The KsqlDB override values. | `any` | `{}` | no |
| <a name="input_namespace"></a> [namespace](#input\_namespace) | The namespace to release Confluent Platform into. When `confluent_operator` is specified, this will also ensure the Confluent Operator is released into the same namespace. | `string` | `"confluent"` | no |
Expand All @@ -163,15 +164,24 @@ clean Clean project
|------|-------------|
| <a name="output_confluent_operator"></a> [confluent\_operator](#output\_confluent\_operator) | The Confluent Operator. |
| <a name="output_connect_manifest"></a> [connect\_manifest](#output\_connect\_manifest) | The Connect manifest. |
| <a name="output_connect_object"></a> [connect\_object](#output\_connect\_object) | The Connect object. |
| <a name="output_controlcenter_manifest"></a> [controlcenter\_manifest](#output\_controlcenter\_manifest) | The ControlCenter manifest. |
| <a name="output_controlcenter_object"></a> [controlcenter\_object](#output\_controlcenter\_object) | The ControlCenter object. |
| <a name="output_kafka_manifest"></a> [kafka\_manifest](#output\_kafka\_manifest) | The Kafka manifest. |
| <a name="output_kafka_topics"></a> [kafka\_topics](#output\_kafka\_topics) | The Kafka Topic manifests |
| <a name="output_kafka_object"></a> [kafka\_object](#output\_kafka\_object) | The Kafka object. |
| <a name="output_kafka_topic_manifests"></a> [kafka\_topic\_manifests](#output\_kafka\_topic\_manifests) | Map of attribute maps for all the KafkaTopic manifests created. |
| <a name="output_kafka_topic_objects"></a> [kafka\_topic\_objects](#output\_kafka\_topic\_objects) | Map of attribute maps for all the KafkaTopic objects created. |
| <a name="output_kafka_topics"></a> [kafka\_topics](#output\_kafka\_topics) | Map of attribute maps for all KafkaTopic submodules created. |
| <a name="output_kafkarestproxy_manifest"></a> [kafkarestproxy\_manifest](#output\_kafkarestproxy\_manifest) | The KafkaRestProxy manifest. |
| <a name="output_kafkarestproxy_object"></a> [kafkarestproxy\_object](#output\_kafkarestproxy\_object) | The KafkaRestProxy object. |
| <a name="output_ksqldb_manifest"></a> [ksqldb\_manifest](#output\_ksqldb\_manifest) | The KsqlDB manifest. |
| <a name="output_ksqldb_object"></a> [ksqldb\_object](#output\_ksqldb\_object) | The KsqlDB object. |
| <a name="output_namespace"></a> [namespace](#output\_namespace) | The default namespace for the Confluent Platform. |
| <a name="output_schemaregistry_manifest"></a> [schemaregistry\_manifest](#output\_schemaregistry\_manifest) | The SchemaRegistry manifest. |
| <a name="output_schemaregistry_object"></a> [schemaregistry\_object](#output\_schemaregistry\_object) | The SchemaRegistry object. |
| <a name="output_version"></a> [version](#output\_version) | The default Confluent Platform version. |
| <a name="output_zookeeper_manifest"></a> [zookeeper\_manifest](#output\_zookeeper\_manifest) | The Zookeeper manifest. |
| <a name="output_zookeeper_object"></a> [zookeeper\_object](#output\_zookeeper\_object) | The Zookeeper object. |
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

## License
Expand Down
3 changes: 1 addition & 2 deletions TODO.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
Implement the remaining sub-modules:
Implement the remaining submodules:
- cluster_link
- confluent_cluster_role_binding
- connector
- kafka_topic
- schema

Create examples:
Expand Down
9 changes: 6 additions & 3 deletions examples/complete/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,11 @@ module "confluent_platform" {
| Name | Description |
|------|-------------|
| <a name="output_confluent_operator"></a> [confluent\_operator](#output\_confluent\_operator) | The Confluent Operator. |
| <a name="output_kafka"></a> [kafka](#output\_kafka) | The Kafka CFK manifest. |
| <a name="output_kafka_topics"></a> [kafka\_topics](#output\_kafka\_topics) | The Kafka CFK manifest. |
| <a name="output_kafka_manifest"></a> [kafka\_manifest](#output\_kafka\_manifest) | The Kafka manifest. |
| <a name="output_kafka_object_spec"></a> [kafka\_object\_spec](#output\_kafka\_object\_spec) | The Kafka object spec. |
| <a name="output_kafka_topic_manifests"></a> [kafka\_topic\_manifests](#output\_kafka\_topic\_manifests) | Map of attribute maps for all the KafkaTopic manifests created. |
| <a name="output_kafka_topic_object_specs"></a> [kafka\_topic\_object\_specs](#output\_kafka\_topic\_object\_specs) | Map of attribute maps for all the KafkaTopic object specs created. |
| <a name="output_namespace"></a> [namespace](#output\_namespace) | The namespace for the Confluent Platform. |
| <a name="output_zookeeper"></a> [zookeeper](#output\_zookeeper) | The Zookeeper CFK manifest. |
| <a name="output_zookeeper_manifest"></a> [zookeeper\_manifest](#output\_zookeeper\_manifest) | The Zookeeper manifest. |
| <a name="output_zookeeper_object_spec"></a> [zookeeper\_object\_spec](#output\_zookeeper\_object\_spec) | The Zookeeper object spec. |
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
30 changes: 23 additions & 7 deletions examples/complete/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,36 @@ output "confluent_operator" {
################################################################################
# Confluent Platform
################################################################################
output "zookeeper" {
description = "The Zookeeper CFK manifest."
output "zookeeper_manifest" {
description = "The Zookeeper manifest."
value = module.confluent_platform.zookeeper_manifest
}

output "kafka" {
description = "The Kafka CFK manifest."
output "kafka_manifest" {
description = "The Kafka manifest."
value = module.confluent_platform.kafka_manifest
}

output "zookeeper_object_spec" {
description = "The Zookeeper object spec."
value = module.confluent_platform.zookeeper_object["spec"]
}

output "kafka_object_spec" {
description = "The Kafka object spec."
value = module.confluent_platform.kafka_object["spec"]
}

################################################################################
# Kafka Topics
################################################################################
output "kafka_topics" {
description = "The Kafka CFK manifest."
value = module.confluent_platform.kafka_topics
output "kafka_topic_manifests" {
description = "Map of attribute maps for all the KafkaTopic manifests created."
value = module.confluent_platform.kafka_topic_manifests
}


output "kafka_topic_object_specs" {
description = "Map of attribute maps for all the KafkaTopic object specs created."
value = { for name, kafka_topic in module.confluent_platform.kafka_topic_objects : name => kafka_topic["spec"] }
}
14 changes: 7 additions & 7 deletions examples/confluent_platform/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ module "confluent_platform" {

| Name | Description |
|------|-------------|
| <a name="output_connect"></a> [connect](#output\_connect) | The Connect CFK manifest. |
| <a name="output_controlcenter"></a> [controlcenter](#output\_controlcenter) | The ControlCenter CFK manifest. |
| <a name="output_kafka"></a> [kafka](#output\_kafka) | The Kafka CFK manifest. |
| <a name="output_kafkarestproxy"></a> [kafkarestproxy](#output\_kafkarestproxy) | The KafkaRestProxy CFK manifest. |
| <a name="output_ksqldb"></a> [ksqldb](#output\_ksqldb) | The KsqlDB CFK manifest. |
| <a name="output_connect"></a> [connect](#output\_connect) | The Connect object spec. |
| <a name="output_controlcenter"></a> [controlcenter](#output\_controlcenter) | The ControlCenter object spec. |
| <a name="output_kafka"></a> [kafka](#output\_kafka) | The Kafka object spec. |
| <a name="output_kafkarestproxy"></a> [kafkarestproxy](#output\_kafkarestproxy) | The KafkaRestProxy object spec. |
| <a name="output_ksqldb"></a> [ksqldb](#output\_ksqldb) | The KsqlDB object spec. |
| <a name="output_namespace"></a> [namespace](#output\_namespace) | The namespace for the Confluent Platform. |
| <a name="output_schemaregistry"></a> [schemaregistry](#output\_schemaregistry) | The SchemaRegistry CFK manifest. |
| <a name="output_zookeeper"></a> [zookeeper](#output\_zookeeper) | The Zookeeper CFK manifest. |
| <a name="output_schemaregistry"></a> [schemaregistry](#output\_schemaregistry) | The SchemaRegistry object spec. |
| <a name="output_zookeeper"></a> [zookeeper](#output\_zookeeper) | The Zookeeper object spec. |
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
28 changes: 14 additions & 14 deletions examples/confluent_platform/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,36 @@ output "namespace" {
}

output "zookeeper" {
description = "The Zookeeper CFK manifest."
value = module.confluent_platform.zookeeper_manifest
description = "The Zookeeper object spec."
value = module.confluent_platform.zookeeper_object["spec"]
}

output "kafka" {
description = "The Kafka CFK manifest."
value = module.confluent_platform.kafka_manifest
description = "The Kafka object spec."
value = module.confluent_platform.kafka_object["spec"]
}

output "connect" {
description = "The Connect CFK manifest."
value = module.confluent_platform.connect_manifest
description = "The Connect object spec."
value = module.confluent_platform.connect_object["spec"]
}

output "ksqldb" {
description = "The KsqlDB CFK manifest."
value = module.confluent_platform.ksqldb_manifest
description = "The KsqlDB object spec."
value = module.confluent_platform.ksqldb_object["spec"]
}

output "controlcenter" {
description = "The ControlCenter CFK manifest."
value = module.confluent_platform.controlcenter_manifest
description = "The ControlCenter object spec."
value = module.confluent_platform.controlcenter_object["spec"]
}

output "schemaregistry" {
description = "The SchemaRegistry CFK manifest."
value = module.confluent_platform.schemaregistry_manifest
description = "The SchemaRegistry object spec."
value = module.confluent_platform.schemaregistry_object["spec"]
}

output "kafkarestproxy" {
description = "The KafkaRestProxy CFK manifest."
value = module.confluent_platform.kafkarestproxy_manifest
description = "The KafkaRestProxy object spec."
value = module.confluent_platform.kafkarestproxy_object["spec"]
}
14 changes: 7 additions & 7 deletions examples/confluent_platform_singlenode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,12 +221,12 @@ spec:

| Name | Description |
|------|-------------|
| <a name="output_connect"></a> [connect](#output\_connect) | The Connect CFK manifest. |
| <a name="output_controlcenter"></a> [controlcenter](#output\_controlcenter) | The ControlCenter CFK manifest. |
| <a name="output_kafka"></a> [kafka](#output\_kafka) | The Kafka CFK manifest. |
| <a name="output_kafkarestproxy"></a> [kafkarestproxy](#output\_kafkarestproxy) | The KafkaRestProxy CFK manifest. |
| <a name="output_ksqldb"></a> [ksqldb](#output\_ksqldb) | The KsqlDB CFK manifest. |
| <a name="output_connect"></a> [connect](#output\_connect) | The Connect object spec. |
| <a name="output_controlcenter"></a> [controlcenter](#output\_controlcenter) | The ControlCenter object spec. |
| <a name="output_kafka"></a> [kafka](#output\_kafka) | The Kafka object spec. |
| <a name="output_kafkarestproxy"></a> [kafkarestproxy](#output\_kafkarestproxy) | The KafkaRestProxy object spec. |
| <a name="output_ksqldb"></a> [ksqldb](#output\_ksqldb) | The KsqlDB object spec. |
| <a name="output_namespace"></a> [namespace](#output\_namespace) | The namespace for the Confluent Platform. |
| <a name="output_schemaregistry"></a> [schemaregistry](#output\_schemaregistry) | The SchemaRegistry CFK manifest. |
| <a name="output_zookeeper"></a> [zookeeper](#output\_zookeeper) | The Zookeeper CFK manifest. |
| <a name="output_schemaregistry"></a> [schemaregistry](#output\_schemaregistry) | The SchemaRegistry object spec. |
| <a name="output_zookeeper"></a> [zookeeper](#output\_zookeeper) | The Zookeeper object spec. |
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
28 changes: 14 additions & 14 deletions examples/confluent_platform_singlenode/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,36 @@ output "namespace" {
}

output "zookeeper" {
description = "The Zookeeper CFK manifest."
value = module.confluent_platform_singlenode.zookeeper_manifest
description = "The Zookeeper object spec."
value = module.confluent_platform_singlenode.zookeeper_object["spec"]
}

output "kafka" {
description = "The Kafka CFK manifest."
value = module.confluent_platform_singlenode.kafka_manifest
description = "The Kafka object spec."
value = module.confluent_platform_singlenode.kafka_object["spec"]
}

output "connect" {
description = "The Connect CFK manifest."
value = module.confluent_platform_singlenode.connect_manifest
description = "The Connect object spec."
value = module.confluent_platform_singlenode.connect_object["spec"]
}

output "ksqldb" {
description = "The KsqlDB CFK manifest."
value = module.confluent_platform_singlenode.ksqldb_manifest
description = "The KsqlDB object spec."
value = module.confluent_platform_singlenode.ksqldb_object["spec"]
}

output "controlcenter" {
description = "The ControlCenter CFK manifest."
value = module.confluent_platform_singlenode.controlcenter_manifest
description = "The ControlCenter object spec."
value = module.confluent_platform_singlenode.controlcenter_object["spec"]
}

output "schemaregistry" {
description = "The SchemaRegistry CFK manifest."
value = module.confluent_platform_singlenode.schemaregistry_manifest
description = "The SchemaRegistry object spec."
value = module.confluent_platform_singlenode.schemaregistry_object["spec"]
}

output "kafkarestproxy" {
description = "The KafkaRestProxy CFK manifest."
value = module.confluent_platform_singlenode.kafkarestproxy_manifest
description = "The KafkaRestProxy object spec."
value = module.confluent_platform_singlenode.kafkarestproxy_object["spec"]
}
4 changes: 2 additions & 2 deletions examples/kafka_topics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ spec:

| Name | Description |
|------|-------------|
| <a name="output_kafka_topic_manifest"></a> [kafka\_topic\_manifest](#output\_kafka\_topic\_manifest) | The Kafka Topic manifest. |
| <a name="output_other_kafka_topic_manifest"></a> [other\_kafka\_topic\_manifest](#output\_other\_kafka\_topic\_manifest) | The Kafka Topic manifest. |
| <a name="output_kafka_topic"></a> [kafka\_topic](#output\_kafka\_topic) | The KafkaTopic object spec. |
| <a name="output_other_kafka_topic"></a> [other\_kafka\_topic](#output\_other\_kafka\_topic) | The other KafkaTopic object spec. |
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
12 changes: 6 additions & 6 deletions examples/kafka_topics/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
output "kafka_topic_manifest" {
description = "The Kafka Topic manifest."
value = module.kafka_topic.manifest
output "kafka_topic" {
description = "The KafkaTopic object spec."
value = module.kafka_topic.object["spec"]
}

output "other_kafka_topic_manifest" {
description = "The Kafka Topic manifest."
value = module.other_kafka_topic.manifest
output "other_kafka_topic" {
description = "The other KafkaTopic object spec."
value = module.other_kafka_topic.object["spec"]
}
22 changes: 19 additions & 3 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ module "confluent_operator" {
# Confluent Platform
################################################################################
module "confluent_platform_override_values" {
source = "Invicton-Labs/deepmerge/null"
version = "0.1.5"
depends_on = [module.confluent_operator]
source = "Invicton-Labs/deepmerge/null"
version = "0.1.5"

maps = [
local.default_confluent_platform_values,
Expand All @@ -35,6 +34,8 @@ module "confluent_platform_override_values" {
}

resource "kubernetes_manifest" "components" {
# Terraform will invoke the the Confluent Platform and the Confluent Operator
# will ensure that all the components are created/destroyed in the correct order.
for_each = {
for name, manifest in module.confluent_platform_override_values.merged : name => manifest
if var.create && local.create_confluent_platform[name]
Expand All @@ -57,6 +58,21 @@ resource "kubernetes_manifest" "components" {
}
}

data "kubernetes_resource" "components" {
for_each = {
for name, manifest in module.confluent_platform_override_values.merged : name => manifest
if var.create && local.create_confluent_platform[name]
}

api_version = kubernetes_manifest.components[each.key].manifest.apiVersion
kind = kubernetes_manifest.components[each.key].manifest.kind

metadata {
name = kubernetes_manifest.components[each.key].manifest.metadata.name
namespace = kubernetes_manifest.components[each.key].manifest.metadata.namespace
}
}

################################################################################
# Kafka Topics
################################################################################
Expand Down
2 changes: 1 addition & 1 deletion modules/confluent_operator/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Confluent Operator
# confluent_operator

Deploy the Confluent Operator.

Expand Down
12 changes: 7 additions & 5 deletions modules/kafka_topic/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Confluent Operator
# kafka_topic

Deploy the Confluent Operator.
Deploy a KafkaTopic.

<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

Expand Down Expand Up @@ -49,19 +49,21 @@ spec:
| Name | Type |
|------|------|
| [kubernetes_manifest.topic](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/manifest) | resource |
| [kubernetes_resource.topic](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/data-sources/resource) | data source |
## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_create_timeout"></a> [create\_timeout](#input\_create\_timeout) | The create timeout for each Conlfuent Platform component. | `string` | `"5m"` | no |
| <a name="input_delete_timeout"></a> [delete\_timeout](#input\_delete\_timeout) | The delete timeout for each Conlfuent Platform component. | `string` | `"5m"` | no |
| <a name="input_name"></a> [name](#input\_name) | The Kafka Topic name. | `string` | n/a | yes |
| <a name="input_name"></a> [name](#input\_name) | The KafkaTopic name. | `string` | n/a | yes |
| <a name="input_namespace"></a> [namespace](#input\_namespace) | The namespace of the Confluent Platform. | `string` | `"confluent"` | no |
| <a name="input_update_timeout"></a> [update\_timeout](#input\_update\_timeout) | The update timeout for each Conlfuent Platform component. | `string` | `"5m"` | no |
| <a name="input_values"></a> [values](#input\_values) | The Kafka Topic override values. | `any` | `{}` | no |
| <a name="input_values"></a> [values](#input\_values) | The KafkaTopic override values. | `any` | `{}` | no |
## Outputs

| Name | Description |
|------|-------------|
| <a name="output_manifest"></a> [manifest](#output\_manifest) | The Kafka Topic manifest. |
| <a name="output_manifest"></a> [manifest](#output\_manifest) | The KafkaTopic manifest. |
| <a name="output_object"></a> [object](#output\_object) | The KafkaTopic object. |
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
Loading

0 comments on commit 848ef08

Please sign in to comment.