Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add table gcp_kubernetes_node_pool. Closes #207 #214

Merged
merged 21 commits into from
Aug 26, 2021
Merged

Conversation

rajeshbal65
Copy link
Contributor

Integration test logs

Logs
No env file present for the current environment:  staging
 Falling back to .env config
No env file present for the current environment:  staging
customEnv TURBOT_TEST_EXPECTED_TIMEOUT undefined

SETUP: tests/gcp_kubernetes_node_pool []

PRETEST: tests/gcp_kubernetes_node_pool

TEST: tests/gcp_kubernetes_node_pool
Running terraform
google_service_account.default: Creating...
google_compute_network.named_test_resource: Creating...
google_service_account.default: Creation complete after 6s [id=projects/parker-aaa/serviceAccounts/service-account-id@parker-aaa.iam.gserviceaccount.com]
google_compute_network.named_test_resource: Still creating... [10s elapsed]
google_compute_network.named_test_resource: Still creating... [20s elapsed]
google_compute_network.named_test_resource: Still creating... [30s elapsed]
google_compute_network.named_test_resource: Still creating... [40s elapsed]
google_compute_network.named_test_resource: Still creating... [50s elapsed]
google_compute_network.named_test_resource: Creation complete after 58s [id=projects/parker-aaa/global/networks/turbottest15311]
google_container_cluster.named_test_resource: Creating...
google_container_cluster.named_test_resource: Still creating... [10s elapsed]
google_container_cluster.named_test_resource: Still creating... [20s elapsed]
google_container_cluster.named_test_resource: Still creating... [30s elapsed]
google_container_cluster.named_test_resource: Still creating... [40s elapsed]
google_container_cluster.named_test_resource: Still creating... [50s elapsed]
google_container_cluster.named_test_resource: Still creating... [1m0s elapsed]
google_container_cluster.named_test_resource: Still creating... [1m10s elapsed]
google_container_cluster.named_test_resource: Still creating... [1m20s elapsed]
google_container_cluster.named_test_resource: Still creating... [1m30s elapsed]
google_container_cluster.named_test_resource: Still creating... [1m40s elapsed]
google_container_cluster.named_test_resource: Still creating... [1m50s elapsed]
google_container_cluster.named_test_resource: Still creating... [2m0s elapsed]
google_container_cluster.named_test_resource: Still creating... [2m10s elapsed]
google_container_cluster.named_test_resource: Still creating... [2m20s elapsed]
google_container_cluster.named_test_resource: Still creating... [2m30s elapsed]
google_container_cluster.named_test_resource: Still creating... [2m40s elapsed]
google_container_cluster.named_test_resource: Still creating... [2m50s elapsed]
google_container_cluster.named_test_resource: Still creating... [3m0s elapsed]
google_container_cluster.named_test_resource: Still creating... [3m10s elapsed]
google_container_cluster.named_test_resource: Still creating... [3m20s elapsed]
google_container_cluster.named_test_resource: Still creating... [3m30s elapsed]
google_container_cluster.named_test_resource: Still creating... [3m40s elapsed]
google_container_cluster.named_test_resource: Still creating... [3m50s elapsed]
google_container_cluster.named_test_resource: Still creating... [4m0s elapsed]
google_container_cluster.named_test_resource: Still creating... [4m10s elapsed]
google_container_cluster.named_test_resource: Still creating... [4m20s elapsed]
google_container_cluster.named_test_resource: Still creating... [4m30s elapsed]
google_container_cluster.named_test_resource: Still creating... [4m40s elapsed]
google_container_cluster.named_test_resource: Still creating... [4m50s elapsed]
google_container_cluster.named_test_resource: Creation complete after 5m0s [id=projects/parker-aaa/locations/us-east1/clusters/turbottest15311]
google_container_node_pool.named_test_resource: Creating...
google_container_node_pool.named_test_resource: Still creating... [10s elapsed]
google_container_node_pool.named_test_resource: Still creating... [20s elapsed]
google_container_node_pool.named_test_resource: Still creating... [30s elapsed]
google_container_node_pool.named_test_resource: Still creating... [40s elapsed]
google_container_node_pool.named_test_resource: Still creating... [50s elapsed]
google_container_node_pool.named_test_resource: Still creating... [1m0s elapsed]
google_container_node_pool.named_test_resource: Still creating... [1m10s elapsed]
google_container_node_pool.named_test_resource: Still creating... [1m20s elapsed]
google_container_node_pool.named_test_resource: Creation complete after 1m28s [id=projects/parker-aaa/locations/us-east1/clusters/turbottest15311/nodePools/turbottest15311]

Warning: Deprecated Resource

The null_data_source was historically used to construct intermediate values to
re-use elsewhere in configuration, the same can now be achieved using locals


Apply complete! Resources: 4 added, 0 changed, 0 destroyed.

Outputs:

cluster_name = "turbottest15311"
location = "us-east1"
project_id = "parker-aaa"
resource_aka = "gcp://container.googleapis.com/v1/projects/parker-aaa/locations/us-east1/clusters/turbottest15311/nodePools/turbottest15311"
resource_id = "projects/parker-aaa/locations/us-east1/clusters/turbottest15311/nodePools/turbottest15311"
resource_name = "turbottest15311"

