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

Errors in Init-couchdb Pod Because It Can't Initialize the DB Tables #723

Closed GitHubDiom closed 2 years ago

GitHubDiom commented 2 years ago

I'm trying to deploy Openwhisk on a Kubernetes cluster.

It seems the owdev-init-couchdb pod doesn't complete as the pod can't Initialize the DB tables.

$ kubectl get pod -n openwhisk
owdev-alarmprovider-5d57d4b879-kqsrr   0/1     Pending     0          8m50s
owdev-apigateway-74bc84bf5b-wfz5j      1/1     Running     0          8m50s
owdev-controller-0                     0/1     Init:0/2    0          8m50s
owdev-couchdb-96b96f985-95vbh          0/1     Pending     0          8m50s
owdev-gen-certs-86cdq                  0/1     Completed   0          8m50s
owdev-init-couchdb-c4x6b               0/1     Error       0          6m16s
owdev-init-couchdb-cnq8f               0/1     Error       0          8m50s
owdev-init-couchdb-n4w9k               0/1     Error       0          7m39s
owdev-init-couchdb-vfn5z               0/1     Error       0          4m52s
owdev-install-packages-jvrj8           0/1     Init:0/1    0          8m50s
owdev-invoker-0                        0/1     Init:0/1    0          8m50s
owdev-kafka-0                          0/1     Pending     0          8m50s
owdev-kafkaprovider-7867778f74-69hcs   0/1     Init:0/1    0          8m50s
owdev-nginx-5bdf969467-hdpx4           0/1     Init:0/1    0          8m50s
owdev-redis-78d4bc7dcc-wpbsn           0/1     Pending     0          8m50s
owdev-wskadmin                         1/1     Running     0          8m50s
owdev-zookeeper-0                      0/1     Pending     0          8m50s

The last pieces of the log

$ kubectl logs -n openwhisk owdev-init-couchdb-c4x6b
...
Monday 21 February 2022  13:43:35 +0000 (0:00:02.857)       0:00:02.904 ******* 
=============================================================================== 
Gathering Facts --------------------------------------------------------- 2.86s
/
Enabling single node cluster
Disabling reduce limits on views
/openwhisk/ansible /

PLAY [ansible] *****************************************************************

TASK [Gathering Facts] *********************************************************
Monday 21 February 2022  13:43:51 +0000 (0:00:00.053)       0:00:00.053 ******* 
ok: [ansible]

TASK [include_tasks] ***********************************************************
Monday 21 February 2022  13:43:53 +0000 (0:00:01.796)       0:00:01.850 ******* 
included: /openwhisk/ansible/tasks/initdb.yml for ansible

TASK [include_tasks] ***********************************************************
Monday 21 February 2022  13:43:53 +0000 (0:00:00.081)       0:00:01.931 ******* 
included: /openwhisk/ansible/tasks/db/recreateDb.yml for ansible

TASK [check if test_subjects with CouchDB exists] ******************************
Monday 21 February 2022  13:43:53 +0000 (0:00:00.092)       0:00:02.024 ******* 
fatal: [ansible]: FAILED! => {"changed": false, "connection": "close", "content": "", "content_length": "0", "msg": "Status code was 502 and not [200, 404]: HTTP Error 502: Bad Gateway", "redirected": false, "status": 502, "url": "http://owdev-couchdb.my-test.svc.cluster.local:5984/test_subjects"}

Status code was 502 and not [200, 404]: HTTP Error 502: Bad Gateway

PLAY RECAP *********************************************************************
ansible                    : ok=3    changed=0    unreachable=0    failed=1   

Monday 21 February 2022  13:43:59 +0000 (0:00:05.517)       0:00:07.542 ******* 
=============================================================================== 
check if test_subjects with CouchDB exists ------------------------------ 5.52s
Gathering Facts --------------------------------------------------------- 1.80s
include_tasks ----------------------------------------------------------- 0.09s
include_tasks ----------------------------------------------------------- 0.08s

I have looked for issues related to this problem, but none seems to be able to solve it.

It seems failed to check the existence of CouchDB in this, I tried to change the CNI from flannel to calico according #678, but the 502 Bad Gateway error is still here.

PS: In order to be able to access Github, I create a configmap called proxy-congfig as a PROXY, and added piece of code to couchdb-init-job.yaml as follows:

containers:
      - name: init-couchdb
        image: "{{- .Values.docker.registry.name -}}{{- .Values.utility.imageName -}}:{{- .Values.utility.imageTag -}}"

        # For github access
        envFrom:
                - configMapRef:
                         name: proxy-config

Could this be the cause of the problem?

GitHubDiom commented 2 years ago

Yes, the proxy-config is the cause of the issue It seems the init-CouchDB has to communicate with the CouchDB pod to initialize the DB tables, but my proxy has redirected the request thus introducing 502 Bad Gateway.