I am very new to docker Kubernetes. I have made my cluster of 3 nodes now I am creating a YAML file for pod creation. I have taken the image from https://github.com/utkudarilmaz/docker-hping3 the image name is utkudarilmaz/hping3. Can someone help me to set the command or the docker file in the path? because I cannot understand the problem. I want to run my pod successfully working so, that I can utilize it. My YAML file like
---
apiVersion: v1
kind: Pod
metadata:
name: second
labels:
app: web
spec:
containers:
- name: hping3
image: utkudarilmaz/hping3
command: ["hping3 [IP_ADDRESS"]
ports:
- containerPort: 80
nodeSelector:
disktype: ssd
if I do not specify [command] my pod status is CrashLoopBackOff. I have searched and found that My kubernetes pods keep crashing with "CrashLoopBackOff" but I can't find any log I need a command to run the container continuously otherwise it goes in the cycle if I specify a command in YAML file like an above command: ["hping3 103.22.221.59"] and then when I run
kubectl exec –it second – hping3 [IP_ADDRESS]
I get
error: unable to upgrade connection: container not found ("hping3")
the output of kubectl decribe pod second
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 3m39s default-scheduler Successfully assigned default/second1 to netcs
Normal Pulled 3m35s kubelet Successfully pulled image "utkudarilmaz/hping3" in 2.714028668s
Normal Pulled 3m31s kubelet Successfully pulled image "utkudarilmaz/hping3" in 2.734426606s
Normal Pulled 3m15s kubelet Successfully pulled image "utkudarilmaz/hping3" in 2.61256593s
Normal Pulled 2m46s kubelet Successfully pulled image "utkudarilmaz/hping3" in 2.65727147s
Warning BackOff 2m11s (x5 over 3m4s) kubelet Back-off restarting failed container
Normal Pulling 2m4s (x5 over 3m38s) kubelet Pulling image "utkudarilmaz/hping3"
Normal Created 119s (x5 over 3m35s) kubelet Created container hping3
Warning Failed 119s (x5 over 3m35s) kubelet Error: failed to start container "hping3": Error response from daemon: OCI runtime create failed: container_linux.go:370: starting container process caused: exec: "hping3 103.22.221.59": executable file not found in $PATH: unknown
Normal Pulled 119s kubelet Successfully pulled image "utkudarilmaz/hping3" in 5.128803062s
Some Output of docker inspect $utkudarilmaz/hping3
"Mounts": [],
"Config": {
"Hostname": "104e9920881b",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"Tty": true,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
],
"Cmd": null,
"Image": "utkudarilmaz/hping3",
"Volumes": null,
"WorkingDir": "",
"Entrypoint": [
"hping3"
],
"OnBuild": null,
"Labels": {
"desription": "hping3 tool building on Alpine:latest",
"version": "1.0"
my container will not continue running when I try this command
command: [ "/bin/bash", "-c", "--" ]
args: [ "while true; do sleep 30; done;" ] from
https://stackoverflow.com/questions/31870222/how-can-i-keep-a-container-running-on-kubernetes/40093356
same error file not found in the path