Running SQL query: test-get-query.sql
[
  {
    "akas": [
      "gcp://container.googleapis.com/v1/projects/parker-aaa/locations/us-east1/clusters/turbottest15311/nodePools/turbottest15311"
    ],
    "cluster_name": "turbottest15311",
    "location": "us-east1",
    "name": "turbottest15311",
    "project": "parker-aaa"
  }
]
✔ PASSED

Running SQL query: test-invalid-name-query.sql
null
✔ PASSED

Running SQL query: test-list-query.sql
[
  {
    "akas": [
      "gcp://container.googleapis.com/v1/projects/parker-aaa/locations/us-east1/clusters/turbottest15311/nodePools/turbottest15311"
    ],
    "cluster_name": "turbottest15311",
    "location": "us-east1",
    "name": "turbottest15311",
    "project": "parker-aaa"
  }
]
✔ PASSED

Running SQL query: test-not-found-query.sql
null
✔ PASSED

Running SQL query: test-turbot-query.sql
[
  {
    "akas": [
      "gcp://container.googleapis.com/v1/projects/parker-aaa/locations/us-east1/clusters/turbottest15311/nodePools/turbottest15311"
    ],
    "location": "us-east1",
    "project": "parker-aaa",
    "title": "turbottest15311"
  }
]
✔ PASSED

POSTTEST: tests/gcp_kubernetes_node_pool

TEARDOWN: tests/gcp_kubernetes_node_pool

SUMMARY:

1/1 passed.

Example query results

Results
### Basic info

```sql
select
  name,
  cluster_name,
  initial_node_count,
  version,
  status,
  location
from
  gcp_kubernetes_node_pool;

+--------------+-----------------------+--------------------+-----------------+---------+------------+
| name         | cluster_name          | initial_node_count | version         | status  | location   |
+--------------+-----------------------+--------------------+-----------------+---------+------------+
| default-pool | test-region-cluster-1 | 3                  | 1.19.9-gke.1400 | RUNNING | us-east1   |
| default-pool | test-zone-cluster-1   | 3                  | 1.19.9-gke.1400 | RUNNING | us-east1-b |
+--------------+-----------------------+--------------------+-----------------+---------+------------+
select
  name,
  cluster_name,
  config ->> 'diskSizeGb' as disk_size_gb,
  config ->> 'diskType' as disk_type,
  config ->> 'imageType' as image_type,
  config ->> 'machineType' as machine_type,
  config -> 'metadata' ->> 'disable-legacy-endpoints' as disable_legacy_endpoints,
  config ->> 'serviceAccount' as machine_type,
  config -> 'shieldedInstanceConfig' ->> 'enableIntegrityMonitoring' as enable_integrity_monitoring
from
  gcp_kubernetes_node_pool;

+--------------+-----------------------+--------------+-------------+----------------+---------------+--------------------------+--------------+-----------------------------+
| name         | cluster_name          | disk_size_gb | disk_type   | image_type     | machine_type  | disable_legacy_endpoints | machine_type | enable_integrity_monitoring |
+--------------+-----------------------+--------------+-------------+----------------+---------------+--------------------------+--------------+-----------------------------+
| default-pool | test-region-cluster-1 | 100          | pd-standard | COS_CONTAINERD | e2-medium     | true                     | default      | true                        |
| default-pool | test-zone-cluster-1   | 10           | pd-standard | COS_CONTAINERD | custom-1-1024 | true                     | default      | <null>                      |
+--------------+-----------------------+--------------+-------------+----------------+---------------+--------------------------+--------------+-----------------------------+

List maximum pods for each node

select
  name,
  cluster_name,
  max_pods_constraint ->> 'maxPodsPerNode' as max_mods_per_node
from
  gcp_kubernetes_node_pool;

--------------+-----------------------+-------------------+
| name         | cluster_name          | max_mods_per_node |
+--------------+-----------------------+-------------------+
| default-pool | test-zone-cluster-1   | 110               |
| default-pool | test-region-cluster-1 | 110               |
+--------------+-----------------------+-------------------+
</details>

@rajeshbal65 rajeshbal65 self-assigned this May 21, 2021
@rajeshbal65 rajeshbal65 linked an issue May 21, 2021 that may be closed by this pull request
gcp/service.go Outdated Show resolved Hide resolved
gcp_kubernetes_node_pool;
```


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rajeshbal65 Can we add an example to filter the ZONAL node pools?

Copy link
Contributor

@Subhajit97 Subhajit97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rajeshbal65 Please see comments, thanks!

@bigdatasourav bigdatasourav assigned ParthaI and unassigned rajeshbal65 Aug 24, 2021
Copy link

@rajlearner17 rajlearner17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bigdatasourav bigdatasourav merged commit 123dfdd into main Aug 26, 2021
@bigdatasourav bigdatasourav deleted the issue-207 branch August 26, 2021 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add table gcp_kubernetes_node_pool
6 participants