apache / openwhisk-deploy-kube

The Apache OpenWhisk Kubernetes Deployment repository supports deploying the Apache OpenWhisk system on Kubernetes and OpenShift clusters.
https://openwhisk.apache.org/
Apache License 2.0
296 stars 228 forks source link

Tutorial mycluster.yaml causes Error Loop of "owdev-install-packages" pod #704

Open Sladerix opened 2 years ago

Sladerix commented 2 years ago

Hi everyone, i noticed there is something wrong with the default mycluster.yaml shown in the docker for macOS tutorial: Here

The apiHostName is set on "localhost" and ther is not apiHostProto specified.

If you follow the tutorial as is you will end with the pod "owdev-install-packages" in a error loop.... never going in "Completed" status.

I solved the issue by specifing apiHostProto: "https" and changing the apiHostName to the kubernetes cluster ip, retrived by executing kubectl cluster-info and getting the value of "Kubernetes control plane" (in my case kubernetes.docker.internal) but i don't know if it's the right way to do it

cons0l3 commented 2 years ago

I have followed the setup for docker on windows closely and ran into the same issue:

  ingress:
    type: NodePort
    apiHostName: localhost
    apiHostPort: 31001
    useInternally: false

nginx:
  httpsNodePort: 31001

# A single node cluster; so disable affinity
affinity:
  enabled: false
toleration:
  enabled: false
invoker:
  options: "-Dwhisk.kubernetes.user-pod-node-affinity.enabled=false"

The install packages pod fails with:

install-packages error: Unable to get action 'routemgmt/getApi': Get https://localhost:31001/api/v1/namespaces/whisk.system/actions/routemgmt/getApi?code=f 
Sladerix commented 2 years ago

Hi seems you have not specified the "apiHostProto" param: Delete all by deleting the namespace, and try again with this:

  ingress:
    type: NodePort
    apiHostName: localhost
    apiHostPort: 31001
    apiHostProto: "https"
    useInternally: false

nginx:
  httpsNodePort: 31001

# A single node cluster; so disable affinity
affinity:
  enabled: false
toleration:
  enabled: false
invoker:
  options: "-Dwhisk.kubernetes.user-pod-node-affinity.enabled=false"

I'm using with kubernetes bundled with docker. If with the yaml above it does not work neither, then replace the "apiHostName" with the ip of the kubernetes cluster, that you can get by doing: kubectl cluster-info.

Read carefully my first post. it should work.

cons0l3 commented 2 years ago

thanks Sladerix, I just wanted someone to fix the actual "setup for docker" instructions and not only for mac, but it confirms the issue on "docker for windows" also. so this needs fixing at two points in the documentation. I will check if I may open a PR and fix it myself.

I did not even need the apiHostProto "https" change, it was enough to give the NodeID (not ClusterIP) as apiHostname:

apiHostName: ow.192.168.192.176.sslip.io
Sladerix commented 2 years ago

oh ok, to fix the documentation you have to do a PR , but once is approved it take so long to be visibile to everyone in the offical docs.

interesting the fact of NodeID.

cutiful commented 2 years ago

For future visitors: Docker for macOS/Windows runs in a VM, so 127.0.0.1 inside its containers points at the VM, not your machine. You should use apiHostName: host.docker.internal, which points at your outside-the-VM localhost.

DanielLee343 commented 2 years ago

I have the same error, but adding apiHostProto: "https" didn't work

