Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
bash, tomcat, varnish and kubernetes [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Banana
l33t
l33t


Joined: 21 May 2004
Posts: 618
Location: Germany

PostPosted: Wed Jul 01, 2020 4:27 pm    Post subject: bash, tomcat, varnish and kubernetes [solved] Reply with quote

Hello everyone. Maybe sombody here has some ideas about my problem.

I (need to) work with code which runs in a kubernetes enviroment. The pod itself has two containers. The tomcat one as the default and the varnish as the second. Communication is: k8s <-> varnish <-> tomcat

We collect the logs in splunk from the pods by loggin to stdout. But in some cases it is faster to copy the existing logfiles from the pods and not searching through millions of log entries in splunk. To make this work a simple tail of the existing log file does the trick. Using logrotate solves the data space problem.

Now here is my problem. The following entrypoint.sh script for tomcat. There is a logfile and the tail command. Works. Splunk gets its logs.
https://delta-labs.org/sp/Jac

The logs from varnish should work the same way, but the tail command is not executed and not shown if I manually connect to the container and run ps.
https://delta-labs.org/sp/D3Q


If i manually modify the script to run the varnishncsa and the tail only, and execute it in the running container, the commands start and the tail is there. But why not as the pod is startet?
Is it a bash or varnish problem?

Any ideas or improvements are welcome.
_________________
My personal space


Last edited by Banana on Fri Jul 03, 2020 6:59 am; edited 1 time in total
Back to top
View user's profile Send private message
Banana
l33t
l33t


Joined: 21 May 2004
Posts: 618
Location: Germany

PostPosted: Fri Jul 03, 2020 6:58 am    Post subject: Reply with quote

Solved it. Don't know if it is the right way but right now it runs.

The script k8s uses in the doker file needs to be running all the time. If it ends the container is restarted. (could be config or normal behaviour, I don't know)
So running commands in this script which start fine result in the successfull end of the script and thus a restart.

Also varnishncsa needs the -D to run in the background.

Here is the result: https://delta-labs.org/sp/Cto

Any other Bash tipps are still welcome.
_________________
My personal space
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum