Open raguks opened 7 years ago
I don't see the error here and please elaborate the issue.
Basically for kubernetes when I try to create a pod the pod does not comeup and ends up in CrashBackoff
NAME READY STATUS RESTARTS AGE
db2xc 0/1 CrashLoopBackOff 10 33m```
27m 10s 133 {kubelet wdp-downloadgo-dev3.fyre.ibm.com} Warning FailedSync Error syncing pod, skipping: failed to "StartContainer" for "db2express-c" with CrashLoopBackOff: "Back-off 5m0s restarting failed container=db2express-c pod=db2xc_default(742da930-c2b9-11e6-b9f0-00163e01a246)"
33m 10s 161 {kubelet wdp-downloadgo-dev3.fyre.ibm.com} spec.containers{db2express-c} Warning BackOff Back-off restarting failed docker container
When I look at the docker logs <containername>
I see the error coming from
kubectl logs db2xc --previous
Changing password for user db2inst1.
passwd: all authentication tokens updated successfully.
New password: Retype new password: /entrypoint.sh: line 51: exec: : not found
```/entrypoint.sh: line 51: exec: : not found```
I do not have any other information.... I am thinking the script returns 1 and the pod creation fails
My yaml file looks like this:
cat pod-db2xpc.yaml
apiVersion: v1
kind: Pod
metadata:
name: db2xc
labels:
app: db2app
spec:
containers:
- name: db2express-c
image: ibmcom/db2express-c
ports:
- containerPort: 50000
env:
- name: DB2INST1_PASSWORD
value: somepasswd!
- name: LICENSE
value: accept
I try with k8s today, it seems that add command: ["/entrypoint.sh","db2start"] into yaml is ok. There should be a launch parameters in k8s container.
The solution given by @diewuq works for me.
The solution also worked for me. Thanks @diewuq The change:
--- a/k8s/db2express-c-deployment.yaml
+++ b/k8s/db2express-c-deployment.yaml
@@ -19,6 +19,7 @@ spec:
containers:
- image: ibmcom/db2express-c
name: db2express-c
+ command: ["/entrypoint.sh","db2start"]
env:
- name: LICENSE
value: accept
Or for docker-compose version > 3: command: "db2start"
(db2start
will just be appended to /entrypoint.sh
)
kubectl logs db2xc --previous Changing password for user db2inst1. passwd: all authentication tokens updated successfully. New password: Retype new password: /entrypoint.sh: line 51: exec: : not found
This I think is the compatible docker version with kubernetes.
docker --version Docker version 1.10.3, build cb079f6-unsupported
kubectl version Client Version: version.Info{Major:"1", Minor:"2", GitVersion:"v1.2.0", GitCommit:"ec7364b6e3b155e78086018aa644057edbe196e5", GitTreeState:"clean"} Server Version: version.Info{Major:"1", Minor:"2", GitVersion:"v1.2.0", GitCommit:"ec7364b6e3b155e78086018aa644057edbe196e5", GitTreeState:"clean"}
Please let me know if you need more information.