Skip to content
This repository was archived by the owner on May 21, 2025. It is now read-only.

Commit e25ec7f

Browse files
authored
feat: Support for Log Analysis agents has been fully removed and replaced by the new Logs agent for sending Logs to Cloud Logs (#339)
BREAKING CHANGE: Log Analysis agents support has been removed
1 parent 84e23a9 commit e25ec7f

File tree

8 files changed

+179
-135
lines changed

8 files changed

+179
-135
lines changed

README.md

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
This module is a wrapper module that groups the following modules:
1313
- [base-ocp-vpc-module](https://github.com/terraform-ibm-modules/terraform-ibm-base-ocp-vpc) - Provisions a base (bare) Red Hat OpenShift Container Platform cluster on VPC Gen2 (supports passing Key Protect details to encrypt cluster).
14-
- [observability-agents-module](https://github.com/terraform-ibm-modules/terraform-ibm-observability-agents) - Deploys Log Analysis and Cloud Monitoring agents to a cluster.
14+
- [observability-agents-module](https://github.com/terraform-ibm-modules/terraform-ibm-observability-agents) - Deploys Logs Agent and Cloud Monitoring agents to a cluster.
1515

1616
:exclamation: **Important:** You can't update Red Hat OpenShift cluster nodes by using this module. The Terraform logic ignores updates to prevent possible destructive changes.
1717

@@ -89,6 +89,12 @@ provider "helm" {
8989
host = data.ibm_container_cluster_config.cluster_config.host
9090
token = data.ibm_container_cluster_config.cluster_config.token
9191
}
92+
# IBM Cloud credentials are required to authenticate to the helm repo
93+
registry {
94+
url = "oci://icr.io/ibm/observe/logs-agent-helm"
95+
username = "iamapikey"
96+
password = "XXXXXXXXXXXXXXXXX" # replace with an IBM cloud apikey # pragma: allowlist secret
97+
}
9298
}
9399
94100
provider "kubernetes" {
@@ -119,8 +125,8 @@ module "ocp_all_inclusive" {
119125
}
120126
]
121127
}
122-
log_analysis_instance_name = "my-logdna"
123-
log_analysis_ingestion_key = "xxXXxxXXxXxXXXXxxXxxxXXXXxXXXXX"
128+
cloud_logs_ingress_endpoint = "<cloud-logs-instance-guid>.ingress.us-south.logs.cloud.ibm.com"
129+
cloud_logs_ingress_port = 443
124130
cloud_monitoring_instance_name = "my-sysdig"
125131
cloud_monitoring_access_key = "xxXXxxXXxXxXXXXxxXxxxXXXXxXXXXX"
126132
}
@@ -164,8 +170,9 @@ You need the following permissions to run this module.
164170

165171
| Name | Source | Version |
166172
|------|--------|---------|
167-
| <a name="module_observability_agents"></a> [observability\_agents](#module\_observability\_agents) | terraform-ibm-modules/observability-agents/ibm | 1.29.1 |
173+
| <a name="module_observability_agents"></a> [observability\_agents](#module\_observability\_agents) | terraform-ibm-modules/observability-agents/ibm | 1.30.2 |
168174
| <a name="module_ocp_base"></a> [ocp\_base](#module\_ocp\_base) | terraform-ibm-modules/base-ocp-vpc/ibm | 3.33.0 |
175+
| <a name="module_trusted_profile"></a> [trusted\_profile](#module\_trusted\_profile) | terraform-ibm-modules/trusted-profile/ibm | 1.0.4 |
169176

170177
### Resources
171178

@@ -181,6 +188,8 @@ No resources.
181188
| <a name="input_addons"></a> [addons](#input\_addons) | List of all addons supported by the ocp cluster. | <pre>object({<br/> debug-tool = optional(string)<br/> image-key-synchronizer = optional(string)<br/> openshift-data-foundation = optional(string)<br/> vpc-file-csi-driver = optional(string)<br/> static-route = optional(string)<br/> cluster-autoscaler = optional(string)<br/> vpc-block-csi-driver = optional(string)<br/> })</pre> | `null` | no |
182189
| <a name="input_allow_default_worker_pool_replacement"></a> [allow\_default\_worker\_pool\_replacement](#input\_allow\_default\_worker\_pool\_replacement) | (Advanced users) Set to true to allow the module to recreate a default worker pool. Only use in the case where you are getting an error indicating that the default worker pool cannot be replaced on apply. Once the default worker pool is handled as a stand-alone ibm\_container\_vpc\_worker\_pool, if you wish to make any change to the default worker pool which requires the re-creation of the default pool set this variable to true. | `bool` | `false` | no |
183190
| <a name="input_attach_ibm_managed_security_group"></a> [attach\_ibm\_managed\_security\_group](#input\_attach\_ibm\_managed\_security\_group) | Whether to attach the IBM-defined default security group (named `kube-<clusterid>`) to all worker nodes. Applies only if `custom_security_group_ids` is set. | `bool` | `true` | no |
191+
| <a name="input_cloud_logs_ingress_endpoint"></a> [cloud\_logs\_ingress\_endpoint](#input\_cloud\_logs\_ingress\_endpoint) | The host for IBM Cloud Logs ingestion. It is required if `logs_agent_enabled` is set to `true`. Ensure you use the ingress endpoint. See https://cloud.ibm.com/docs/cloud-logs?topic=cloud-logs-endpoints_ingress. | `string` | `null` | no |
192+
| <a name="input_cloud_logs_ingress_port"></a> [cloud\_logs\_ingress\_port](#input\_cloud\_logs\_ingress\_port) | The target port for the IBM Cloud Logs ingestion endpoint. The port must be 443 if you connect by using a VPE gateway, or port 3443 when you connect by using CSEs. | `number` | `3443` | no |
184193
| <a name="input_cloud_monitoring_access_key"></a> [cloud\_monitoring\_access\_key](#input\_cloud\_monitoring\_access\_key) | Access key for the Cloud Monitoring agent to communicate with the instance. | `string` | `null` | no |
185194
| <a name="input_cloud_monitoring_add_cluster_name"></a> [cloud\_monitoring\_add\_cluster\_name](#input\_cloud\_monitoring\_add\_cluster\_name) | If true, configure the cloud monitoring agent to attach a tag containing the cluster name to all metric data. | `bool` | `true` | no |
186195
| <a name="input_cloud_monitoring_agent_name"></a> [cloud\_monitoring\_agent\_name](#input\_cloud\_monitoring\_agent\_name) | Cloud Monitoring agent name. Used for naming all kubernetes and helm resources on the cluster. | `string` | `"sysdig-agent"` | no |
@@ -210,18 +219,18 @@ No resources.
210219
| <a name="input_kms_account_id"></a> [kms\_account\_id](#input\_kms\_account\_id) | Id of the account that owns the KMS instance to encrypt the cluster. It is only required if the KMS instance is in another account. | `string` | `null` | no |
211220
| <a name="input_kms_use_private_endpoint"></a> [kms\_use\_private\_endpoint](#input\_kms\_use\_private\_endpoint) | Set as true to use the Private endpoint when communicating between cluster and KMS instance. | `bool` | `true` | no |
212221
| <a name="input_kms_wait_for_apply"></a> [kms\_wait\_for\_apply](#input\_kms\_wait\_for\_apply) | Set true to make terraform wait until KMS is applied to master and it is ready and deployed. Default value is true. | `bool` | `true` | no |
213-
| <a name="input_log_analysis_add_cluster_name"></a> [log\_analysis\_add\_cluster\_name](#input\_log\_analysis\_add\_cluster\_name) | If true, configure the log analysis agent to attach a tag containing the cluster name to all log messages. | `bool` | `true` | no |
214-
| <a name="input_log_analysis_agent_custom_line_exclusion"></a> [log\_analysis\_agent\_custom\_line\_exclusion](#input\_log\_analysis\_agent\_custom\_line\_exclusion) | Log Analysis agent custom configuration for line exclusion setting LOGDNA\_K8S\_METADATA\_LINE\_EXCLUSION. See https://github.com/logdna/logdna-agent-v2/blob/master/docs/KUBERNETES.md#configuration-for-kubernetes-metadata-filtering for more info. | `string` | `null` | no |
215-
| <a name="input_log_analysis_agent_custom_line_inclusion"></a> [log\_analysis\_agent\_custom\_line\_inclusion](#input\_log\_analysis\_agent\_custom\_line\_inclusion) | Log Analysis agent custom configuration for line inclusion setting LOGDNA\_K8S\_METADATA\_LINE\_INCLUSION. See https://github.com/logdna/logdna-agent-v2/blob/master/docs/KUBERNETES.md#configuration-for-kubernetes-metadata-filtering for more info. | `string` | `null` | no |
216-
| <a name="input_log_analysis_agent_name"></a> [log\_analysis\_agent\_name](#input\_log\_analysis\_agent\_name) | Log Analysis agent name. Used for naming all kubernetes and helm resources on the cluster. | `string` | `"logdna-agent"` | no |
217-
| <a name="input_log_analysis_agent_namespace"></a> [log\_analysis\_agent\_namespace](#input\_log\_analysis\_agent\_namespace) | Namespace where to deploy the Log Analysis agent. Default value is 'ibm-observe' | `string` | `"ibm-observe"` | no |
218-
| <a name="input_log_analysis_agent_tags"></a> [log\_analysis\_agent\_tags](#input\_log\_analysis\_agent\_tags) | List of tags to associate with the log analysis agents | `list(string)` | `[]` | no |
219-
| <a name="input_log_analysis_agent_tolerations"></a> [log\_analysis\_agent\_tolerations](#input\_log\_analysis\_agent\_tolerations) | List of tolerations to apply to Log Analysis agent. | <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 |
220-
| <a name="input_log_analysis_enabled"></a> [log\_analysis\_enabled](#input\_log\_analysis\_enabled) | Deploy IBM Cloud Logging agent | `bool` | `true` | no |
221-
| <a name="input_log_analysis_endpoint_type"></a> [log\_analysis\_endpoint\_type](#input\_log\_analysis\_endpoint\_type) | Specify the IBM Log Analysis instance endpoint type (public or private) to use. Used to construct the ingestion endpoint. | `string` | `"private"` | no |
222-
| <a name="input_log_analysis_ingestion_key"></a> [log\_analysis\_ingestion\_key](#input\_log\_analysis\_ingestion\_key) | Ingestion key for the Log Analysis agent to communicate with the instance. | `string` | `null` | no |
223-
| <a name="input_log_analysis_instance_region"></a> [log\_analysis\_instance\_region](#input\_log\_analysis\_instance\_region) | The IBM Log Analysis instance region. Used to construct the ingestion endpoint. | `string` | `null` | no |
224-
| <a name="input_log_analysis_secret_name"></a> [log\_analysis\_secret\_name](#input\_log\_analysis\_secret\_name) | The name of the secret which will store the ingestion key. | `string` | `"logdna-agent"` | no |
222+
| <a name="input_logs_agent_additional_log_source_paths"></a> [logs\_agent\_additional\_log\_source\_paths](#input\_logs\_agent\_additional\_log\_source\_paths) | The list of additional log sources. By default, the Logs agent collects logs from a single source at `/var/log/containers/*.log`. | `list(string)` | `[]` | no |
223+
| <a name="input_logs_agent_additional_metadata"></a> [logs\_agent\_additional\_metadata](#input\_logs\_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 |
224+
| <a name="input_logs_agent_enabled"></a> [logs\_agent\_enabled](#input\_logs\_agent\_enabled) | Whether to deploy the Logs agent. | `bool` | `true` | no |
225+
| <a name="input_logs_agent_exclude_log_source_paths"></a> [logs\_agent\_exclude\_log\_source\_paths](#input\_logs\_agent\_exclude\_log\_source\_paths) | The list of log sources to exclude. Specify the paths that the Logs agent ignores. | `list(string)` | `[]` | no |
226+
| <a name="input_logs_agent_iam_api_key"></a> [logs\_agent\_iam\_api\_key](#input\_logs\_agent\_iam\_api\_key) | The IBM Cloud API key for the Logs agent to authenticate and communicate with the IBM Cloud Logs. It is required if `logs_agent_enabled` is true and `logs_agent_iam_mode` is set to `IAMAPIKey`. | `string` | `null` | no |
227+
| <a name="input_logs_agent_iam_environment"></a> [logs\_agent\_iam\_environment](#input\_logs\_agent\_iam\_environment) | IAM authentication Environment: `Production` or `PrivateProduction` or `Staging` or `PrivateStaging`. `Production` specifies the public endpoint & `PrivateProduction` specifies the private endpoint. | `string` | `"PrivateProduction"` | no |
228+
| <a name="input_logs_agent_iam_mode"></a> [logs\_agent\_iam\_mode](#input\_logs\_agent\_iam\_mode) | IAM authentication mode: `TrustedProfile` or `IAMAPIKey`. If `TrustedProfile` is selected, the module will create one. | `string` | `"TrustedProfile"` | no |
229+
| <a name="input_logs_agent_log_source_namespaces"></a> [logs\_agent\_log\_source\_namespaces](#input\_logs\_agent\_log\_source\_namespaces) | The list of namespaces from which logs should be forwarded by agent. If namespaces are not listed, logs from all namespaces will be sent. | `list(string)` | `[]` | no |
230+
| <a name="input_logs_agent_name"></a> [logs\_agent\_name](#input\_logs\_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 |
231+
| <a name="input_logs_agent_namespace"></a> [logs\_agent\_namespace](#input\_logs\_agent\_namespace) | The namespace where the Logs agent is deployed. The default value is `ibm-observe`. | `string` | `"ibm-observe"` | no |
232+
| <a name="input_logs_agent_selected_log_source_paths"></a> [logs\_agent\_selected\_log\_source\_paths](#input\_logs\_agent\_selected\_log\_source\_paths) | The list of specific log sources paths. Logs will only be collected from the specified log source paths. If no paths are specified, it will send logs from `/var/log/containers`. | `list(string)` | `[]` | no |
233+
| <a name="input_logs_agent_tolerations"></a> [logs\_agent\_tolerations](#input\_logs\_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 |
225234
| <a name="input_manage_all_addons"></a> [manage\_all\_addons](#input\_manage\_all\_addons) | Whether Terraform manages all cluster add-ons, even add-ons installed outside of the module. If set to 'true', this module destroys the add-ons installed by other sources. | `bool` | `false` | no |
226235
| <a name="input_number_of_lbs"></a> [number\_of\_lbs](#input\_number\_of\_lbs) | The number of load balancer to associate with the `additional_lb_security_group_names` security group. Must match the number of load balancers that are associated with the cluster | `number` | `1` | no |
227236
| <a name="input_ocp_entitlement"></a> [ocp\_entitlement](#input\_ocp\_entitlement) | Value that is applied to the entitlements for OCP cluster provisioning | `string` | `"cloud_pak"` | no |

examples/end-to-end-example/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ An end-to-end example that will:
66
- Define ACLs to allow inbound and outboud traffic:
77
- from/to Ingress Operator to correctly report cluster ingress status
88
- to the cluster's oAuth server port to enable the Openshift cluster console
9-
- Provision Log Analysis and Cloud Monitoring instances in the given resource group and region.
9+
- Provision Cloud Logs and Cloud Monitoring instances in the given resource group and region.
1010
- Provision a Key Protect instance in the given resource group and region and create a new key ring and key in the instance
1111
- Call the ocp-all-inclusive-module to do the following:
1212
- provision an OCP VPC cluster in the given resource group and region, passing the details of the Key Protect instance and key for cluster encryption
13-
- deploy Log Analysis and Cloud Monitoring agents to the cluster
13+
- deploy Logs Agent and Cloud Monitoring agents to the cluster
1414
- deploy service mesh on the cluster
1515
- install autoscaler addon and configure certain nodepools to have autoscaling enabled.

examples/end-to-end-example/main.tf

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -149,26 +149,20 @@ module "vpc" {
149149
}
150150

151151
##############################################################################
152-
# Observability Instances (Log Analysis + Cloud Monitoring)
152+
# Observability Instances (Cloud Logs + Cloud Monitoring)
153153
##############################################################################
154154

155155
module "observability_instances" {
156-
source = "terraform-ibm-modules/observability-instances/ibm"
157-
version = "2.18.1"
158-
providers = {
159-
logdna.at = logdna.at
160-
logdna.ld = logdna.ld
161-
}
156+
source = "terraform-ibm-modules/observability-instances/ibm"
157+
version = "3.0.1"
162158
region = var.region
163159
resource_group_id = module.resource_group.resource_group_id
164-
activity_tracker_provision = false
165-
log_analysis_instance_name = "${var.prefix}-logdna"
160+
cloud_logs_instance_name = "${var.prefix}-icl"
166161
cloud_monitoring_instance_name = "${var.prefix}-sysdig"
167-
log_analysis_plan = "7-day"
168162
cloud_monitoring_plan = "graduated-tier"
169163
enable_platform_logs = false
170164
enable_platform_metrics = false
171-
log_analysis_tags = var.resource_tags
165+
cloud_logs_tags = var.resource_tags
172166
cloud_monitoring_tags = var.resource_tags
173167
}
174168

@@ -235,12 +229,11 @@ module "ocp_all_inclusive" {
235229
access_tags = var.access_tags
236230
existing_kms_instance_guid = module.key_protect_all_inclusive.kms_guid
237231
existing_kms_root_key_id = module.key_protect_all_inclusive.keys["${local.key_ring_name}.${local.key_name}"].key_id
238-
log_analysis_instance_region = module.observability_instances.region
239-
log_analysis_ingestion_key = module.observability_instances.log_analysis_ingestion_key
232+
cloud_logs_ingress_endpoint = module.observability_instances.cloud_logs_ingress_private_endpoint
233+
cloud_logs_ingress_port = 3443
240234
cloud_monitoring_access_key = module.observability_instances.cloud_monitoring_access_key
241235
cloud_monitoring_instance_region = module.observability_instances.region
242236
addons = local.addons
243237
disable_public_endpoint = var.disable_public_endpoint
244-
log_analysis_agent_tags = var.resource_tags
245238
cloud_monitoring_agent_tags = var.resource_tags
246239
}

examples/end-to-end-example/provider.tf

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,16 @@ provider "helm" {
1717
host = data.ibm_container_cluster_config.cluster_config.host
1818
token = data.ibm_container_cluster_config.cluster_config.token
1919
}
20+
# IBM Cloud credentials are required to authenticate to the helm repo
21+
registry {
22+
url = "oci://icr.io/ibm/observe/logs-agent-helm"
23+
username = "iamapikey"
24+
password = var.ibmcloud_api_key
25+
}
2026
}
2127

2228
# Kubernetes provider used to create kube namespace(s)
2329
provider "kubernetes" {
2430
host = data.ibm_container_cluster_config.cluster_config.host
2531
token = data.ibm_container_cluster_config.cluster_config.token
2632
}
27-
28-
locals {
29-
at_endpoint = "https://api.${var.region}.logging.cloud.ibm.com"
30-
}
31-
32-
provider "logdna" {
33-
alias = "at"
34-
servicekey = module.observability_instances.activity_tracker_resource_key != null ? module.observability_instances.activity_tracker_resource_key : ""
35-
url = local.at_endpoint
36-
}
37-
38-
provider "logdna" {
39-
alias = "ld"
40-
servicekey = module.observability_instances.log_analysis_resource_key != null ? module.observability_instances.log_analysis_resource_key : ""
41-
url = local.at_endpoint
42-
}

examples/end-to-end-example/version.tf

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,5 @@ terraform {
1313
source = "hashicorp/kubernetes"
1414
version = ">= 2.16.1"
1515
}
16-
logdna = {
17-
source = "logdna/logdna"
18-
version = ">= 1.14.2"
19-
}
2016
}
2117
}

0 commit comments

Comments
 (0)