Skip to content

Commit aaa2bb9

Browse files
authored
feat: required helm provider version updated to >= 3.0.0, <4.0.0<br>- logs agent version updated to 1.6.2 (#159)
1 parent 66382e3 commit aaa2bb9

File tree

17 files changed

+184
-163
lines changed

17 files changed

+184
-163
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ You need the following permissions to run this module.
9292
| Name | Version |
9393
|------|---------|
9494
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.9.0 |
95-
| <a name="requirement_helm"></a> [helm](#requirement\_helm) | >= 2.15.0, <3.0.0 |
95+
| <a name="requirement_helm"></a> [helm](#requirement\_helm) | >= 3.0.0, <4.0.0 |
9696
| <a name="requirement_ibm"></a> [ibm](#requirement\_ibm) | >= 1.80.2, <2.0.0 |
9797

9898
### Modules
@@ -124,14 +124,14 @@ No modules.
124124
| <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 |
125125
| <a name="input_logs_agent_chart"></a> [logs\_agent\_chart](#input\_logs\_agent\_chart) | The name of the Helm chart to deploy. | `string` | `"logs-agent-helm"` | no |
126126
| <a name="input_logs_agent_chart_location"></a> [logs\_agent\_chart\_location](#input\_logs\_agent\_chart\_location) | The location of the Logs agent helm chart. | `string` | `"oci://icr.io/ibm/observe"` | no |
127-
| <a name="input_logs_agent_chart_version"></a> [logs\_agent\_chart\_version](#input\_logs\_agent\_chart\_version) | The version of the Helm chart to deploy. | `string` | `"1.6.1"` | no |
127+
| <a name="input_logs_agent_chart_version"></a> [logs\_agent\_chart\_version](#input\_logs\_agent\_chart\_version) | The version of the Helm chart to deploy. | `string` | `"1.6.2"` | no |
128128
| <a name="input_logs_agent_enable_scc"></a> [logs\_agent\_enable\_scc](#input\_logs\_agent\_enable\_scc) | 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. | `bool` | `true` | no |
129129
| <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 |
130130
| <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_iam_mode` is set to `IAMAPIKey`. | `string` | `null` | no |
131131
| <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 |
132132
| <a name="input_logs_agent_iam_mode"></a> [logs\_agent\_iam\_mode](#input\_logs\_agent\_iam\_mode) | IAM authentication mode: `TrustedProfile` or `IAMAPIKey`. | `string` | `"TrustedProfile"` | no |
133-
| <a name="input_logs_agent_image_version"></a> [logs\_agent\_image\_version](#input\_logs\_agent\_image\_version) | The version of the Logs agent image to deploy. | `string` | `"1.6.1@sha256:0265b85c698e74dfd9e21ad0332a430a3b398c4f0e590dad314c43b3cd796bce"` | no |
134-
| <a name="input_logs_agent_init_image_version"></a> [logs\_agent\_init\_image\_version](#input\_logs\_agent\_init\_image\_version) | The version of the Logs agent init container image to deploy. | `string` | `"1.6.1@sha256:d2c1bb5a97c0d8950d3dfee016cec4347a6cfa8a43123d9c2eecbdee70500f8b"` | no |
133+
| <a name="input_logs_agent_image_version"></a> [logs\_agent\_image\_version](#input\_logs\_agent\_image\_version) | The version of the Logs agent image to deploy. | `string` | `"1.6.2@sha256:dee214b548e063319f206c4c17e0015b57a9480031a89eb6125ce19a026bd116"` | no |
134+
| <a name="input_logs_agent_init_image_version"></a> [logs\_agent\_init\_image\_version](#input\_logs\_agent\_init\_image\_version) | The version of the Logs agent init container image to deploy. | `string` | `"1.6.2@sha256:d6f9964bbbe7c735b8e14a3496e30c403c067d3f729302eec6146626b117b515"` | no |
135135
| <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 |
136136
| <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 |
137137
| <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 |

examples/logs-agent-iks/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ resource "time_sleep" "wait_operators" {
129129

130130
module "cloud_logs" {
131131
source = "terraform-ibm-modules/cloud-logs/ibm"
132-
version = "1.6.4"
132+
version = "1.6.21"
133133
resource_group_id = module.resource_group.resource_group_id
134134
plan = "standard"
135135
region = var.region

examples/logs-agent-iks/provider.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ provider "ibm" {
44
}
55

66
provider "helm" {
7-
kubernetes {
7+
kubernetes = {
88
host = data.ibm_container_cluster_config.cluster_config.host
99
token = data.ibm_container_cluster_config.cluster_config.token
1010
cluster_ca_certificate = data.ibm_container_cluster_config.cluster_config.ca_certificate
1111
}
1212
# IBM Cloud credentials are required to authenticate to the helm repo
13-
registry {
13+
registries = [{
1414
url = "oci://icr.io/ibm/observe/logs-agent-helm"
1515
username = "iamapikey"
1616
password = var.ibmcloud_api_key
17-
}
17+
}]
1818
}
1919

2020
provider "kubernetes" {

examples/logs-agent-iks/version.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ terraform {
1010
}
1111
helm = {
1212
source = "hashicorp/helm"
13-
version = "2.15.0"
13+
version = "3.0.2"
1414
}
1515
# The kubernetes provider is not actually required by the module itself, just this example, so OK to use ">=" here instead of locking into a version
1616
kubernetes = {

examples/logs-agent-ocp/main.tf

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,21 @@ locals {
2222

2323
module "trusted_profile" {
2424
source = "terraform-ibm-modules/trusted-profile/ibm"
25-
version = "2.3.1"
25+
version = "3.1.1"
2626
trusted_profile_name = "${var.prefix}-profile"
2727
trusted_profile_description = "Logs agent Trusted Profile"
2828
# As a `Sender`, you can send logs to your IBM Cloud Logs service instance - but not query or tail logs. This role is meant to be used by agent and routers sending logs.
2929
trusted_profile_policies = [{
30-
roles = ["Sender"]
30+
roles = ["Sender"]
31+
unique_identifier = "logs-agent"
3132
resources = [{
3233
service = "logs"
3334
}]
3435
}]
3536
# Set up fine-grained authorization for `logs-agent` running in ROKS cluster in `ibm-observe` namespace.
3637
trusted_profile_links = [{
37-
cr_type = "ROKS_SA"
38+
cr_type = "ROKS_SA"
39+
unique_identifier = "logs-agent-link"
3840
links = [{
3941
crn = module.ocp_base.cluster_crn
4042
namespace = local.logs_agent_namespace
@@ -104,7 +106,7 @@ locals {
104106

105107
module "ocp_base" {
106108
source = "terraform-ibm-modules/base-ocp-vpc/ibm"
107-
version = "3.54.5"
109+
version = "3.56.0"
108110
resource_group_id = module.resource_group.resource_group_id
109111
region = var.region
110112
tags = var.resource_tags
@@ -129,7 +131,7 @@ data "ibm_container_cluster_config" "cluster_config" {
129131

130132
module "cloud_logs" {
131133
source = "terraform-ibm-modules/cloud-logs/ibm"
132-
version = "1.6.4"
134+
version = "1.6.21"
133135
resource_group_id = module.resource_group.resource_group_id
134136
plan = "standard"
135137
region = var.region
@@ -145,7 +147,7 @@ data "ibm_is_security_groups" "vpc_security_groups" {
145147
# The below code creates a VPE for Cloud logs in the provisioned VPC which allows the agent to access the private Cloud Logs Ingress endpoint.
146148
module "vpe" {
147149
source = "terraform-ibm-modules/vpe-gateway/ibm"
148-
version = "4.7.1"
150+
version = "4.7.6"
149151
region = var.region
150152
prefix = var.prefix
151153
vpc_id = ibm_is_vpc.vpc.id

examples/logs-agent-ocp/provider.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ provider "ibm" {
44
}
55

66
provider "helm" {
7-
kubernetes {
7+
kubernetes = {
88
host = data.ibm_container_cluster_config.cluster_config.host
99
token = data.ibm_container_cluster_config.cluster_config.token
1010
cluster_ca_certificate = data.ibm_container_cluster_config.cluster_config.ca_certificate
1111
}
1212
# IBM Cloud credentials are required to authenticate to the helm repo
13-
registry {
13+
registries = [{
1414
url = "oci://icr.io/ibm/observe/logs-agent-helm"
1515
username = "iamapikey"
1616
password = var.ibmcloud_api_key
17-
}
17+
}]
1818
}
1919

2020
provider "kubernetes" {

examples/logs-agent-ocp/version.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ terraform {
77
required_providers {
88
ibm = {
99
source = "ibm-cloud/ibm"
10-
version = "1.80.2"
10+
version = "1.81.1"
1111
}
1212
helm = {
1313
source = "hashicorp/helm"
14-
version = ">= 2.15.0"
14+
version = ">= 3.0.0, <4.0.0"
1515
}
1616
kubernetes = {
1717
source = "hashicorp/kubernetes"

main.tf

Lines changed: 85 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -47,92 +47,94 @@ resource "helm_release" "logs_agent" {
4747
recreate_pods = true
4848
force_update = true
4949

50-
set {
51-
name = "metadata.name"
52-
type = "string"
53-
value = var.logs_agent_name
54-
}
55-
set {
56-
name = "image.version"
57-
type = "string"
58-
value = split("@", var.logs_agent_image_version)[0]
59-
}
60-
set {
61-
name = "image.containerSha"
62-
type = "string"
63-
value = strcontains(var.logs_agent_image_version, "@") ? split("@", var.logs_agent_image_version)[1] : ""
64-
}
65-
set {
66-
name = "image.initContainerSha"
67-
type = "string"
68-
value = strcontains(var.logs_agent_init_image_version, "@") ? split("@", var.logs_agent_init_image_version)[1] : ""
69-
}
70-
set {
71-
name = "env.ingestionHost"
72-
type = "string"
73-
value = local.cloud_logs_ingress_endpoint
74-
}
75-
set {
76-
name = "env.ingestionPort"
77-
value = var.cloud_logs_ingress_port
78-
}
79-
set_sensitive {
50+
set = [
51+
{
52+
name = "metadata.name"
53+
type = "string"
54+
value = var.logs_agent_name
55+
},
56+
{
57+
name = "image.version"
58+
type = "string"
59+
value = split("@", var.logs_agent_image_version)[0]
60+
},
61+
{
62+
name = "image.containerSha"
63+
type = "string"
64+
value = strcontains(var.logs_agent_image_version, "@") ? split("@", var.logs_agent_image_version)[1] : ""
65+
},
66+
{
67+
name = "image.initContainerSha"
68+
type = "string"
69+
value = strcontains(var.logs_agent_init_image_version, "@") ? split("@", var.logs_agent_init_image_version)[1] : ""
70+
},
71+
{
72+
name = "env.ingestionHost"
73+
type = "string"
74+
value = local.cloud_logs_ingress_endpoint
75+
},
76+
{
77+
name = "env.ingestionPort"
78+
value = var.cloud_logs_ingress_port
79+
},
80+
{
81+
name = "env.trustedProfileID"
82+
type = "string"
83+
value = local.logs_agent_trusted_profile_id
84+
},
85+
{
86+
name = "env.iamMode"
87+
type = "string"
88+
value = var.logs_agent_iam_mode
89+
},
90+
{
91+
name = "env.iamEnvironment"
92+
type = "string"
93+
value = var.logs_agent_iam_environment
94+
},
95+
{
96+
name = "systemLogs"
97+
type = "string"
98+
value = join("\\,", var.logs_agent_system_logs)
99+
},
100+
{
101+
name = "excludeLogSourcePaths"
102+
type = "string"
103+
value = join("\\,", var.logs_agent_exclude_log_source_paths)
104+
},
105+
{
106+
name = "selectedLogSourcePaths"
107+
type = "string"
108+
value = join("\\,", local.logs_agent_selected_log_source_paths)
109+
},
110+
{
111+
name = "clusterName"
112+
type = "string"
113+
value = local.cluster_name
114+
},
115+
{
116+
name = "scc.create"
117+
value = var.logs_agent_enable_scc
118+
},
119+
{
120+
name = "enableMultiline"
121+
value = var.enable_multiline
122+
},
123+
{
124+
name = "includeAnnotations"
125+
value = var.enable_annotations
126+
},
127+
{
128+
name = "updateStrategy.maxUnavailable"
129+
value = var.max_unavailable
130+
}
131+
]
132+
133+
set_sensitive = [{
80134
name = "secret.iamAPIKey"
81135
type = "string"
82136
value = local.logs_agent_iam_api_key
83-
}
84-
set {
85-
name = "env.trustedProfileID"
86-
type = "string"
87-
value = local.logs_agent_trusted_profile_id
88-
}
89-
set {
90-
name = "env.iamMode"
91-
type = "string"
92-
value = var.logs_agent_iam_mode
93-
}
94-
set {
95-
name = "env.iamEnvironment"
96-
type = "string"
97-
value = var.logs_agent_iam_environment
98-
}
99-
set {
100-
name = "systemLogs"
101-
type = "string"
102-
value = join("\\,", var.logs_agent_system_logs)
103-
}
104-
set {
105-
name = "excludeLogSourcePaths"
106-
type = "string"
107-
value = join("\\,", var.logs_agent_exclude_log_source_paths)
108-
}
109-
set {
110-
name = "selectedLogSourcePaths"
111-
type = "string"
112-
value = join("\\,", local.logs_agent_selected_log_source_paths)
113-
}
114-
set {
115-
name = "clusterName"
116-
type = "string"
117-
value = local.cluster_name
118-
}
119-
set {
120-
name = "scc.create"
121-
value = var.logs_agent_enable_scc
122-
}
123-
set {
124-
name = "enableMultiline"
125-
value = var.enable_multiline
126-
}
127-
128-
set {
129-
name = "includeAnnotations"
130-
value = var.enable_annotations
131-
}
132-
set {
133-
name = "updateStrategy.maxUnavailable"
134-
value = var.max_unavailable
135-
}
137+
}]
136138

137139
# dummy value hack to force update https://github.com/hashicorp/terraform-provider-helm/issues/515#issuecomment-813088122
138140
values = [

renovate.json

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,30 @@
11
{
22
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3-
"extends": ["github>terraform-ibm-modules/common-dev-assets:commonRenovateConfig"],
3+
"extends": [
4+
"github>terraform-ibm-modules/common-dev-assets:commonRenovateConfig"
5+
],
46
"customManagers": [
57
{
68
"customType": "regex",
79
"description": "Update agent version to the latest in variables.tf",
8-
"fileMatch": ["variables.tf$"],
10+
"fileMatch": [
11+
"variables.tf$"
12+
],
913
"datasourceTemplate": "docker",
1014
"matchStrings": [
1115
"default\\s*=\\s*\"(?<currentValue>[\\w.-]+)@(?<currentDigest>sha256:[a-f0-9]+)\"\\s*# datasource: (?<depName>[^\\s]+)"
1216
]
17+
},
18+
{
19+
"customType": "regex",
20+
"description": "Update helm chart version to the latest in variables.tf",
21+
"fileMatch": [
22+
"variables.tf$"
23+
],
24+
"datasourceTemplate": "docker",
25+
"matchStrings": [
26+
"default\\s*=\\s*\"(?<currentValue>.*)\"\\s*# datasource: (?<depName>[^\\s]+)"
27+
]
1328
}
1429
]
1530
}

solutions/fully-configurable/provider.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@ provider "kubernetes" {
1010
}
1111

1212
provider "helm" {
13-
kubernetes {
13+
kubernetes = {
1414
host = data.ibm_container_cluster_config.cluster_config.host
1515
token = data.ibm_container_cluster_config.cluster_config.token
1616
cluster_ca_certificate = data.ibm_container_cluster_config.cluster_config.ca_certificate
1717
}
1818
# IBM Cloud credentials are required to authenticate to the helm repo
19-
registry {
19+
registries = [{
2020
url = "oci://icr.io/ibm/observe/logs-agent-helm"
2121
username = "iamapikey"
2222
password = var.ibmcloud_api_key
23-
}
23+
}]
2424
}
2525

2626
# Retrieve information about an existing VPC cluster

0 commit comments

Comments
 (0)