Skip to content

Commit d6aacb6

Browse files
Jordan-Williams2Jordan-Williams2
authored andcommitted
feat: move logs agents to its own tile
1 parent 1c49b68 commit d6aacb6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+2024
-518
lines changed

.catalog-onboard-pipeline.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
apiVersion: v1
3+
offerings:
4+
- name: deploy-arch-ibm-logs-agent
5+
kind: solution
6+
catalog_id: 7df1e4ca-d54c-4fd0-82ce-3d13247308cd
7+
offering_id: _
8+
variations:
9+
- name: fully-configurable
10+
mark_ready: true
11+
install_type: fullstack
12+
pre_validation: "tests/scripts/pre-validation-deploy-slz-roks-and-obs-instances.sh"
13+
post_validation: "tests/scripts/post-validation-destroy-slz-roks-and-obs-instances.sh"

.github/settings.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ repository:
2525
# description: ""
2626

2727
# Use a comma-separated list of topics to set on the repo (ensure not to use any caps in the topic string).
28-
topics: terraform, ibm-cloud, terraform-module, core-team, logs-agent, observability, agent, cloud-logs, logging-agent
28+
topics: terraform, ibm-cloud, terraform-module, core-team, logs-agent, observability, logs, agent, cloud-logs, logging-agent

.releaserc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
}],
1111
["@semantic-release/exec", {
1212
"successCmd": "echo \"SEMVER_VERSION=${nextRelease.version}\" >> $GITHUB_ENV"
13+
}],
14+
["@semantic-release/exec", {
15+
"publishCmd": "./ci/trigger-catalog-onboarding-pipeline.sh --version=v${nextRelease.version}"
1316
}]
1417
]
1518
}

