Add splunk license hacking template
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Steve McMaster 2024-09-18 22:41:09 -04:00
parent cbdea13a6e
commit b6c9575225
2 changed files with 107 additions and 0 deletions

View File

@ -69,6 +69,17 @@ TEMPLATES = {
"vs_code_root": "/opt/splunk", "vs_code_root": "/opt/splunk",
}, },
}, },
"splunk_license_hacking": {
"splunk_license_hacking": {
"image": "cr.smcm.xyz/coder-images/splunk",
"splunk_versions": ["9.1", "9.2"],
"coder_user": "splunk",
"coder_user_home": "/opt/splunk/etc",
"coder_user_uid": "41812",
"coder_user_gid": "41812",
"vs_code_root": "/opt/splunk",
},
},
} }
def main(ctx): def main(ctx):

View File

@ -0,0 +1,96 @@
{% 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 = "lm"
image = "{{image}}"
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_SVC_PORT"
value = "8091"
}
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
}
}
{% endblock %}