diff --git a/.drone.star b/.drone.star index 96bc288..8dfdeb3 100644 --- a/.drone.star +++ b/.drone.star @@ -61,6 +61,7 @@ TEMPLATES = { "splunk": { "splunk": { "image": "cr.smcm.xyz/coder-images/splunk", + "uf_image": "cr.smcm.xyz/coder-images/splunkuniversalforwarder", "splunk_versions": ["9.1", "9.2"], "coder_user": "splunk", "coder_user_home": "/opt/splunk/etc", diff --git a/splunk_license_hacking.tf.j2 b/splunk_license_hacking.tf.j2 index c78d402..4de0659 100644 --- a/splunk_license_hacking.tf.j2 +++ b/splunk_license_hacking.tf.j2 @@ -134,4 +134,49 @@ resource "coder_app" "splunk-lm" { read_only = false } } + container { + name = "uf" + image = "{{uf_image}}:${data.coder_parameter.splunk_version.value}" + command = ["sudo", "-E", "-u", "ansible", "/sbin/entrypoint.sh", "start"] + image_pull_policy = "{{ image_pull_policy }}" + + security_context { + run_as_user = "{{ coder_user_uid }}" + } + + env { + name = "SPLUNK_DEPLOYMENT_SERVER" + value = "lm" + } + env { + name = "SPLUNK_SVC_PORT" + value = "8091" + } + env { + name = "SPLUNK_PASSWORD" + value = "Temp1234!" + } + env { + name = "SPLUNK_START_ARGS" + value = "--accept-license" + } + + resources { + requests = { + "cpu" = "250m" + "memory" = "512Mi" + } + limits = { + "cpu" = data.coder_parameter.cpu.value + "memory" = "${data.coder_parameter.memory.value}Gi" + } + } + + volume_mount { + mount_path = "/opt/splunkforwarder/etc" + name = "home" + sub_path = "uf" + read_only = false + } + } {% endblock %} \ No newline at end of file