.secrets.baseline

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"files": "go.sum|^.secrets.baseline$",
44
"lines": null
55
},
6-
"generated_at": "2024-11-22T17:36:38Z",
6+
"generated_at": "2025-03-13T13:24:51Z",
77
"plugins_used": [
88
{
99
"name": "AWSKeyDetector"
@@ -76,18 +76,7 @@
7676
"name": "TwilioKeyDetector"
7777
}
7878
],
79-
"results": {
80-
"README.md": [
81-
{
82-
"hashed_secret": "ff9ee043d85595eb255c05dfe32ece02a53efbb2",
83-
"is_secret": false,
84-
"is_verified": false,
85-
"line_number": 74,
86-
"type": "Secret Keyword",
87-
"verified_result": null
88-
}
89-
]
90-
},
79+
"results": {},
9180
"version": "0.13.1+ibm.62.dss",
9281
"word_list": {
9382
"file": null,

CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Primary owner should be listed first in list of global owners, followed by any secondary owners
2+
* @Aashiq-J @shemau

README.md

Lines changed: 61 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
<!-- Update this title with a descriptive name. Use sentence case. -->
2-
# Terraform modules template project
1+
# Logs Agent module
32

43
<!--
54
Update status and "latest release" badges:
@@ -12,118 +11,62 @@ Update status and "latest release" badges:
1211
[![Renovate enabled](https://img.shields.io/badge/renovate-enabled-brightgreen.svg)](https://renovatebot.com/)
1312
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
1413

15-
<!--
16-
Add a description of modules in this repo.
17-
Expand on the repo short description in the .github/settings.yml file.
18-
19-
For information, see "Module names and descriptions" at
20-
https://terraform-ibm-modules.github.io/documentation/#/implementation-guidelines?id=module-names-and-descriptions
21-
-->
22-
23-
TODO: Replace this with a description of the modules in this repo.
24-
14+
You can use this module to deploy Logs Agent in your cluster. The agent can collect and route application logs from a Red Hat OpenShift or Kubernetes cluster to an IBM Cloud Logs of your choice.
2515

26-
<!-- The following content is automatically populated by the pre-commit hook -->
27-
<!-- BEGIN OVERVIEW HOOK -->
28-
## Overview
29-
* [terraform-ibm-logs-agent](#terraform-ibm-logs-agent)
30-
* [Examples](./examples)
31-
* [Advanced example](./examples/advanced)
32-
* [Basic example](./examples/basic)
33-
* [Contributing](#contributing)
34-
<!-- END OVERVIEW HOOK -->
35-
36-
37-
<!--
38-
If this repo contains any reference architectures, uncomment the heading below and link to them.
39-
(Usually in the `/reference-architectures` directory.)
40-
See "Reference architecture" in the public documentation at
41-
https://terraform-ibm-modules.github.io/documentation/#/implementation-guidelines?id=reference-architecture
42-
-->
43-
<!-- ## Reference architectures -->
44-
45-
46-
<!-- Replace this heading with the name of the root level module (the repo name) -->
47-
## terraform-ibm-logs-agent
48-
49-
### Usage
50-
51-
<!--
52-
Add an example of the use of the module in the following code block.
53-
54-
Use real values instead of "var.<var_name>" or other placeholder values
55-
unless real values don't help users know what to change.
56-
-->
16+
## Usage
5717

5818
```hcl
59-
terraform {
60-
required_version = ">= 1.9.0"
61-
required_providers {
62-
ibm = {
63-
source = "IBM-Cloud/ibm"
64-
version = "X.Y.Z" # Lock into a provider version that satisfies the module constraints
65-
}
66-
}
67-
}
19+
# ############################################################################
20+
# Init cluster config for helm
21+
# ############################################################################
6822
69-
locals {
70-
region = "us-south"
23+
data "ibm_container_cluster_config" "cluster_config" {
24+
# update this value with the Id of the cluster where the agent will be provisioned
25+
cluster_name_id = "cluster_id"
7126
}
7227
28+
# ############################################################################
29+
# Config providers
30+
# ############################################################################
31+
7332
provider "ibm" {
74-
ibmcloud_api_key = "XXXXXXXXXX" # replace with apikey value
75-
region = local.region
33+
# update this value with your IBM Cloud API key value
34+
ibmcloud_api_key = "api key value" # pragma: allowlist secret
7635
}
7736
78-
module "module_template" {
79-
source = "terraform-ibm-modules/<replace>/ibm"
80-
version = "X.Y.Z" # Replace "X.Y.Z" with a release version to lock into a specific release
81-
region = local.region
82-
name = "instance-name"
83-
resource_group_id = "xxXXxxXXxXxXXXXxxXxxxXXXXxXXXXX" # Replace with the actual ID of resource group to use
37+
provider "helm" {
38+
kubernetes {
39+
host = data.ibm_container_cluster_config.cluster_config.host
40+
token = data.ibm_container_cluster_config.cluster_config.token
41+
cluster_ca_certificate = data.ibm_container_cluster_config.cluster_config.ca_certificate
42+
}
8443
}
85-
```
86-
87-
### Required access policies
88-
89-
<!-- PERMISSIONS REQUIRED TO RUN MODULE
90-
If this module requires permissions, uncomment the following block and update
91-
the sample permissions, following the format.
92-
Replace the 'Sample IBM Cloud' service and roles with applicable values.
93-
The required information can usually be found in the services official
94-
IBM Cloud documentation.
95-
To view all available service permissions, you can go in the
96-
console at Manage > Access (IAM) > Access groups and click into an existing group
97-
(or create a new one) and in the 'Access' tab click 'Assign access'.
98-
-->
99-
100-
<!--
101-
You need the following permissions to run this module:
102-
103-
- Service
104-
- **Resource group only**
105-
- `Viewer` access on the specific resource group
106-
- **Sample IBM Cloud** service
107-
- `Editor` platform access
108-
- `Manager` service access
109-
-->
110-
111-
<!-- NO PERMISSIONS FOR MODULE
112-
If no permissions are required for the module, uncomment the following
113-
statement instead the previous block.
114-
-->
115-
116-
<!-- No permissions are needed to run this module.-->
11744
45+
# ############################################################################
46+
# Install Logs Agent
47+
# ############################################################################
48+
49+
module "logs_agent_module" {
50+
source = "terraform-ibm-modules/logs-agent/ibm"
51+
# update this with your cluster id where the agent will be installed
52+
cluster_id = "cluster id"
53+
# update this with the Id of your IBM Cloud resource group
54+
cluster_resource_group_id = "resource group id"
55+
# Logs Agent variables
56+
logs_agent_trusted_profile = "XXXXXXXX"
57+
cloud_logs_ingress_endpoint = "<cloud-logs-instance-guid>.ingress.us-south.logs.cloud.ibm.com"
58+
cloud_logs_ingress_port = 443
59+
}
60+
```
11861

119-
<!-- The following content is automatically populated by the pre-commit hook -->
12062
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
12163
### Requirements
12264

12365
| Name | Version |
12466
|------|---------|
12567
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.9.0 |
126-
| <a name="requirement_ibm"></a> [ibm](#requirement\_ibm) | >= 1.71.2, < 2.0.0 |
68+
| <a name="requirement_helm"></a> [helm](#requirement\_helm) | >= 2.15.0, <3.0.0 |
69+
| <a name="requirement_ibm"></a> [ibm](#requirement\_ibm) | >= 1.76.1, <2.0.0 |
12770

12871
### Modules
12972

@@ -133,30 +76,34 @@ No modules.
13376

13477
| Name | Type |
13578
|------|------|
136-
| [ibm_resource_instance.cos_instance](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/resource_instance) | resource |
79+
| [helm_release.agent](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource |
80+
| [ibm_container_cluster.cluster](https://registry.terraform.io/providers/ibm-cloud/ibm/latest/docs/data-sources/container_cluster) | data source |
81+
| [ibm_container_cluster_config.cluster_config](https://registry.terraform.io/providers/ibm-cloud/ibm/latest/docs/data-sources/container_cluster_config) | data source |
82+
| [ibm_container_vpc_cluster.cluster](https://registry.terraform.io/providers/ibm-cloud/ibm/latest/docs/data-sources/container_vpc_cluster) | data source |
13783

13884
### Inputs
13985

14086
| Name | Description | Type | Default | Required |
14187
|------|-------------|------|---------|:--------:|
142-
| <a name="input_name"></a> [name](#input\_name) | A descriptive name used to identify the resource instance. | `string` | n/a | yes |
143-
| <a name="input_plan"></a> [plan](#input\_plan) | The name of the plan type supported by service. | `string` | `"standard"` | no |
144-
| <a name="input_resource_group_id"></a> [resource\_group\_id](#input\_resource\_group\_id) | The ID of the resource group where you want to create the service. | `string` | n/a | yes |
145-
| <a name="input_resource_tags"></a> [resource\_tags](#input\_resource\_tags) | List of resource tag to associate with the instance. | `list(string)` | `[]` | no |
88+
| <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 |
89+
| <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 |
90+
| <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 |
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 |
92+
| <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 |
93+
| <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 |
94+
| <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 |
95+
| <a name="input_chart_repository"></a> [chart\_repository](#input\_chart\_repository) | The repository URL for the Sysdig Helm chart. | `string` | `"https://charts.sysdig.com"` | no |
96+
| <a name="input_chart_version"></a> [chart\_version](#input\_chart\_version) | The version of the Sysdig Helm chart to deploy. | `string` | `null` | no |
97+
| <a name="input_cloud_logs_ingress_endpoint"></a> [cloud\_logs\_ingress\_endpoint](#input\_cloud\_logs\_ingress\_endpoint) | 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. | `string` | n/a | yes |
98+
| <a name="input_cluster_config_endpoint_type"></a> [cluster\_config\_endpoint\_type](#input\_cluster\_config\_endpoint\_type) | The type of endpoint to use for the cluster config access: `default`, `private`, `vpe`, or `link`. The `default` value uses the default endpoint of the cluster. | `string` | `"default"` | no |
99+
| <a name="input_cluster_id"></a> [cluster\_id](#input\_cluster\_id) | The ID of the cluster to deploy the agent. | `string` | n/a | yes |
100+
| <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 |
101+
| <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 |
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 |
103+
| <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 |
104+
| <a name="input_wait_till_timeout"></a> [wait\_till\_timeout](#input\_wait\_till\_timeout) | Timeout for wait\_till in minutes. | `number` | `90` | no |
146105

147106
### Outputs
148107

149-
| Name | Description |
150-
|------|-------------|
151-
| <a name="output_account_id"></a> [account\_id](#output\_account\_id) | An alpha-numeric value identifying the account ID. |
152-
| <a name="output_crn"></a> [crn](#output\_crn) | The CRN of the resource instance. |
153-
| <a name="output_guid"></a> [guid](#output\_guid) | The GUID of the resource instance. |
154-
| <a name="output_id"></a> [id](#output\_id) | The unique identifier of the resource instance. |
108+
No outputs.
155109
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
156-
157-
<!-- Leave this section as is so that your module has a link to local development environment set-up steps for contributors to follow -->
158-
## Contributing
159-
160-
You can report issues and request features for this module in GitHub issues in the module repo. See [Report an issue or request a feature](https://github.com/terraform-ibm-modules/.github/blob/main/.github/SUPPORT.md).
161-
162-
To set up your local development environment, see [Local development setup](https://terraform-ibm-modules.github.io/documentation/#/local-dev-setup) in the project documentation.

cra-config.yaml

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
1-
#
2-
# Developer tips:
3-
# - CRA = Code Risk Analyzer (more info on CRA: https://cloud.ibm.com/docs/code-risk-analyzer-cli-plugin?topic=code-risk-analyzer-cli-plugin-cra-cli-plugin)
4-
# - Multiple directories can be scanned by CRA. Ensure if there are any deployable architecture in the repository that they are all scanned
5-
# - More info about supported configurations at https://github.com/terraform-ibm-modules/common-pipeline-assets/blob/main/.github/workflows/terraform-test-pipeline.md#cra-config-yaml
6-
#
7-
1+
# More info about this file at https://github.com/terraform-ibm-modules/common-pipeline-assets/blob/main/.github/workflows/terraform-test-pipeline.md#cra-config-yaml
82
version: "v1"
93
CRA_TARGETS:
10-
- CRA_TARGET: "examples/advanced" # Target directory for CRA scan. If not provided, the CRA Scan will not be run.
11-
CRA_IGNORE_RULES_FILE: "cra-tf-validate-ignore-rules.json"
12-
PROFILE_ID: "fe96bd4d-9b37-40f2-b39f-a62760e326a3" # SCC profile ID (currently set to 'IBM Cloud Framework for Financial Services' '1.7.0' profile).
13-
# SCC_INSTANCE_ID: "" # The SCC instance ID to use to download profile for CRA scan. If not provided, a default global value will be used.
14-
# SCC_REGION: "" # The IBM Cloud region that the SCC instance is in. If not provided, a default global value will be used.
15-
CRA_ENVIRONMENT_VARIABLES: # An optional map of environment variables for CRA, where the key is the variable name and value is the value. Useful for providing TF_VARs.
16-
TF_VAR_prefix: "mock"
17-
TF_VAR_region: "us-south"
4+
- CRA_TARGET: "examples/logs-agent-ocp" # Target directory for CRA scan. If not provided, the CRA Scan will not be run.
5+
CRA_IGNORE_RULES_FILE: "cra-tf-validate-ignore-rules.json" # CRA Ignore file to use. If not provided, it checks the repo root directory for `cra-tf-validate-ignore-rules.json`
6+
PROFILE_ID: "fe96bd4d-9b37-40f2-b39f-a62760e326a3" # SCC profile ID (currently set to 'IBM Cloud Framework for Financial Services' '1.7.0' profile).

cra-tf-validate-ignore-rules.json

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
12
{
2-
"scc_rules": []
3+
"scc_rules": [
4+
{
5+
"scc_rule_id": "rule-216e2449-27d7-4afc-929a-b66e196a9cf9",
6+
"description": "Check whether Flow Logs for VPC are enabled",
7+
"ignore_reason": "This rule is not relevant to the module itself, just the VPC resource that is used in the example that is scanned",
8+
"is_valid": false
9+
},
10+
{
11+
"scc_rule_id": "rule-2325054a-c338-474a-9740-0b7034487e40",
12+
"description:": "Check whether OpenShift clusters are accessible only by using private endpoints",
13+
"ignore_reason": "This rule is not relevant to the module itself, just the cluster resource that is used in the example that is scanned",
14+
"is_valid": false
15+
},
16+
{
17+
"scc_rule_id": "rule-64c0bea0-8760-4a6b-a56c-ee375a48961e",
18+
"description:": "Check whether Virtual Private Cloud (VPC) has no public gateways attached",
19+
"ignore_reason": "This rule is not relevant to the module itself, just the VPC resource that is used in the example that is scanned",
20+
"is_valid": false
21+
}
22+
]
323
}

examples/advanced/README.md

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

0 commit comments

Comments
 (0)