[lyuze@storage-2 openwhisk-deploy-kube]$ kubectl get pods -n openwhisk --watch
NAME                                                         READY   STATUS      RESTARTS   AGE
owdev-alarmprovider-5d57d4b879-hdn5r                         1/1     Running     0          3m38s
owdev-apigateway-d6d756db8-74bmn                             1/1     Running     0          3m38s
owdev-controller-0                                           1/1     Running     0          3m38s
owdev-couchdb-89b8469bc-xzpls                                1/1     Running     0          3m38s
owdev-gen-certs-42q94                                        0/1     Completed   0          3m38s
owdev-init-couchdb-czsg7                                     0/1     Completed   0          3m38s
owdev-install-packages-6nzjt                                 0/1     Error       0          88s
owdev-install-packages-jdrs8                                 0/1     Error       0          3m38s
owdev-install-packages-sr66x                                 0/1     Error       0          118s
owdev-install-packages-vpb9q                                 0/1     Error       0          68s
owdev-invoker-0                                              1/1     Running     0          3m38s
owdev-kafka-0                                                1/1     Running     0          3m38s
owdev-kafkaprovider-7867778f74-j8z82                         1/1     Running     0          3m38s
owdev-nginx-67b8974c77-775kd                                 1/1     Running     0          3m38s
owdev-redis-74d7479464-xw4q8                                 1/1     Running     0          3m38s
owdev-wskadmin                                               1/1     Running     0          3m38s
owdev-zookeeper-0                                            1/1     Running     0          3m38s
wskowdev-invoker-00-1-prewarm-nodejs14                       1/1     Running     0          2m22s
wskowdev-invoker-00-2-prewarm-nodejs14                       1/1     Running     0          2m22s
wskowdev-invoker-00-3-whisksystem-invokerhealthtestaction0   1/1     Running     0          2m22s
[lyuze@storage-2 openwhisk-deploy-kube]$ kubectl logs -n openwhisk owdev-install-packages-6nzjt
...
npm WARN alarmFeed@1.0.0 No description
npm WARN alarmFeed@1.0.0 No repository field.
npm WARN alarmFeed@1.0.0 No license field.
npm ERR! Linux 4.18.0-365.el8.x86_64
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! node v8.10.0
npm ERR! npm  v3.5.2
npm ERR! path /openwhisk-package-alarms/action/node_modules/.staging/@types/node-7154234c/package.json
npm ERR! code ENOTDIR
npm ERR! errno -20
npm ERR! syscall open

npm ERR! ENOTDIR: not a directory, open '/openwhisk-package-alarms/action/node_modules/.staging/@types/node-7154234c/package.json'
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /openwhisk-package-alarms/action/npm-debug.log

I found no similar issue related to npm error on github. Does anyone now how to fix this?

PS: Previously I installed openwhisk successfully but some other issue occurred that required to restart docker, after which wsk action xxxdid not work, so I tried to reinstall openwhisk, then comes to this issue.

qi0523 commented 2 years ago

I have the same error, but adding apiHostProto: "https" didn't work

[lyuze@storage-2 openwhisk-deploy-kube]$ kubectl get pods -n openwhisk --watch
NAME                                                         READY   STATUS      RESTARTS   AGE
owdev-alarmprovider-5d57d4b879-hdn5r                         1/1     Running     0          3m38s
owdev-apigateway-d6d756db8-74bmn                             1/1     Running     0          3m38s
owdev-controller-0                                           1/1     Running     0          3m38s
owdev-couchdb-89b8469bc-xzpls                                1/1     Running     0          3m38s
owdev-gen-certs-42q94                                        0/1     Completed   0          3m38s
owdev-init-couchdb-czsg7                                     0/1     Completed   0          3m38s
owdev-install-packages-6nzjt                                 0/1     Error       0          88s
owdev-install-packages-jdrs8                                 0/1     Error       0          3m38s
owdev-install-packages-sr66x                                 0/1     Error       0          118s
owdev-install-packages-vpb9q                                 0/1     Error       0          68s
owdev-invoker-0                                              1/1     Running     0          3m38s
owdev-kafka-0                                                1/1     Running     0          3m38s
owdev-kafkaprovider-7867778f74-j8z82                         1/1     Running     0          3m38s
owdev-nginx-67b8974c77-775kd                                 1/1     Running     0          3m38s
owdev-redis-74d7479464-xw4q8                                 1/1     Running     0          3m38s
owdev-wskadmin                                               1/1     Running     0          3m38s
owdev-zookeeper-0                                            1/1     Running     0          3m38s
wskowdev-invoker-00-1-prewarm-nodejs14                       1/1     Running     0          2m22s
wskowdev-invoker-00-2-prewarm-nodejs14                       1/1     Running     0          2m22s
wskowdev-invoker-00-3-whisksystem-invokerhealthtestaction0   1/1     Running     0          2m22s
[lyuze@storage-2 openwhisk-deploy-kube]$ kubectl logs -n openwhisk owdev-install-packages-6nzjt
...
npm WARN alarmFeed@1.0.0 No description
npm WARN alarmFeed@1.0.0 No repository field.
npm WARN alarmFeed@1.0.0 No license field.
npm ERR! Linux 4.18.0-365.el8.x86_64
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! node v8.10.0
npm ERR! npm  v3.5.2
npm ERR! path /openwhisk-package-alarms/action/node_modules/.staging/@types/node-7154234c/package.json
npm ERR! code ENOTDIR
npm ERR! errno -20
npm ERR! syscall open

