Skip to content
Closed
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .catalog-onboard-pipeline.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
apiVersion: v1
offerings:
- name: deploy-arch-ibm-observability-agents
kind: solution
catalog_id: 7df1e4ca-d54c-4fd0-82ce-3d13247308cd
offering_id: d4ed02f5-0aa5-4e03-a9cb-7913ab2da27f
variations:
- name: baseline
mark_ready: true
install_type: fullstack
pre_validation: "tests/scripts/pre-validation-deploy-slz-roks-and-obs-instances.sh"
post_validation: "tests/scripts/post-validation-destroy-slz-roks-and-obs-instances.sh"
3 changes: 3 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
}],
["@semantic-release/exec", {
"successCmd": "echo \"SEMVER_VERSION=${nextRelease.version}\" >> $GITHUB_ENV"
}],
["@semantic-release/exec", {
"publishCmd": "./ci/trigger-catalog-onboarding-pipeline.sh --version=v${nextRelease.version}"
}]
]
}
239 changes: 239 additions & 0 deletions ibm_catalog.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,239 @@
{
"products": [
{
"label": "Cloud automation for Observability agents",
"name": "deploy-arch-ibm-observability-agents",
"product_kind": "solution",
"tags": [
"ibm_created",
"logging_monitoring",
"terraform",
"target_terraform",
"solution"
],
"keywords": [
"observability",
"agents",
"IaC",
"infrastructure as code",
"terraform",
"solution"
],
"provider_name": "IBM",
"short_description": "Deploys IBM Cloud Observability agents to a cluster",
"long_description": "Solutions that support deploying IBM Cloud Observability agents for logging, monitoring.",
"offering_docs_url": "https://github.com/terraform-ibm-modules/terraform-ibm-observability-agents/blob/main/solutions/baseline/README.md",
"offering_icon_url": "https://raw.githubusercontent.com/terraform-ibm-modules/terraform-ibm-observability-agents/main/images/observability-icon.svg",
"flavors": [
{
"label": "Baseline",
"name": "baseline",
"working_directory": "solutions/baseline",
"compliance": {},
"iam_permissions": [
{
"service_name": "containers-kubernetes",
"role_crns": [
"crn:v1:bluemix:public:iam::::serviceRole:Manager",
"crn:v1:bluemix:public:iam::::role:Viewer"
]
}
],
"architecture": {
"features": [
{
"title": "Works with any Openshift or k8s cluster",
"description": "Works with Red Hat OpenShift, and Kubernetes clusters."
},
{
"title": "Deploys the IBM Cloud Monitoring agent on an existing cluster.",
"description": "Deploys the IBM Cloud Monitoring agent on an existing Red Hat OpenShift cluster."
},
{
"title": "Deploys the IBM Logs agent on an existing cluster.",
"description": "Deploys the IBM Logs agent on an existing Red Hat OpenShift cluster."
}
],
"diagrams": [
{
"diagram": {
"url": "https://raw.githubusercontent.com/terraform-ibm-modules/terraform-ibm-observability-agents/refs/heads/addons/reference-architecture/deployable-architecture-observability-agents.svg",
"caption": "Observability agents on a Red Hat OpenShift cluster",
"type": "image/svg+xml"
},
"description": "Observability agents deployed on a Red Hat OpenShift cluster."
}
]
},
"dependencies": [
{
"flavors": [
"quickstart",
"standard"
],
"id": "95fccffc-ae3b-42df-b6d9-80be5914d852-global",
"name": "deploy-arch-ibm-slz-ocp",
"version": ">=v3.0.0",
"optional": true
},
{
"flavors": [
"instances"
],
"catalog_id": "7a4d68b4-cf8b-40cd-a3d1-f49aff526eb3",
"id": "a3137d28-79e0-479d-8a24-758ebd5a0eab-global",
"name": "deploy-arch-ibm-observability",
"version": ">=v1.3.1",
"optional": true
}
],
"dependency_version_2": true,
"configuration": [
{
"key": "ibmcloud_api_key",
"required": true
},
{
"key": "prefix",
"required": true,
"description": "The prefix to add to all resources that this solution creates. To not use any prefix value, you can enter the string `__NULL__`."
},
{
"key": "cluster_id",
"type": "string",
"default_value": "",
"display_name": "Cluster",
"required": true,
"custom_config": {
"type": "cluster_var",
"grouping": "deployment",
"original_grouping": "deployment"
}
},
{
"key": "cluster_resource_group_id",
"type": "string",
"default_value": "",
"display_name": "Cluster resource group",
"required": true,
"custom_config": {
"type": "resource_group",
"grouping": "deployment",
"original_grouping": "deployment",
"config_constraints": {
"identifier": "rg_id"
}
}
},
{
"key": "cloud_monitoring_access_key"
},
{
"key": "cloud_monitoring_add_cluster_name"
},
{
"key": "cloud_monitoring_agent_name"
},
{
"key": "cloud_monitoring_agent_namespace"
},
{
"key": "cloud_monitoring_agent_tags"
},
{
"key": "cloud_monitoring_agent_tolerations"
},
{
"key": "cloud_monitoring_enabled"
},
{
"key": "cloud_monitoring_endpoint_type"
},
{
"key": "cloud_monitoring_instance_region",
"display_name": "Region",
"custom_config": {
"type": "vpc_region",
Copy link
Contributor

Choose a reason for hiding this comment

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

Cloud Monitoring may support different regions to VPC - I think we need to add a custom dropdown for this whuch only lists supported Cloud Monitoring regions

Copy link
Member Author

Choose a reason for hiding this comment

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

monitoring available in every region. what should i do here? how do i create or view the list of already existing custom configs?

Copy link
Contributor

Choose a reason for hiding this comment

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

@jor2 You will need to create your own dropdown list which only lists the regions that cloud monitoring is supported (same syntax as this https://github.com/terraform-ibm-modules/terraform-ibm-event-notifications/blob/564e73a43888d6fab2fd5706360a11167e8abd48/ibm_catalog.json#L74-L97)

"grouping": "deployment",
"original_grouping": "deployment",
"config_constraints": {
"generationType": "2"
}
}
},
{
"key": "cloud_monitoring_metrics_filter"
},
{
"key": "cloud_monitoring_secret_name"
},
{
"key": "cluster_config_endpoint_type"
},
{
"key": "cluster_data"
},
{
"key": "cloud_logs_ingress_endpoint"
},
{
"key": "cloud_logs_ingress_port"
},
{
"key": "is_vpc_cluster"
},
{
"key": "logs_agent_additional_log_source_paths"
},
{
"key": "logs_agent_additional_metadata"
},
{
"key": "logs_agent_enable_scc"
},
{
"key": "logs_agent_enabled"
},
{
"key": "logs_agent_exclude_log_source_paths"
},
{
"key": "logs_agent_iam_api_key"
},
{
"key": "logs_agent_iam_environment"
},
{
"key": "logs_agent_iam_mode"
},
{
"key": "logs_agent_log_source_namespaces"
},
{
"key": "logs_agent_name"
},
{
"key": "logs_agent_namespace"
},
{
"key": "logs_agent_selected_log_source_paths"
},
{
"key": "logs_agent_tolerations"
},
{
"key": "logs_agent_trusted_profile"
},
{
"key": "wait_till"
},
{
"key": "wait_till_timeout"
}
],
"install_type": "fullstack"
}
]
}
]
}
1 change: 1 addition & 0 deletions images/observability-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions solutions/baseline/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Deploying observability agents on a Red Hat OpenShift cluster

This architecture deploys the following observability agents on a Red Hat OpenShift cluster:

* Cloud Monitoring agent
* Cloud Logs agent

## Before you begin

* Make sure that the Red Hat OpenShift Cluster is deployed.

* Make sure that the observability instances (Cloud Logs and Cloud Monitoring) for which specific agents are required are deployed.
3 changes: 3 additions & 0 deletions solutions/baseline/catalogValidationValues.json.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"ibmcloud_api_key": $VALIDATION_APIKEY
}
6 changes: 6 additions & 0 deletions solutions/baseline/kubeconfig/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Ignore everything
*

