From 93bf380b677ac99a4028ef33a80169033d72a648 Mon Sep 17 00:00:00 2001 From: Daniel Butler Date: Wed, 27 Nov 2024 15:41:32 +0000 Subject: [PATCH] rename flavor to standard --- ibm_catalog.json | 8 +- solutions/agents/README.md | 12 - .../catalogValidationValues.json.template | 3 - solutions/agents/kubeconfig/.gitignore | 6 - solutions/agents/kubeconfig/README.md | 2 - solutions/agents/main.tf | 48 --- solutions/agents/outputs.tf | 6 - solutions/agents/provider.tf | 37 --- solutions/agents/variables.tf | 280 ------------------ solutions/agents/version.tf | 20 -- solutions/{instances => standard}/DA-types.md | 0 solutions/{instances => standard}/README.md | 0 .../catalogValidationValues.json.template | 0 solutions/{instances => standard}/main.tf | 0 solutions/{instances => standard}/outputs.tf | 0 solutions/{instances => standard}/provider.tf | 0 .../{instances => standard}/variables.tf | 0 solutions/{instances => standard}/version.tf | 0 18 files changed, 4 insertions(+), 418 deletions(-) delete mode 100644 solutions/agents/README.md delete mode 100644 solutions/agents/catalogValidationValues.json.template delete mode 100644 solutions/agents/kubeconfig/.gitignore delete mode 100644 solutions/agents/kubeconfig/README.md delete mode 100644 solutions/agents/main.tf delete mode 100644 solutions/agents/outputs.tf delete mode 100644 solutions/agents/provider.tf delete mode 100644 solutions/agents/variables.tf delete mode 100644 solutions/agents/version.tf rename solutions/{instances => standard}/DA-types.md (100%) rename solutions/{instances => standard}/README.md (100%) rename solutions/{instances => standard}/catalogValidationValues.json.template (100%) rename solutions/{instances => standard}/main.tf (100%) rename solutions/{instances => standard}/outputs.tf (100%) rename solutions/{instances => standard}/provider.tf (100%) rename solutions/{instances => standard}/variables.tf (100%) rename solutions/{instances => standard}/version.tf (100%) diff --git a/ibm_catalog.json b/ibm_catalog.json index d7698094..4b62561f 100644 --- a/ibm_catalog.json +++ b/ibm_catalog.json @@ -1,7 +1,7 @@ { "products": [ { - "label": "Testing - Cloud automation for Observability", + "label": "[Add-ons Beta] Cloud automation for Observability", "name": "testing-deploy-arch-ibm-observability", "product_kind": "solution", "tags": [ @@ -14,9 +14,9 @@ "offering_icon_url": "https://raw.githubusercontent.com/terraform-ibm-modules/terraform-ibm-observability-da/main/images/observability-icon.svg", "flavors": [ { - "label": "Instances", - "name": "instances", - "working_directory": "solutions/instances", + "label": "Standard", + "name": "standard", + "working_directory": "solutions/standard", "licenses": [ { "id": "LICENSE", diff --git a/solutions/agents/README.md b/solutions/agents/README.md deleted file mode 100644 index dd80a622..00000000 --- a/solutions/agents/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# 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. diff --git a/solutions/agents/catalogValidationValues.json.template b/solutions/agents/catalogValidationValues.json.template deleted file mode 100644 index f48a7e33..00000000 --- a/solutions/agents/catalogValidationValues.json.template +++ /dev/null @@ -1,3 +0,0 @@ -{ - "ibmcloud_api_key": $VALIDATION_APIKEY -} diff --git a/solutions/agents/kubeconfig/.gitignore b/solutions/agents/kubeconfig/.gitignore deleted file mode 100644 index 632a28fb..00000000 --- a/solutions/agents/kubeconfig/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -# Ignore everything -* - -# But not these files... -!.gitignore -!README.md diff --git a/solutions/agents/kubeconfig/README.md b/solutions/agents/kubeconfig/README.md deleted file mode 100644 index e85afee8..00000000 --- a/solutions/agents/kubeconfig/README.md +++ /dev/null @@ -1,2 +0,0 @@ -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. diff --git a/solutions/agents/main.tf b/solutions/agents/main.tf deleted file mode 100644 index 6f49af1e..00000000 --- a/solutions/agents/main.tf +++ /dev/null @@ -1,48 +0,0 @@ -############################################################################## -# Observability Agents -############################################################################## - -data "ibm_container_cluster_config" "cluster_config" { - cluster_name_id = var.is_vpc_cluster ? data.ibm_container_vpc_cluster.cluster[0].name : data.ibm_container_cluster.cluster[0].name - resource_group_id = var.cluster_resource_group_id - config_dir = "${path.module}/kubeconfig" - endpoint_type = var.cluster_config_endpoint_type != "default" ? var.cluster_config_endpoint_type : null -} - -module "observability_agents" { - source = "terraform-ibm-modules/observability-agents/ibm" - version = "2.0.1" - cluster_id = var.cluster_id - cluster_resource_group_id = var.cluster_resource_group_id - cluster_config_endpoint_type = var.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 -} diff --git a/solutions/agents/outputs.tf b/solutions/agents/outputs.tf deleted file mode 100644 index 586e7dd2..00000000 --- a/solutions/agents/outputs.tf +++ /dev/null @@ -1,6 +0,0 @@ -############################################################################## -# Outputs -############################################################################## - - -############################################################################## diff --git a/solutions/agents/provider.tf b/solutions/agents/provider.tf deleted file mode 100644 index f0da2082..00000000 --- a/solutions/agents/provider.tf +++ /dev/null @@ -1,37 +0,0 @@ -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 = var.is_vpc_cluster ? 1 : 0 - name = var.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 = var.is_vpc_cluster ? 0 : 1 - name = var.cluster_id - wait_till = var.wait_till - wait_till_timeout = var.wait_till_timeout -} diff --git a/solutions/agents/variables.tf b/solutions/agents/variables.tf deleted file mode 100644 index 52417a21..00000000 --- a/solutions/agents/variables.tf +++ /dev/null @@ -1,280 +0,0 @@ -variable "ibmcloud_api_key" { - type = string - description = "The IBM Cloud API key." - sensitive = true -} - -variable "prefix" { - type = string - description = "The prefix for resources created by this solution." - default = null -} - -############################################################################## -# Cluster variables -############################################################################## - -variable "cluster_id" { - type = string - description = "The ID of the cluster to deploy the agents in." -} - -variable "cluster_resource_group_id" { - type = string - description = "The resource group ID of the cluster." -} - -variable "cluster_config_endpoint_type" { - description = "Specify the type of endpoint to use to access the cluster configuration. Possible values: `default`, `private`, `vpe`, `link`. The `default` value uses the default endpoint of the cluster." - type = string - default = "private" - nullable = false # use default if null is passed in - validation { - error_message = "The specified endpoint type is not valid. Specify one of the following types of endpoints: `default`, `private`, `vpe`, or `link`." - condition = contains(["default", "private", "vpe", "link"], var.cluster_config_endpoint_type) - } -} - -variable "is_vpc_cluster" { - type = bool - description = "Specify true if the target cluster for the DA is a VPC cluster, false if it is classic cluster." - default = true -} - -variable "wait_till" { - description = "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`" - type = string - default = "Normal" - - validation { - error_message = "`wait_till` value must be one of `MasterNodeReady`, `OneWorkerNodeReady`, `IngressReady` or `Normal`." - condition = contains([ - "MasterNodeReady", - "OneWorkerNodeReady", - "IngressReady", - "Normal" - ], var.wait_till) - } -} - -variable "wait_till_timeout" { - description = "Timeout for wait_till in minutes." - type = number - default = 90 -} - -############################################################################## -# Cloud Monitoring variables -############################################################################## - -variable "cloud_monitoring_enabled" { - type = bool - description = "Whether to deploy the IBM Cloud Monitoring agent." - default = true -} - -variable "cloud_monitoring_access_key" { - type = string - description = "The access key that is used by the IBM Cloud Monitoring agent to communicate with the instance." - sensitive = true - default = null -} - -variable "cloud_monitoring_secret_name" { - type = string - description = "The name of the secret that will store the access key. If a prefix input variable is passed, the secret name is prefixed to the value in the `-` format." - default = "sysdig-agent" - nullable = false -} - -variable "cloud_monitoring_instance_region" { - type = string - description = "The name of the region where the IBM Cloud Monitoring instance is created. This name is used to construct the ingestion endpoint." - default = null -} - -variable "cloud_monitoring_endpoint_type" { - type = string - description = "Specify the IBM Cloud Monitoring instance endpoint type (`public` or `private`) to use to construct the ingestion endpoint." - default = "private" - validation { - error_message = "The specified `endpoint_type` can be `private` or `public` only." - condition = contains(["private", "public"], var.cloud_monitoring_endpoint_type) - } -} - -variable "cloud_monitoring_metrics_filter" { - type = list(object({ - type = string - name = string - })) - description = "To filter on custom metrics, specify the IBM Cloud Monitoring metrics to include or exclude. [Learn more](https://cloud.ibm.com/docs/monitoring?topic=monitoring-change_kube_agent#change_kube_agent_inc_exc_metrics)" - default = [] # [{ type = "exclude", name = "metricA.*" }, { type = "include", name = "metricB.*" }] - validation { - condition = length(var.cloud_monitoring_metrics_filter) == 0 || can(regex("^(include|exclude)$", var.cloud_monitoring_metrics_filter[0].type)) - error_message = "The specified `type` for the `cloud_monitoring_metrics_filter` is not valid. Specify either `include` or `exclude`. If the value for `type` is not specified, no metrics are included or excluded." - } -} - -variable "cloud_monitoring_agent_tags" { - type = list(string) - description = "A list of the tags to associate with the metrics that the IBM Cloud Monitoring agent collects. To add the cluster name as a tag, use the `cloud_monitoring_add_cluster_name` variable." - default = [] - nullable = false -} - -variable "cloud_monitoring_add_cluster_name" { - type = bool - description = "Whether to attach a tag to log messages. Set to `true` to configure the IBM Cloud Monitoring agent to attach a tag that contains the cluster name to all log messages." - default = true -} - -variable "cloud_monitoring_agent_name" { - description = "The name of the IBM Cloud Monitoring agent that is used to name the Kubernetes and Helm resources on the cluster. If a prefix input variable is passed, the name of the IBM Cloud Monitoring agent is prefixed to the value in the `-` format." - type = string - default = "sysdig-agent" -} - -variable "cloud_monitoring_agent_namespace" { - type = string - description = "The namespace to deploy the IBM Cloud Monitoring agent in. Default value: `ibm-observe`." - default = "ibm-observe" - nullable = false -} - -variable "cloud_monitoring_agent_tolerations" { - description = "The list of tolerations to apply to the IBM Cloud Monitoring agent. The default operator value `Exists` matches any taint on any node except the master node. [Learn more](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/)" - type = list(object({ - key = optional(string) - operator = optional(string) - value = optional(string) - effect = optional(string) - tolerationSeconds = optional(number) - })) - default = [{ - operator = "Exists" - }, - { - operator : "Exists" - effect : "NoSchedule" - key : "node-role.kubernetes.io/master" - }] -} - -############################################################################## -# Logs Agents variables -############################################################################## - -variable "logs_agent_enabled" { - type = bool - description = "Whether to deploy the Logs agent." - default = true -} - -variable "logs_agent_name" { - description = "The name of the Logs agent. The name is used in all Kubernetes and Helm resources in the cluster." - type = string - default = "logs-agent" - nullable = false -} - -variable "logs_agent_namespace" { - type = string - description = "The namespace where the Logs agent is deployed. The default value is `ibm-observe`." - default = "ibm-observe" - nullable = false -} - -variable "logs_agent_trusted_profile" { - type = string - description = "The IBM Cloud trusted profile ID. Used only when `logs_agent_iam_mode` is set to `TrustedProfile`. The trusted profile must have an IBM Cloud Logs `Sender` role." - default = null -} - -variable "logs_agent_iam_api_key" { - type = string - description = "The IBM Cloud API key for the Logs agent to authenticate and communicate with the IBM Cloud Logs. It is required if `logs_agent_iam_mode` is set to `IAMAPIKey`." - sensitive = true - default = null -} - -variable "logs_agent_tolerations" { - description = "List of tolerations to apply to Logs agent." - type = list(object({ - key = optional(string) - operator = optional(string) - value = optional(string) - effect = optional(string) - tolerationSeconds = optional(number) - })) - default = [{ - operator = "Exists" - }] -} - -variable "logs_agent_additional_log_source_paths" { - type = list(string) - description = "The list of additional log sources. By default, the Logs agent collects logs from a single source at `/var/log/containers/logger-agent-ds-*.log`." - default = [] - nullable = false -} - -variable "logs_agent_exclude_log_source_paths" { - type = list(string) - description = "The list of log sources to exclude. Specify the paths that the Logs agent ignores." - default = [] - nullable = false -} - -variable "logs_agent_selected_log_source_paths" { - type = list(string) - description = "The list of specific log sources paths. Logs will only be collected from the specified log source paths." - default = [] - nullable = false -} - -variable "logs_agent_log_source_namespaces" { - type = list(string) - description = "The list of namespaces from which logs should be forwarded by agent. When specified logs from only these namespaces will be sent by the agent." - default = [] - nullable = false -} - -variable "logs_agent_iam_mode" { - type = string - default = "TrustedProfile" - description = "IAM authentication mode: `TrustedProfile` or `IAMAPIKey`." -} - -variable "logs_agent_iam_environment" { - type = string - default = "PrivateProduction" - description = "IAM authentication Environment: `Production` or `PrivateProduction` or `Staging` or `PrivateStaging`." -} - -variable "logs_agent_additional_metadata" { - description = "The list of additional metadata fields to add to the routed logs." - type = list(object({ - key = optional(string) - value = optional(string) - })) - default = [] -} - -variable "logs_agent_enable_scc" { - description = "Whether to enable creation of Security Context Constraints in Openshift. When installing on an OpenShift cluster, this setting is mandatory to configure permissions for pods within your cluster." - type = bool - default = true -} - -variable "cloud_logs_ingress_endpoint" { - 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. It is required if `logs_agent_enabled` is set to true." - type = string - default = null -} - -variable "cloud_logs_ingress_port" { - type = number - default = 3443 - description = "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." -} diff --git a/solutions/agents/version.tf b/solutions/agents/version.tf deleted file mode 100644 index 97ac3a91..00000000 --- a/solutions/agents/version.tf +++ /dev/null @@ -1,20 +0,0 @@ -terraform { - # module uses nullable feature which is only available in versions >= 1.1.0 - required_version = ">= 1.3.0" - - required_providers { - # Lock DA into an exact provider version - renovate automation will keep it updated - ibm = { - source = "ibm-cloud/ibm" - version = "1.70.0" - } - helm = { - source = "hashicorp/helm" - version = "2.16.0" - } - kubernetes = { - source = "hashicorp/kubernetes" - version = "2.33.0" - } - } -} diff --git a/solutions/instances/DA-types.md b/solutions/standard/DA-types.md similarity index 100% rename from solutions/instances/DA-types.md rename to solutions/standard/DA-types.md diff --git a/solutions/instances/README.md b/solutions/standard/README.md similarity index 100% rename from solutions/instances/README.md rename to solutions/standard/README.md diff --git a/solutions/instances/catalogValidationValues.json.template b/solutions/standard/catalogValidationValues.json.template similarity index 100% rename from solutions/instances/catalogValidationValues.json.template rename to solutions/standard/catalogValidationValues.json.template diff --git a/solutions/instances/main.tf b/solutions/standard/main.tf similarity index 100% rename from solutions/instances/main.tf rename to solutions/standard/main.tf diff --git a/solutions/instances/outputs.tf b/solutions/standard/outputs.tf similarity index 100% rename from solutions/instances/outputs.tf rename to solutions/standard/outputs.tf diff --git a/solutions/instances/provider.tf b/solutions/standard/provider.tf similarity index 100% rename from solutions/instances/provider.tf rename to solutions/standard/provider.tf diff --git a/solutions/instances/variables.tf b/solutions/standard/variables.tf similarity index 100% rename from solutions/instances/variables.tf rename to solutions/standard/variables.tf diff --git a/solutions/instances/version.tf b/solutions/standard/version.tf similarity index 100% rename from solutions/instances/version.tf rename to solutions/standard/version.tf