Skip to content

Commit 613811c

Browse files
authored
feat: initial release (#7)
1 parent 5aeeb65 commit 613811c

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

+1872
-497
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-monitoring-agent
5+
kind: solution
6+
catalog_id: 7df1e4ca-d54c-4fd0-82ce-3d13247308cd
7+
offering_id: b0a00765-ee91-4c2a-87fc-df46dbc58cdb
8+
variations:
9+
- name: fully-configurable
10+
mark_ready: true
11+
install_type: fullstack
12+
pre_validation: "tests/scripts/pre-validation-deploy-base-ocp-and-monitoring-instances.sh"
13+
post_validation: "tests/scripts/post-validation-deploy-base-ocp-and-monitoring-instances.sh"

.github/settings.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ repository:
2222

2323
# Uncomment this description property
2424
# and update the description to the current repo description.
25-
# description: ""
25+
description: "Terraform module to install and configure the Monitoring Agent on IBM Cloud Kubernetes Service and Red Hat OpenShift on IBM Cloud."
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, monitoring-agent, sysdig-agent, observability, agent, sysdig
28+
topics: terraform, ibm-cloud, terraform-module, core-team, monitoring-agent, sysdig-agent, observability, monitoring, agent, sysdig

.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-24T23:50:52Z",
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+
* @jor2 @Aashiq-J

README.md

Lines changed: 73 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -1,129 +1,89 @@
1-
<!-- Update this title with a descriptive name. Use sentence case. -->
2-
# Terraform modules template project
3-
4-
<!--
5-
Update status and "latest release" badges:
6-
1. For the status options, see https://terraform-ibm-modules.github.io/documentation/#/badge-status
7-
2. Update the "latest release" badge to point to the correct module's repo. Replace "terraform-ibm-module-template" in two places.
8-
-->
9-
[![Incubating (Not yet consumable)](https://img.shields.io/badge/status-Incubating%20(Not%20yet%20consumable)-red)](https://terraform-ibm-modules.github.io/documentation/#/badge-status)
10-
[![latest release](https://img.shields.io/github/v/release/terraform-ibm-modules/terraform-ibm-monitoring-agent?logo=GitHub&sort=semver)](https://github.com/terraform-ibm-modules/terraform-ibm-monitoring-agent/releases/latest)
1+
# Terraform IBM Monitoring agent module
2+
3+
[![Graduated (Supported)](https://img.shields.io/badge/Status-Graduated%20(Supported)-brightgreen)](https://terraform-ibm-modules.github.io/documentation/#/badge-status)
114
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
5+
[![latest release](https://img.shields.io/github/v/release/terraform-ibm-modules/terraform-ibm-monitoring-agent?logo=GitHub&sort=semver)](https://github.com/terraform-ibm-modules/terraform-ibm-monitoring-agent/releases/latest)
126
[![Renovate enabled](https://img.shields.io/badge/renovate-enabled-brightgreen.svg)](https://renovatebot.com/)
137
[![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)
148

15-
<!--
16-
Add a description of modules in this repo.
17-
Expand on the repo short description in the .github/settings.yml file.
9+
This module deploys the following monitoring agent to an IBM Cloud Red Hat OpenShift Container Platform or Kubernetes cluster:
1810

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-
-->
11+
- [Monitoring agent](https://cloud.ibm.com/docs/monitoring?topic=monitoring-about-collect-metrics)
2212

23-
TODO: Replace this with a description of the modules in this repo.
24-
25-
26-
<!-- The following content is automatically populated by the pre-commit hook -->
13+
<!-- Below content is automatically populated via pre-commit hook -->
2714
<!-- BEGIN OVERVIEW HOOK -->
2815
## Overview
2916
* [terraform-ibm-monitoring-agent](#terraform-ibm-monitoring-agent)
3017
* [Examples](./examples)
31-
* [Advanced example](./examples/advanced)
32-
* [Basic example](./examples/basic)
18+
* [Monitoring agent on Kubernetes using CSE ingress endpoint with an apikey](./examples/obs-agent-iks)
19+
* [Monitoring agent](./examples/obs-agent-ocp)
3320
* [Contributing](#contributing)
3421
<!-- END OVERVIEW HOOK -->
3522

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) -->
4723
## terraform-ibm-monitoring-agent
4824

4925
### Usage
5026

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-
-->
57-
5827
```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-
}
28+
# ############################################################################
29+
# Init cluster config for helm
30+
# ############################################################################
6831
69-
locals {
70-
region = "us-south"
32+
data "ibm_container_cluster_config" "cluster_config" {
33+
# update this value with the Id of the cluster where these agent will be provisioned
34+
cluster_name_id = "cluster_id"
7135
}
7236
37+
# ############################################################################
38+
# Config providers
39+
# ############################################################################
40+
7341
provider "ibm" {
74-
ibmcloud_api_key = "XXXXXXXXXX" # replace with apikey value
75-
region = local.region
42+
# update this value with your IBM Cloud API key value
43+
ibmcloud_api_key = "XXXXXXXXXXXXXXXXX" # pragma: allowlist secret
7644
}
7745
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
46+
provider "helm" {
47+
kubernetes {
48+
host = data.ibm_container_cluster_config.cluster_config.host
49+
token = data.ibm_container_cluster_config.cluster_config.token
50+
cluster_ca_certificate = data.ibm_container_cluster_config.cluster_config.ca_certificate
51+
}
8452
}
85-
```
86-
87-
### Required access policies
8853
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-
-->
54+
# ############################################################################
55+
# Install monitoring agents
56+
# ############################################################################
57+
58+
module "monitoring_agents" {
59+
source = "terraform-ibm-modules/monitoring-agent/ibm"
60+
version = "X.X.X" # Replace "X.X.X" with a release version to lock into a specific release
61+
is_vpc_cluster = true # Change to false if target cluster is running on classic infrastructure
62+
cluster_id = "cluster id" # update this with your cluster id where the agent will be installed
63+
cluster_resource_group_id = "resource group id" # update this with the Id of your IBM Cloud resource group
64+
access_key = "XXXXXXXX"
65+
cloud_monitoring_instance_region = "us-south"
66+
}
67+
```
9968

100-
<!--
101-
You need the following permissions to run this module:
69+
### Required IAM access policies
70+
You need the following permissions to run this module.
10271

10372
- Service
10473
- **Resource group only**
10574
- `Viewer` access on the specific resource group
106-
- **Sample IBM Cloud** service
107-
- `Editor` platform access
75+
- **Kubernetes** service
76+
- `Viewer` platform access
10877
- `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.-->
11778

118-
119-
<!-- The following content is automatically populated by the pre-commit hook -->
12079
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
12180
### Requirements
12281

12382
| Name | Version |
12483
|------|---------|
12584
| <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 |
85+
| <a name="requirement_helm"></a> [helm](#requirement\_helm) | >= 2.15.0, <3.0.0 |
86+
| <a name="requirement_ibm"></a> [ibm](#requirement\_ibm) | >= 1.76.1, <2.0.0 |
12787

12888
### Modules
12989

@@ -133,28 +93,42 @@ No modules.
13393

13494
| Name | Type |
13595
|------|------|
136-
| [ibm_resource_instance.cos_instance](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/resource_instance) | resource |
96+
| [helm_release.cloud_monitoring_agent](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource |
97+
| [ibm_container_cluster.cluster](https://registry.terraform.io/providers/ibm-cloud/ibm/latest/docs/data-sources/container_cluster) | data source |
98+
| [ibm_container_cluster_config.cluster_config](https://registry.terraform.io/providers/ibm-cloud/ibm/latest/docs/data-sources/container_cluster_config) | data source |
99+
| [ibm_container_vpc_cluster.cluster](https://registry.terraform.io/providers/ibm-cloud/ibm/latest/docs/data-sources/container_vpc_cluster) | data source |
137100

138101
### Inputs
139102

140103
| Name | Description | Type | Default | Required |
141104
|------|-------------|------|---------|:--------:|
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 |
105+
| <a name="input_access_key"></a> [access\_key](#input\_access\_key) | Access key used by the IBM Cloud Monitoring agent to communicate with the instance | `string` | n/a | yes |
106+
| <a name="input_chart"></a> [chart](#input\_chart) | The name of the Helm chart to deploy. | `string` | `"sysdig-deploy"` | no |
107+
| <a name="input_chart_location"></a> [chart\_location](#input\_chart\_location) | The location of the Cloud Monitoring agent helm chart. | `string` | `"https://charts.sysdig.com"` | no |
108+
| <a name="input_chart_version"></a> [chart\_version](#input\_chart\_version) | The version of the Cloud Monitoring agent helm chart to deploy. | `string` | `"1.79.0"` | no |
109+
| <a name="input_cloud_monitoring_instance_endpoint_type"></a> [cloud\_monitoring\_instance\_endpoint\_type](#input\_cloud\_monitoring\_instance\_endpoint\_type) | Specify the IBM Cloud Monitoring instance endpoint type (public or private) to use. Used to construct the ingestion endpoint. | `string` | `"private"` | no |
110+
| <a name="input_cloud_monitoring_instance_region"></a> [cloud\_monitoring\_instance\_region](#input\_cloud\_monitoring\_instance\_region) | The IBM Cloud Monitoring instance region. Used to construct the ingestion endpoint. | `string` | n/a | yes |
111+
| <a name="input_cluster_config_endpoint_type"></a> [cluster\_config\_endpoint\_type](#input\_cluster\_config\_endpoint\_type) | Specify which type of endpoint to use for for cluster config access: 'default', 'private', 'vpe', 'link'. 'default' value will use the default endpoint of the cluster. | `string` | `"default"` | no |
112+
| <a name="input_cluster_id"></a> [cluster\_id](#input\_cluster\_id) | The ID of the cluster you wish to deploy the agent in | `string` | n/a | yes |
113+
| <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 |
114+
| <a name="input_container_filter"></a> [container\_filter](#input\_container\_filter) | To filter custom containers, specify which containers to include or exclude from metrics collection for the cloud monitoring agent. See https://cloud.ibm.com/docs/monitoring?topic=monitoring-change_kube_agent#change_kube_agent_filter_data. | <pre>list(object({<br/> type = string<br/> parameter = string<br/> name = string<br/> }))</pre> | `[]` | no |
115+
| <a name="input_image_registry"></a> [image\_registry](#input\_image\_registry) | The image registry to use for the Cloud Monitoring agent. | `string` | `"icr.io/ext/sysdig/agent"` | no |
116+
| <a name="input_image_tag_digest"></a> [image\_tag\_digest](#input\_image\_tag\_digest) | The image tag digest to use for the Cloud Monitoring agent. | `string` | `"13.8.1@sha256:e5d1c63edf07c9f861249432c00873e32141381c15fbcff80b90a12b272dc0b9"` | no |
117+
| <a name="input_is_vpc_cluster"></a> [is\_vpc\_cluster](#input\_is\_vpc\_cluster) | Specify true if the target cluster for the monitoring agent is a VPC cluster, false if it is a classic cluster. | `bool` | `true` | no |
118+
| <a name="input_metrics_filter"></a> [metrics\_filter](#input\_metrics\_filter) | To filter custom metrics, specify the Cloud Monitoring metrics to include or to exclude. See https://cloud.ibm.com/docs/monitoring?topic=monitoring-change_kube_agent#change_kube_agent_inc_exc_metrics. | <pre>list(object({<br/> type = string<br/> name = string<br/> }))</pre> | `[]` | no |
119+
| <a name="input_name"></a> [name](#input\_name) | Cloud Monitoring agent name. Used for naming all kubernetes and helm resources on the cluster. | `string` | `"sysdig-agent"` | no |
120+
| <a name="input_namespace"></a> [namespace](#input\_namespace) | Namespace where to deploy the Cloud Monitoring agent. Default value is 'ibm-observe' | `string` | `"ibm-observe"` | no |
121+
| <a name="input_tolerations"></a> [tolerations](#input\_tolerations) | List of tolerations to apply to Cloud Monitoring 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/> {<br/> "effect": "NoSchedule",<br/> "key": "node-role.kubernetes.io/master",<br/> "operator": "Exists"<br/> }<br/>]</pre> | no |
122+
| <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 |
123+
| <a name="input_wait_till_timeout"></a> [wait\_till\_timeout](#input\_wait\_till\_timeout) | Timeout for wait\_till in minutes. | `number` | `90` | no |
146124

147125
### Outputs
148126

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. |
127+
No outputs.
155128
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
156129

157-
<!-- Leave this section as is so that your module has a link to local development environment set-up steps for contributors to follow -->
130+
131+
<!-- Leave this section as is so that your module has a link to local development environment set up steps for contributors to follow -->
158132
## Contributing
159133

160134
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).

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/obs-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).

0 commit comments

Comments
 (0)