# But not these files...
!.gitignore
!README.md
2 changes: 2 additions & 0 deletions solutions/baseline/kubeconfig/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This directory must exist in source control so the `ibm_container_cluster_config` data lookup can use it to place the
config.yml used to connect to a kubernetes cluster.
58 changes: 58 additions & 0 deletions solutions/baseline/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
##############################################################################
# Observability Agents
##############################################################################

data "ibm_container_cluster_config" "cluster_config" {
cluster_name_id = local.is_vpc_cluster ? data.ibm_container_vpc_cluster.cluster[0].name : data.ibm_container_cluster.cluster[0].name
resource_group_id = local.cluster_resource_group_id
config_dir = "${path.module}/kubeconfig"
endpoint_type = local.cluster_config_endpoint_type != "default" ? local.cluster_config_endpoint_type : null
}

locals {
use_cluster_data = length(var.cluster_data) > 0

first_cluster_key = local.use_cluster_data ? keys(var.cluster_data)[0] : null

cluster_id = local.use_cluster_data ? var.cluster_data[local.first_cluster_key].id : var.cluster_id
cluster_resource_group_id = local.use_cluster_data ? var.cluster_data[local.first_cluster_key].resource_group_id : var.cluster_resource_group_id
cluster_config_endpoint_type = var.cluster_config_endpoint_type
is_vpc_cluster = var.is_vpc_cluster
}

