projectodd / openwhisk-openshift

Resources necessary for running OpenWhisk on OpenShift
Apache License 2.0
45 stars 26 forks source link

Template fails with OpenShift 4.0 #41

Open DonSchenck opened 5 years ago

DonSchenck commented 5 years ago

Get the following error (it's two lines in template.yml):

Error from server (BadRequest): the API version in the data (batch/v2alpha1) does not match the expected API version (batch/v1beta1) Error from server (BadRequest): the API version in the data (batch/v2alpha1) does not match the expected API version (batch/v1beta1)

faust64 commented 4 years ago

Try this:

--- template.yml    2019-11-10 11:35:17.786967428 +0100
+++ patched.yaml    2019-11-10 11:09:34.661364028 +0100
@@ -396,7 +396,7 @@
     labels:
       name: controller
   spec:
-    replicas: ${CONTROLLER_INSTANCES}
+    replicas: 1
     serviceName: "controller"
     template:
       metadata:
@@ -668,7 +668,7 @@
     labels:
       name: couchdb
   spec:
-    replicas: ${COUCHDB_INSTANCES}
+    replicas: 1
     serviceName: couchdb-headless
     template:
       metadata:
@@ -798,7 +798,7 @@
     labels:
       name: invoker
   spec:
-    replicas: ${INVOKER_INSTANCES}
+    replicas: 1
     serviceName: "invoker"
     template:
       metadata:
@@ -1362,7 +1362,7 @@
           volumeMounts:
           - name: alarmprovider-config
             mountPath: "/alarmprovider_config"
-- apiVersion: batch/v2alpha1
+- apiVersion: batch/v1beta1
   kind: CronJob
   metadata:
     name: refresh-activations
@@ -1397,7 +1397,7 @@
               image: busybox
               command: ['sh', '-c', 'until wget -T 5 --spider http://controller:8080/ping; do echo waiting for controller; sleep 2; done;']
               restartPolicy: Never
-- apiVersion: batch/v2alpha1
+- apiVersion: batch/v1beta1
   kind: CronJob
   metadata:
     name: prune-activations

Still, init seems to be stuck, the cluster controller would not recognize my cluster to be OpenShift?

$ oc get pods
NAME                                         READY   STATUS             RESTARTS   AGE
alarmprovider-7f854d6f57-95nfd               0/1     Init:1/2           0          24m
controller-0                                 0/1     Init:0/2           0          22m
couchdb-0                                    1/1     Running            0          22m
invoker-0                                    0/1     Init:0/2           0          22m
nginx-d4f9d4757-pszxn                        0/1     Init:0/1           0          24m
preload-openwhisk-runtimes-tm7mv             0/1     Completed          0          24m
refresh-activations-1573380600-wkspn         0/1     Init:0/1           0          20m
strimzi-cluster-controller-8755ff546-p9hrh   0/1     CrashLoopBackOff   9          24m
$ oc logs strimzi-cluster-controller-8755ff546-p9hrh
+ JAR=/cluster-controller.jar
+ shift
+ . /bin/dynamic_resources.sh
++ get_heap_size
+++ cat /sys/fs/cgroup/memory/memory.limit_in_bytes
++ CONTAINER_MEMORY_IN_BYTES=9223372036854771712
++ DEFAULT_MEMORY_CEILING=1152921504606846975
++ '[' 9223372036854771712 -lt 1152921504606846975 ']'
+ MAX_HEAP=
+ '[' -n '' ']'
+ export MALLOC_ARENA_MAX=2
+ MALLOC_ARENA_MAX=2
+ JAVA_OPTS=' -Dvertx.cacheDirBase=/tmp -Djava.security.egd=file:/dev/./urandom'
+ exec java -Dvertx.cacheDirBase=/tmp -Djava.security.egd=file:/dev/./urandom -jar /cluster-controller.jar -Dvertx.cacheDirBase=/tmp -Djava.security.egd=file:/dev/./urandom
2019-11-10 10:29:21 DEBUG Main:133 - https://kubernetes.default.svc/oapi returned 403. We are not on OpenShift.
2019-11-10 10:29:21 INFO  ClusterController:61 - Creating ClusterController for namespace openwhisk
2019-11-10 10:29:21 INFO  ClusterController:73 - Starting ClusterController for namespace openwhisk
2019-11-10 10:29:21 WARN  WatchConnectionManager:185 - Exec Failure: HTTP 403, Status: 403 - 
java.net.ProtocolException: Expected HTTP 101 response but was '403 Forbidden'
    at okhttp3.internal.ws.RealWebSocket.checkResponse(RealWebSocket.java:219)
    at okhttp3.internal.ws.RealWebSocket$2.onResponse(RealWebSocket.java:186)
    at okhttp3.RealCall$AsyncCall.execute(RealCall.java:153)
    at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
2019-11-10 10:29:21 INFO  ClusterController:189 - ConfigMap watcher failed to start
io.fabric8.kubernetes.client.KubernetesClientException: 
    at io.fabric8.kubernetes.client.dsl.internal.WatchConnectionManager$2.onFailure(WatchConnectionManager.java:189)
    at okhttp3.internal.ws.RealWebSocket.failWebSocket(RealWebSocket.java:546)
    at okhttp3.internal.ws.RealWebSocket$2.onResponse(RealWebSocket.java:188)
    at okhttp3.RealCall$AsyncCall.execute(RealCall.java:153)
    at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
2019-11-10 10:29:21 INFO  WatchConnectionManager:379 - Current reconnect backoff is 1000 milliseconds (T0)
2019-11-10 10:29:21 ERROR ClusterController:95 - ClusterController startup failed for namespace openwhisk
io.vertx.core.impl.NoStackTraceThrowable: ConfigMap watcher failed to start
2019-11-10 10:29:21 ERROR Main:97 - Cluster Controller verticle in namespace openwhisk failed to start
io.vertx.core.impl.NoStackTraceThrowable: ClusterController startup failed for namespace openwhisk

Running 4.2.2.

faust64 commented 4 years ago

Also, possible duplicate of projectodd/openwhisk-openshift#38