splunk / splunk-operator

Splunk Operator for Kubernetes
Other
206 stars 114 forks source link

Splunk Operator: DB Connect on a Splunk-operator managed instance #859

Closed lxbrd closed 1 year ago

lxbrd commented 2 years ago

Please select the type of request

Bug

Tell us more

Describe the request We are using the Splunk Operator for Kubernetes for some Standalone Instances. It works so far.
But now we want to use DB Connect on a Standalone Deployment. The installation of DB Connect and the JDBC Drivers work, but we get errors.

The errors are related to the missing JRE on the docker image. How are we supposed to use db connect without JRE in the Splunk-Standalone pod?

Expected behavior

Splunk setup on K8S Kubernetes Cluster with Splunk-Operator and a Splunk Standalone deployment.

Reproduction/Testing steps

Proposed changes(optional)

pogdin commented 2 years ago

@lxbrd , thanks for filing. We are aware and currently working on releasing a Splunk Enterprise Docker container with Java installed to support this and other use cases.

adamrushuk commented 2 years ago

I've not tested this on the latest v9 containers, but was able to enable java by adding this env var to our Splunk helm chart:

env:
- name: JAVA_VERSION
    value: openjdk:8

The Java version then shows within the running container:

[ansible@forwarder-0 splunk]$ java -version
openjdk version "1.8.0_342"
OpenJDK Runtime Environment (build 1.8.0_342-b07)
OpenJDK 64-Bit Server VM (build 25.342-b07, mixed mode)

The above code works for splunk/splunk:8.2.

adamrushuk commented 2 years ago

@mittelangelo I just tried using JAVA_VERSION: openjdk:8 extraEnv and saw this in the logs: WARNING: No password ENV var. Stack may fail to provision if splunk.password is not set in ENV or a default.yml. Looks like maybe the extraEnv method doesn't merge, so you'll have to override all required env vars.

At least I can see JAVA_VERSION is the correct var to use looking at the ansible spec: https://github.com/splunk/splunk-ansible/blob/develop/docs/advanced/default.yml.spec.md

Please let me know if you find a working solution.

kylcami commented 2 years ago

@pogdin What are the timelines of having a Splunk image with Java available?

What are the workaround methods without resorting to building a custom image? I tried several to no avail. Using the startup user as "root" in attempt to install Java inside the container (splunk.user), failed - still running as "splunk". Looked up for sudo password, failed.

pogdin commented 1 year ago

Please try https://hub.docker.com/layers/splunk/splunk/9.0.1-openjdk11/images/sha256-c3c608300b6291c37515b4d94aa188e287e75f7da0c48572cc8e8bb84b0e6a3f?context=repo