Skip to content

Commit 95724f4

Browse files
Jordan-Williams2Jordan-Williams2
authored andcommitted
fix: tests
1 parent 3481045 commit 95724f4

File tree

10 files changed

+79
-54
lines changed

10 files changed

+79
-54
lines changed

README.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,6 @@ provider "helm" {
4040
token = data.ibm_container_cluster_config.cluster_config.token
4141
cluster_ca_certificate = data.ibm_container_cluster_config.cluster_config.ca_certificate
4242
}
43-
# IBM Cloud credentials are required to authenticate to the helm repo
44-
registry {
45-
url = "oci://icr.io/ibm/observe/logs-agent-helm"
46-
username = "iamapikey"
47-
password = "XXXXXXXXXXXXXXXXX" # replace with an IBM cloud apikey # pragma: allowlist secret
48-
}
4943
}
5044
5145
# ############################################################################
@@ -94,7 +88,7 @@ No modules.
9488
| <a name="input_agent_additional_metadata"></a> [agent\_additional\_metadata](#input\_agent\_additional\_metadata) | The list of additional metadata fields to add to the routed logs. | <pre>list(object({<br/> key = optional(string)<br/> value = optional(string)<br/> }))</pre> | `[]` | no |
9589
| <a name="input_agent_iam_api_key"></a> [agent\_iam\_api\_key](#input\_agent\_iam\_api\_key) | The IBM Cloud API key for the Logs agent to authenticate and communicate with the IBM Cloud Logs. | `string` | n/a | yes |
9690
| <a name="input_agent_name"></a> [agent\_name](#input\_agent\_name) | The name of the Logs agent. The name is used in all Kubernetes and Helm resources in the cluster. | `string` | `"logs-agent"` | no |
97-
| <a name="input_agent_namespace"></a> [agent\_namespace](#input\_agent\_namespace) | The namespace where the Logs agent is deployed. The default value is `ibm-agent`. | `string` | `"ibm-agent"` | no |
91+
| <a name="input_agent_namespace"></a> [agent\_namespace](#input\_agent\_namespace) | The namespace where the Logs agent is deployed. The default value is `ibm-agent`. | `string` | `"ibm-observe"` | no |
9892
| <a name="input_agent_resources"></a> [agent\_resources](#input\_agent\_resources) | The resources configuration for cpu/memory/storage. [Learn More](https://cloud.ibm.com/docs/cloud-logs?topic=cloud-logs-agent-helm-template-clusters#agent-helm-template-clusters-chart-options-resources) | <pre>object({<br/> limits = object({<br/> cpu = string<br/> memory = string<br/> })<br/> requests = object({<br/> cpu = string<br/> memory = string<br/> })<br/> })</pre> | <pre>{<br/> "limits": {<br/> "cpu": "500m",<br/> "memory": "3Gi"<br/> },<br/> "requests": {<br/> "cpu": "100m",<br/> "memory": "1Gi"<br/> }<br/>}</pre> | no |
9993
| <a name="input_agent_tolerations"></a> [agent\_tolerations](#input\_agent\_tolerations) | List of tolerations to apply to Logs agent. The default value means a pod will run on every node. | <pre>list(object({<br/> key = optional(string)<br/> operator = optional(string)<br/> value = optional(string)<br/> effect = optional(string)<br/> tolerationSeconds = optional(number)<br/> }))</pre> | <pre>[<br/> {<br/> "operator": "Exists"<br/> }<br/>]</pre> | no |
10094
| <a name="input_chart_location"></a> [chart\_location](#input\_chart\_location) | The location of the Helm chart for the Sysdig agent. | `string` | `"sysdig-deploy"` | no |
@@ -105,7 +99,7 @@ No modules.
10599
| <a name="input_cluster_id"></a> [cluster\_id](#input\_cluster\_id) | The ID of the cluster to deploy the agent. | `string` | n/a | yes |
106100
| <a name="input_cluster_resource_group_id"></a> [cluster\_resource\_group\_id](#input\_cluster\_resource\_group\_id) | The resource group ID of the cluster. | `string` | n/a | yes |
107101
| <a name="input_is_vpc_cluster"></a> [is\_vpc\_cluster](#input\_is\_vpc\_cluster) | Specify true if the target cluster for the agent is a VPC cluster, false if it is a classic cluster. | `bool` | `true` | no |
108-
| <a name="input_node_analyzer_enabled"></a> [node\_analyzer\_enabled](#input\_node\_analyzer\_enabled) | Enable or disable the Node Analyzer feature in the Sysdig agent. | `bool` | `true` | no |
102+
| <a name="input_node_analyzer_enabled"></a> [node\_analyzer\_enabled](#input\_node\_analyzer\_enabled) | Enable or disable the Node Analyzer feature in the Sysdig agent. | `bool` | `false` | no |
109103
| <a name="input_wait_till"></a> [wait\_till](#input\_wait\_till) | To avoid long wait times when you run your Terraform code, you can specify the stage when you want Terraform to mark the cluster resource creation as completed. Depending on what stage you choose, the cluster creation might not be fully completed and continues to run in the background. However, your Terraform code can continue to run without waiting for the cluster to be fully created. Supported args are `MasterNodeReady`, `OneWorkerNodeReady`, `IngressReady` and `Normal` | `string` | `"Normal"` | no |
110104
| <a name="input_wait_till_timeout"></a> [wait\_till\_timeout](#input\_wait\_till\_timeout) | Timeout for wait\_till in minutes. | `number` | `90` | no |
111105

examples/logs-agent-iks/provider.tf

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@ provider "helm" {
99
token = data.ibm_container_cluster_config.cluster_config.token
1010
cluster_ca_certificate = data.ibm_container_cluster_config.cluster_config.ca_certificate
1111
}
12-
# IBM Cloud credentials are required to authenticate to the helm repo
13-
registry {
14-
url = "oci://icr.io/ibm/observe/logs-agent-helm"
15-
username = "iamapikey"
16-
password = var.ibmcloud_api_key
17-
}
1812
}
1913

2014
provider "kubernetes" {

examples/logs-agent-ocp/provider.tf

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@ provider "helm" {
99
token = data.ibm_container_cluster_config.cluster_config.token
1010
cluster_ca_certificate = data.ibm_container_cluster_config.cluster_config.ca_certificate
1111
}
12-
# IBM Cloud credentials are required to authenticate to the helm repo
13-
registry {
14-
url = "oci://icr.io/ibm/observe/logs-agent-helm"
15-
username = "iamapikey"
16-
password = var.ibmcloud_api_key
17-
}
1812
}
1913

2014
provider "kubernetes" {

kubeconfig/.gitignore

Lines changed: 0 additions & 6 deletions
This file was deleted.

kubeconfig/README.md

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
This directory must exist in source control so the `ibm_container_cluster_config` data lookup can use it to place the
2-
config.yml used to connect to a kubernetes cluster.
2+
config.yml used to connect to a kubernetes cluster (See https://github.ibm.com/GoldenEye/issues/issues/552).

solutions/fully-configurable/provider.tf

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,6 @@ provider "helm" {
1313
token = data.ibm_container_cluster_config.cluster_config.token
1414
cluster_ca_certificate = data.ibm_container_cluster_config.cluster_config.ca_certificate
1515
}
16-
# IBM Cloud credentials are required to authenticate to the helm repo
17-
registry {
18-
url = "oci://icr.io/ibm/observe/logs-agent-helm"
19-
username = "iamapikey"
20-
password = var.ibmcloud_api_key
21-
}
2216
}
2317

2418
# Retrieve information about an existing VPC cluster

solutions/fully-configurable/variables.tf

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ variable "chart_version" {
7070
variable "node_analyzer_enabled" {
7171
description = "Enable or disable the Node Analyzer feature in the Sysdig agent."
7272
type = bool
73-
default = true # Set the default value as needed
73+
default = false
7474
}
7575

7676
variable "agent_name" {
@@ -83,7 +83,7 @@ variable "agent_name" {
8383
variable "agent_namespace" {
8484
type = string
8585
description = "The namespace where the Logs agent is deployed. The default value is `ibm-agent`."
86-
default = "ibm-agent"
86+
default = "ibm-observe"
8787
nullable = false
8888
}
8989

@@ -143,5 +143,4 @@ variable "agent_additional_metadata" {
143143
variable "cloud_logs_ingress_endpoint" {
144144
description = "The host for IBM Cloud Logs ingestion. Ensure you use the ingress endpoint. See https://cloud.ibm.com/docs/cloud-logs?topic=cloud-logs-endpoints_ingress."
145145
type = string
146-
default = "7c6d96d2-b0c6-4164-96ce-3a1fd142a853.ingress.eu-de.logs.cloud.ibm.com"
147146
}

tests/resources/main.tf

Lines changed: 72 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,79 @@ module "resource_group" {
1010
existing_resource_group_name = var.resource_group
1111
}
1212

13-
##############################################################################
14-
# SLZ ROKS Pattern
15-
##############################################################################
13+
########################################################################################################################
14+
# VPC + Subnet + Public Gateway
15+
#
16+
# NOTE: This is a very simple VPC with single subnet in a single zone with a public gateway enabled, that will allow
17+
# all traffic ingress/egress by default.
18+
# For production use cases this would need to be enhanced by adding more subnets and zones for resiliency, and
19+
# ACLs/Security Groups for network security.
20+
########################################################################################################################
21+
22+
resource "ibm_is_vpc" "vpc" {
23+
name = "${var.prefix}-vpc"
24+
resource_group = module.resource_group.resource_group_id
25+
address_prefix_management = "auto"
26+
tags = var.resource_tags
27+
}
28+
29+
resource "ibm_is_public_gateway" "gateway" {
30+
name = "${var.prefix}-gateway-1"
31+
vpc = ibm_is_vpc.vpc.id
32+
resource_group = module.resource_group.resource_group_id
33+
zone = "${var.region}-1"
34+
}
35+
36+
resource "ibm_is_subnet" "subnet_zone_1" {
37+
name = "${var.prefix}-subnet-1"
38+
vpc = ibm_is_vpc.vpc.id
39+
resource_group = module.resource_group.resource_group_id
40+
zone = "${var.region}-1"
41+
total_ipv4_address_count = 256
42+
public_gateway = ibm_is_public_gateway.gateway.id
43+
}
44+
45+
########################################################################################################################
46+
# OCP VPC cluster (single zone)
47+
########################################################################################################################
48+
49+
locals {
50+
cluster_vpc_subnets = {
51+
default = [
52+
{
53+
id = ibm_is_subnet.subnet_zone_1.id
54+
cidr_block = ibm_is_subnet.subnet_zone_1.ipv4_cidr_block
55+
zone = ibm_is_subnet.subnet_zone_1.zone
56+
}
57+
]
58+
}
59+
60+
worker_pools = [
61+
{
62+
subnet_prefix = "default"
63+
pool_name = "default" # ibm_container_vpc_cluster automatically names default pool "default" (See https://github.com/IBM-Cloud/terraform-provider-ibm/issues/2849)
64+
machine_type = "bx2.4x16"
65+
workers_per_zone = 2 # minimum of 2 is allowed when using single zone
66+
operating_system = "REDHAT_8_64"
67+
}
68+
]
69+
}
1670

17-
module "landing_zone" {
18-
source = "git::https://github.com/terraform-ibm-modules/terraform-ibm-landing-zone//patterns//roks//module?ref=v7.3.0"
71+
module "ocp_base" {
72+
source = "terraform-ibm-modules/base-ocp-vpc/ibm"
73+
version = "3.43.0"
74+
resource_group_id = module.resource_group.resource_group_id
1975
region = var.region
20-
prefix = var.prefix
2176
tags = var.resource_tags
22-
add_atracker_route = false
23-
enable_transit_gateway = false
24-
cluster_force_delete_storage = true
25-
verify_cluster_network_readiness = false
26-
use_ibm_cloud_private_api_endpoints = false
27-
ignore_vpcs_for_cluster_deployment = ["management"]
77+
cluster_name = var.prefix
78+
force_delete_storage = true
79+
vpc_id = ibm_is_vpc.vpc.id
80+
vpc_subnets = local.cluster_vpc_subnets
81+
ocp_version = null
82+
worker_pools = local.worker_pools
83+
access_tags = []
84+
ocp_entitlement = null
85+
disable_outbound_traffic_protection = true # set as True to enable outbound traffic; required for accessing Operator Hub in the OpenShift console.
2886
}
2987

3088
##############################################################################
@@ -79,8 +137,8 @@ module "buckets" {
79137
##############################################################################
80138

81139
locals {
82-
cluster_resource_group_id = module.landing_zone.cluster_data["${var.prefix}-workload-cluster"].resource_group_id
83-
cluster_crn = module.landing_zone.cluster_data["${var.prefix}-workload-cluster"].crn
140+
cluster_resource_group_id = module.resource_group.resource_group_id
141+
cluster_crn = module.ocp_base.crn
84142
}
85143

86144
module "cloud_logs" {

variables.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ variable "chart_version" {
7878
variable "node_analyzer_enabled" {
7979
description = "Enable or disable the Node Analyzer feature in the Sysdig agent."
8080
type = bool
81-
default = true # Set the default value as needed
81+
default = false # Set the default value as needed
8282
}
8383

8484
variable "agent_name" {
@@ -91,7 +91,7 @@ variable "agent_name" {
9191
variable "agent_namespace" {
9292
type = string
9393
description = "The namespace where the Logs agent is deployed. The default value is `ibm-agent`."
94-
default = "ibm-agent"
94+
default = "ibm-observe"
9595
nullable = false
9696
}
9797

0 commit comments

Comments
 (0)