Skip to content

Commit 593d873

Browse files
Jordan-Williams2Jordan-Williams2
authored andcommitted
feat: add support for sysdig deploy params
1 parent e72fd43 commit 593d873

File tree

6 files changed

+102
-5
lines changed

6 files changed

+102
-5
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,13 @@ No modules.
105105
| <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 |
106106
| <a name="input_access_key_secret"></a> [access\_key\_secret](#input\_access\_key\_secret) | The name of the secret which will store the access key. | `string` | `"sysdig-agent"` | no |
107107
| <a name="input_add_cluster_name"></a> [add\_cluster\_name](#input\_add\_cluster\_name) | If true, configure the cloud monitoring agent to attach a tag containing the cluster name to all metric data. | `bool` | `true` | no |
108-
| <a name="input_agent_tags"></a> [agent\_tags](#input\_agent\_tags) | List of tags to associate to all matrics that the agent collects. NOTE: Use the 'add\_cluster\_name' variable to add the cluster name as a tag. | `list(string)` | `[]` | no |
109108
| <a name="input_agent_image_repository"></a> [agent\_image\_repository](#input\_agent\_image\_repository) | The image repository to pull the Cloud Monitoring agent image from. | `string` | `"agent-slim"` | no |
110109
| <a name="input_agent_image_tag_digest"></a> [agent\_image\_tag\_digest](#input\_agent\_image\_tag\_digest) | The image tag digest to use for the Cloud Monitoring agent. | `string` | `"13.9.1@sha256:14860d181a8b712c4150bb59e3ba0ff4be08959e2c45376b32c8eb7ff70461f9"` | no |
110+
| <a name="input_agent_limits_cpu"></a> [agent\_limits\_cpu](#input\_agent\_limits\_cpu) | Specifies the CPU limit for the agent. | `string` | `"1"` | no |
111+
| <a name="input_agent_limits_memory"></a> [agent\_limits\_memory](#input\_agent\_limits\_memory) | Specifies the memory limit for the agent. | `string` | `"1024Mi"` | no |
112+
| <a name="input_agent_requests_cpu"></a> [agent\_requests\_cpu](#input\_agent\_requests\_cpu) | Specifies the CPU requested to run in a node for the agent. | `string` | `"1"` | no |
113+
| <a name="input_agent_requests_memory"></a> [agent\_requests\_memory](#input\_agent\_requests\_memory) | Specifies the memory requested to run in a node for the agent. | `string` | `"1024Mi"` | no |
114+
| <a name="input_agent_tags"></a> [agent\_tags](#input\_agent\_tags) | List of tags to associate to all matrics that the agent collects. NOTE: Use the 'add\_cluster\_name' variable to add the cluster name as a tag. | `list(string)` | `[]` | no |
111115
| <a name="input_chart"></a> [chart](#input\_chart) | The name of the Helm chart to deploy. | `string` | `"sysdig-deploy"` | no |
112116
| <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 |
113117
| <a name="input_chart_version"></a> [chart\_version](#input\_chart\_version) | The version of the Cloud Monitoring agent helm chart to deploy. | `string` | `"1.83.1"` | no |

ibm_catalog.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,18 @@
167167
{
168168
"key": "agent_tags"
169169
},
170+
{
171+
"key": "agent_requests_cpu"
172+
},
173+
{
174+
"key": "agent_limits_cpu"
175+
},
176+
{
177+
"key": "agent_requests_memory"
178+
},
179+
{
180+
"key": "agent_limits_memory"
181+
},
170182
{
171183
"key": "tolerations"
172184
},

main.tf

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,6 @@ resource "helm_release" "cloud_monitoring_agent" {
5252
type = "string"
5353
value = local.collector_host
5454
}
55-
set {
56-
name = "global.sysdig.accessKeySecret"
57-
type = "string"
58-
value = var.access_key_secret
5955
set {
6056
name = "agent.slim.image.repository"
6157
type = "string"
@@ -75,6 +71,11 @@ resource "helm_release" "cloud_monitoring_agent" {
7571
type = "string"
7672
value = var.access_key
7773
}
74+
set {
75+
name = "global.sysdig.accessKeySecret"
76+
type = "string"
77+
value = var.access_key_secret
78+
}
7879
set {
7980
name = "global.sysdig.tags"
8081
type = "string"
@@ -105,6 +106,26 @@ resource "helm_release" "cloud_monitoring_agent" {
105106
type = "string"
106107
value = var.agent_image_tag_digest
107108
}
109+
set {
110+
name = "agent.resources.requests.cpu"
111+
type = "string"
112+
value = var.agent_requests_cpu
113+
}
114+
set {
115+
name = "agent.resources.requests.memory"
116+
type = "string"
117+
value = var.agent_requests_memory
118+
}
119+
set {
120+
name = "agent.resources.limits.cpu"
121+
type = "string"
122+
value = var.agent_limits_cpu
123+
}
124+
set {
125+
name = "agent.resources.limits.memory"
126+
type = "string"
127+
value = var.agent_limits_memory
128+
}
108129
set {
109130
name = "agent.slim.kmoduleImage.digest"
110131
type = "string"

solutions/fully-configurable/main.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,8 @@ module "monitoring_agent" {
3737
agent_image_tag_digest = var.agent_image_tag_digest
3838
kernel_module_image_tag_digest = var.kernel_module_image_tag_digest
3939
kernal_module_image_repository = var.kernal_module_image_repository
40+
agent_limits_cpu = var.agent_limits_cpu
41+
agent_limits_memory = var.agent_limits_memory
42+
agent_requests_cpu = var.agent_requests_cpu
43+
agent_requests_memory = var.agent_requests_memory
4044
}

solutions/fully-configurable/variables.tf

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,3 +198,31 @@ variable "kernal_module_image_repository" {
198198
default = "agent-kmodule"
199199
nullable = false
200200
}
201+
202+
########################################################################################################################
203+
# Resource Management Variables
204+
########################################################################################################################
205+
206+
variable "agent_requests_cpu" {
207+
type = string
208+
description = "Specifies the CPU requested to run in a node for the agent."
209+
default = "1"
210+
}
211+
212+
variable "agent_limits_cpu" {
213+
type = string
214+
description = "Specifies the CPU limit for the agent."
215+
default = "1"
216+
}
217+
218+
variable "agent_requests_memory" {
219+
type = string
220+
description = "Specifies the memory requested to run in a node for the agent."
221+
default = "1024Mi"
222+
}
223+
224+
variable "agent_limits_memory" {
225+
type = string
226+
description = "Specifies the memory limit for the agent."
227+
default = "1024Mi"
228+
}

variables.tf

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,3 +226,31 @@ variable "kernal_module_image_repository" {
226226
default = "agent-kmodule"
227227
nullable = false
228228
}
229+
230+
########################################################################################################################
231+
# Resource Management Variables
232+
########################################################################################################################
233+
234+
variable "agent_requests_cpu" {
235+
type = string
236+
description = "Specifies the CPU requested to run in a node for the agent."
237+
default = "1"
238+
}
239+
240+
variable "agent_limits_cpu" {
241+
type = string
242+
description = "Specifies the CPU limit for the agent."
243+
default = "1"
244+
}
245+
246+
variable "agent_requests_memory" {
247+
type = string
248+
description = "Specifies the memory requested to run in a node for the agent."
249+
default = "1024Mi"
250+
}
251+
252+
variable "agent_limits_memory" {
253+
type = string
254+
description = "Specifies the memory limit for the agent."
255+
default = "1024Mi"
256+
}

0 commit comments

Comments
 (0)