I have an application which does this: So Python program can start multiple long-lived processes on demand. If I stop main Python program and start again, it knows that sub-program-1.py should be started, because there is a record about status in DB that tells it. So simply it works fine when there is only one replica of Docker container, pod,
Tag: kubernetes
how to add curr timestamp to while loop in container in pod in kubernetes?
This command is where i need to insert into a file “success! Wed Jun 8 20:28:01 WAST 2022”,i.e. current timestamp. But it keeps writing ‘success date’ Answer You could use command substitution for this. That would be in shell or bash, the same. Additionally, you may need to escape the dollar sign, since $() has a special meaning in Kubernetes
Error CrushLoopBackOff to start k8s Dashboard
I try to install dashboard to clear private k8s cluster (without internet connection). I did according to this instruction https://github.com/kubernetes/dashboard. When start apply recomended.yaml: metrics scrapper start successfully, but dashboard show error CrashLoopBackOff permanently. Docker Version: 19.03.6 K8s version: 1.23.4 Containers status: Containers log: Worker-node logs from /var/log/syslog: Answer By default, the dashboard container is installed on the worker node.
shell script to pass argument to input file
I have shell script which takes some input from user and pass that input to the file which i am using inside my shell script Shell script myscript.sh here is de_pod.yaml this is how i am running the script if you look at de_pod.yaml at line command: [“python”, “/script.py”, “$Input1”, “$input2”] here i am using the user input after running
Where can I get node exporter metrics description?
I’m new to monitoring the k8s cluster with prometheus, node exporter and so on. I want to know that what the metrics exactly mean for though the name of metrics are self descriptive. I already checked the github of node exporter, but I got not useful information. Where can I get the descriptions of node exporter metrics? Thanks Answer There
download & install openshift cli command not working
I want to add the download and installation step of OpenShift CLI 4.6 on a docker file. I have added the following lines but it’s not working. But I am getting the following error Current curl: (23) Failed writing body (1354 != 1371) Answer curl -L https://github.com/openshift/okd/releases/download/4.6.0-0.okd-2021-02-14-205305/openshift-client-linux-4.6.0-0.okd-2021-02-14-205305.tar.gz | tar xz will extract the files in the tarball, so finally, the
how read/reach/access a file from Kotlin when the application is deployed either in Kubernetes or Linux
Context: I successfully parse a json file while debugging/running locally in my Windows PC that way When I deployed it to either docker or AWS I get this error Is there a more reliable way to “navigate” to a file placed in resources folder? I mean someway it wouldn’t be affected either it is Windows/Linux/Kubernetes/etc? Answer The usual way to
Redirect logs of pods in my k8s to a file with pod name
I was trying to redirect logs of pods in a k8s into a file of their name. kubectl get pods | awk ‘{print $1}’ | tail -2 | xargs -I {} kubectl logs {} > {} This is the result. demo@demo1:~/log$ ls {} What I need is, if this is the pod details demo@demo1:~/log$ kubectl get pods NAME READY STATUS
kubectl exec behaving strangely, stating command not found even though the binary is there in the pod
So have an OpenShift cluster and running a pod in the mongodb-test namespace. The pod is running fine When I exec into the pod and run the mongo command, I dont get any issue and the command works as expected. Now the problem is when I try to run the same command using below syntax I get mongo not found
Options for getting logs in kubernetes pods
Have few developer logs in kubernetes pods, what is the best method to get the logs for the developers to see it. Any specific tools that we can use? I have the option of graylog, but not sure if that can be customized to get the developer logs into it. Answer The most basic method would be to simply use