This repository has been archived on 2026-01-10. You can view files and clone it, but cannot push or open issues or pull requests.
coder-templates/splunk_license_hacking.tf.j2
Steve McMaster 7c967a27e5
All checks were successful
continuous-integration/drone/push Build is passing
update
2024-10-08 15:55:52 -04:00

178 lines
4.7 KiB
Django/Jinja

{% extends "splunk.tf.j2" %}
{% block coder_apps %}
resource "coder_app" "splunk-lm" {
agent_id = coder_agent.main.id
display_name = "Splunk Web (LM)"
slug = "splunkweb-lm"
icon = "https://s3.mcmaster.io/images/Splunk.webp"
url = "http://localhost:8001/"
subdomain = true
share = "public"
healthcheck {
url = "http://localhost:8001/en-US/config?autoload=1"
interval = 3
threshold = 10
}
}
{{ super() }}
{% endblock %}
{% block kubernetes_pod_main_volume_mount %}
volume_mount {
mount_path = "/opt/splunk/etc"
name = "home"
sub_path = "dev"
read_only = false
}
volume_mount {
mount_path = "/opt/splunk-lm"
name = "home"
sub_path = "lm"
read_only = false
}
{% endblock %}
{% block kubernetes_pod_main_env %}
env {
name = "SPLUNK_LICENSE_MASTER_URL"
value = "https://localhost:8091"
}
{{ super() }}
{% endblock %}
{% block additional_containers %}
container {
name = "mitmproxy"
image = "mitmproxy/mitmproxy"
command = [
"mitmdump",
"--mode",
"reverse:https://localhost:8090@8091",
"--ssl-insecure",
"--flow-detail=4"
]
image_pull_policy = "{{ image_pull_policy }}"
security_context {
run_as_user = "1000"
run_as_group = "1000"
}
env {
name = "HOME"
value = "/tmp"
}
resources {
requests = {
"cpu" = "250m"
"memory" = "512Mi"
}
limits = {
"cpu" = data.coder_parameter.cpu.value
"memory" = "${data.coder_parameter.memory.value}Gi"
}
}
}
container {
name = "lm"
image = "{{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_HTTP_PORT"
value = "8001"
}
env {
name = "SPLUNK_KVSTORE_PORT"
value = "8192"
}
env {
name = "SPLUNK_APPSERVER_PORT"
value = "8066"
}
env {
name = "SPLUNK_SVC_PORT"
value = "8090"
}
env {
name = "SPLUNK_ROLE"
value = "splunk_license_master"
}
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/splunk/etc"
name = "home"
sub_path = "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 = "https://localhost: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 %}