npm ERR! ENOTDIR: not a directory, open '/openwhisk-package-alarms/action/node_modules/.staging/@types/node-7154234c/package.json'
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /openwhisk-package-alarms/action/npm-debug.log

I found no similar issue related to npm error on github. Does anyone now how to fix this?

PS: Previously I installed openwhisk successfully but some other issue occurred that required to restart docker, after which wsk action xxxdid not work, so I tried to reinstall openwhisk, then comes to this issue.

I have the same error with you. installPackages/myTask.sh, leds to the error. Howerver, I don't know nodejs and npm, and don't know how to solve this error.

DanielLee343 commented 2 years ago

I think it's the university/department servers' problem that is blocking github/NPM accessing within pods. When I follow the exact steps on EC2, it's perfectly fine.

linuswagner commented 2 years ago

I have the same error, but adding apiHostProto: "https" didn't work

[lyuze@storage-2 openwhisk-deploy-kube]$ kubectl get pods -n openwhisk --watch
NAME                                                         READY   STATUS      RESTARTS   AGE
owdev-alarmprovider-5d57d4b879-hdn5r                         1/1     Running     0          3m38s
owdev-apigateway-d6d756db8-74bmn                             1/1     Running     0          3m38s
owdev-controller-0                                           1/1     Running     0          3m38s
owdev-couchdb-89b8469bc-xzpls                                1/1     Running     0          3m38s
owdev-gen-certs-42q94                                        0/1     Completed   0          3m38s
owdev-init-couchdb-czsg7                                     0/1     Completed   0          3m38s
owdev-install-packages-6nzjt                                 0/1     Error       0          88s
owdev-install-packages-jdrs8                                 0/1     Error       0          3m38s
owdev-install-packages-sr66x                                 0/1     Error       0          118s
owdev-install-packages-vpb9q                                 0/1     Error       0          68s
owdev-invoker-0                                              1/1     Running     0          3m38s
owdev-kafka-0                                                1/1     Running     0          3m38s
owdev-kafkaprovider-7867778f74-j8z82                         1/1     Running     0          3m38s
owdev-nginx-67b8974c77-775kd                                 1/1     Running     0          3m38s
owdev-redis-74d7479464-xw4q8                                 1/1     Running     0          3m38s
owdev-wskadmin                                               1/1     Running     0          3m38s
owdev-zookeeper-0                                            1/1     Running     0          3m38s
wskowdev-invoker-00-1-prewarm-nodejs14                       1/1     Running     0          2m22s
wskowdev-invoker-00-2-prewarm-nodejs14                       1/1     Running     0          2m22s
wskowdev-invoker-00-3-whisksystem-invokerhealthtestaction0   1/1     Running     0          2m22s
[lyuze@storage-2 openwhisk-deploy-kube]$ kubectl logs -n openwhisk owdev-install-packages-6nzjt
...
npm WARN alarmFeed@1.0.0 No description
npm WARN alarmFeed@1.0.0 No repository field.
npm WARN alarmFeed@1.0.0 No license field.
npm ERR! Linux 4.18.0-365.el8.x86_64
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! node v8.10.0
npm ERR! npm  v3.5.2
npm ERR! path /openwhisk-package-alarms/action/node_modules/.staging/@types/node-7154234c/package.json
npm ERR! code ENOTDIR
npm ERR! errno -20
npm ERR! syscall open

npm ERR! ENOTDIR: not a directory, open '/openwhisk-package-alarms/action/node_modules/.staging/@types/node-7154234c/package.json'
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /openwhisk-package-alarms/action/npm-debug.log

I found no similar issue related to npm error on github. Does anyone now how to fix this? PS: Previously I installed openwhisk successfully but some other issue occurred that required to restart docker, after which wsk action xxxdid not work, so I tried to reinstall openwhisk, then comes to this issue.

I have the same error with you. installPackages/myTask.sh, leds to the error. Howerver, I don't know nodejs and npm, and don't know how to solve this error.

see #735