module "observability_agents" {
source = "../.."
cluster_id = local.cluster_id
cluster_resource_group_id = local.cluster_resource_group_id
cluster_config_endpoint_type = local.cluster_config_endpoint_type
# Cloud Monitoring (Sysdig) Agent
cloud_monitoring_enabled = var.cloud_monitoring_enabled
cloud_monitoring_agent_name = var.prefix != null ? "${var.prefix}-${var.cloud_monitoring_agent_name}" : var.cloud_monitoring_agent_name
cloud_monitoring_agent_namespace = var.cloud_monitoring_agent_namespace
cloud_monitoring_endpoint_type = var.cloud_monitoring_endpoint_type
cloud_monitoring_access_key = var.cloud_monitoring_access_key
cloud_monitoring_secret_name = var.prefix != null ? "${var.prefix}-${var.cloud_monitoring_secret_name}" : var.cloud_monitoring_secret_name
cloud_monitoring_metrics_filter = var.cloud_monitoring_metrics_filter
cloud_monitoring_agent_tags = var.cloud_monitoring_agent_tags
cloud_monitoring_instance_region = var.cloud_monitoring_instance_region
cloud_monitoring_agent_tolerations = var.cloud_monitoring_agent_tolerations
cloud_monitoring_add_cluster_name = var.cloud_monitoring_add_cluster_name
# Logs Agent
logs_agent_enabled = var.logs_agent_enabled
logs_agent_name = var.logs_agent_name
logs_agent_namespace = var.logs_agent_namespace
logs_agent_trusted_profile = var.logs_agent_trusted_profile
logs_agent_iam_api_key = var.logs_agent_iam_api_key
logs_agent_tolerations = var.logs_agent_tolerations
logs_agent_additional_log_source_paths = var.logs_agent_additional_log_source_paths
logs_agent_exclude_log_source_paths = var.logs_agent_exclude_log_source_paths
logs_agent_selected_log_source_paths = var.logs_agent_selected_log_source_paths
logs_agent_log_source_namespaces = var.logs_agent_log_source_namespaces
logs_agent_iam_mode = var.logs_agent_iam_mode
logs_agent_iam_environment = var.logs_agent_iam_environment
logs_agent_additional_metadata = var.logs_agent_additional_metadata
logs_agent_enable_scc = var.logs_agent_enable_scc
cloud_logs_ingress_endpoint = var.cloud_logs_ingress_endpoint
cloud_logs_ingress_port = var.cloud_logs_ingress_port
is_vpc_cluster = var.is_vpc_cluster
}
6 changes: 6 additions & 0 deletions solutions/baseline/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
##############################################################################
# Outputs
##############################################################################


##############################################################################
37 changes: 37 additions & 0 deletions solutions/baseline/provider.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
provider "ibm" {
ibmcloud_api_key = var.ibmcloud_api_key
}

provider "kubernetes" {
host = data.ibm_container_cluster_config.cluster_config.host
token = data.ibm_container_cluster_config.cluster_config.token
}

provider "helm" {
kubernetes {
host = data.ibm_container_cluster_config.cluster_config.host
token = data.ibm_container_cluster_config.cluster_config.token
}
# IBM Cloud credentials are required to authenticate to the helm repo
registry {
url = "oci://icr.io/ibm/observe/logs-agent-helm"
username = "iamapikey"
password = var.ibmcloud_api_key
}
}

# Retrieve information about an existing VPC cluster
data "ibm_container_vpc_cluster" "cluster" {
count = local.is_vpc_cluster ? 1 : 0
name = local.cluster_id
wait_till = var.wait_till
wait_till_timeout = var.wait_till_timeout
}

# Retrieve information about an existing Classic cluster
data "ibm_container_cluster" "cluster" {
count = local.is_vpc_cluster ? 0 : 1
name = local.cluster_id
wait_till = var.wait_till
wait_till_timeout = var.wait_till_timeout
}
Loading