projectodd / openwhisk-openshift

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

Re: Common problem with deployment #36

Closed ryannix123 closed 6 years ago

ryannix123 commented 6 years ago

Hello,

I have a lot of images stuck in pending, which could be related to one of the common problems you listed. How do I run this command if I'm a non-privileged user on a non-minishift cluster? Thank you! @jcrossley3

minishift openshift config set --patch \ '{"admissionConfig": {"pluginConfig": {"openshift.io/ImagePolicy": {"configuration": {"apiVersion": "v1", "kind": "ImagePolicyConfig", "resolveImages": "AttemptRewrite"}}}}}'

ryannix123 commented 6 years ago

Here is a screen shot: https://nextcloud.sesp.northwestern.edu/index.php/s/b6od4zcdKzgbtdZ

Output from oc watch all

oc get all NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE deploy/alarmprovider 1 1 1 0 15m deploy/nginx 1 1 1 0 15m deploy/strimzi-cluster-controller 1 1 1 1 15m

NAME DESIRED CURRENT READY AGE rs/alarmprovider-76d5655b8 1 1 0 15m rs/nginx-c6f755db5 1 1 0 15m rs/strimzi-cluster-controller-865bdd6bb9 1 1 1 15m

NAME DESIRED CURRENT AGE statefulsets/controller 1 1 15m statefulsets/couchdb 1 1 15m statefulsets/invoker 1 1 15m statefulsets/strimzi-openwhisk-kafka 1 1 4m statefulsets/strimzi-openwhisk-zookeeper 1 1 15m

NAME DESIRED SUCCESSFUL AGE jobs/install-catalog 1 0 15m jobs/preload-openwhisk-runtimes 1 1 15m jobs/refresh-activations-1530276900 1 0 14m

NAME SCHEDULE SUSPEND ACTIVE LAST SCHEDULE AGE cronjobs/prune-activations 0 0 False 0 15m cronjobs/refresh-activations /5 False 1 14m 15m

NAME DOCKER REPO TAGS UPDATED imagestreams/action-java-8 docker.io/projectodd/action-java-8 15b9230,1d612c2,22d2f6c + 4 more... 15 minutes ago imagestreams/action-nodejs-6 docker.io/projectodd/action-nodejs-6 1d612c2,22d2f6c,2343561 + 4 more... 15 minutes ago imagestreams/action-nodejs-8 docker.io/projectodd/action-nodejs-8 046bfa5,15b9230,1d612c2 + 4 more... 15 minutes ago imagestreams/action-php-7 docker.io/projectodd/action-php-7 8ee5579,whisky,046bfa5 + 4 more... 15 minutes ago imagestreams/action-python-2 docker.io/projectodd/action-python-2 8ee5579,whisky,046bfa5 + 4 more... 15 minutes ago imagestreams/action-python-3 docker.io/projectodd/action-python-3 046bfa5,15b9230,1d612c2 + 4 more... 15 minutes ago imagestreams/alarmprovider docker.io/openwhisk/alarmprovider 1.9.8,1.9.9,latest + 4 more... 15 minutes ago imagestreams/alarms docker.io/projectodd/whisk_alarms 8ee5579,whisky,046bfa5 + 4 more... 15 minutes ago imagestreams/busybox docker.io/busybox whisky,1.28,1.28-glibc + 3 more... 15 minutes ago imagestreams/catalog docker.io/projectodd/whisk_catalog 22d2f6c,2343561,8ee5579 + 4 more... 15 minutes ago imagestreams/cluster-controller docker.io/strimzi/cluster-controller 0.3.1,latest,whisky + 3 more... 15 minutes ago imagestreams/controller docker.io/projectodd/controller openshift-0.1.0,openshift-0.1.1,openshift-0.1.2 + 4 more... 15 minutes ago imagestreams/couchdb docker.io/projectodd/whisk_couchdb 046bfa5,15b9230,1d612c2 + 4 more... 15 minutes ago imagestreams/dockerskeleton docker.io/projectodd/dockerskeleton 15b9230,1d612c2,22d2f6c + 4 more... 15 minutes ago imagestreams/invoker docker.io/projectodd/invoker openshift-0.1.1,openshift-0.1.2,openshift-3772c34 + 4 more... 15 minutes ago imagestreams/nginx centos/nginx-112-centos7 latest,whisky,1 + 1 more... 15 minutes ago

NAME HOST/PORT PATH SERVICES PORT TERMINATION WILDCARD routes/openwhisk openwhisk-openwhisk.apps.cloudapps.northwestern.edu nginx http edge/Redirect None

NAME READY STATUS RESTARTS AGE po/alarmprovider-76d5655b8-glcc8 0/1 Pending 0 15m po/controller-0 0/1 Running 5 15m po/couchdb-0 1/1 Running 0 15m po/invoker-0 0/1 Pending 0 15m po/nginx-c6f755db5-5d78c 0/1 Init:0/1 0 15m po/preload-openwhisk-runtimes-wfk95 0/1 Completed 0 15m po/refresh-activations-1530276900-45k4c 0/1 Pending 0 14m po/strimzi-cluster-controller-865bdd6bb9-9pbhv 1/1 Running 0 15m po/strimzi-openwhisk-kafka-0 0/1 Pending 0 4m po/strimzi-openwhisk-zookeeper-0 1/1 Running 0 15m

NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE svc/controller ClusterIP None 8080/TCP 15m svc/couchdb ClusterIP 172.30.84.66 5984/TCP 15m svc/couchdb-headless ClusterIP None 5984/TCP 15m svc/nginx NodePort 172.30.90.44 80:30211/TCP,8443:30600/TCP 15m svc/strimzi-openwhisk-kafka ClusterIP 172.30.179.206 9092/TCP,9091/TCP 4m svc/strimzi-openwhisk-kafka-headless ClusterIP None 9092/TCP,9091/TCP 4m svc/strimzi-openwhisk-zookeeper ClusterIP 172.30.19.97 2181/TCP 15m svc/strimzi-openwhisk-zookeeper-headless ClusterIP None 2181/TCP,2888/TCP,3888/TCP 15m

MohamedElso commented 6 years ago

hi, what is the errors do you have in the pods logs? Thanks

jcrossley3 commented 6 years ago

Sorry you're having trouble @ryannix123 Unfortunately, if you're not running on minishift, you're going to have to enlist the help of your cluster admin to set that ImagePolicyConfig. Our use of ImageStreams is a bit of a hack, tbh, and I think we're going to revert them back to normal images. Hopefully, that will get you going without needing the admin privs. I believe there's an upstream OpenShift bug causing this particular issue. You might check with those guys, but try your admin first.

ryannix123 commented 6 years ago

Fortunately, I am the cluster admin so I can make this change to the single-node cluster I'm running. Thanks, @jcrossley3 !

ryannix123 commented 6 years ago

@jcrossley3 Sorry to bug you again, but how to deploy this patch on an actual cluster? I've read https://blog.openshift.com/working-openshift-configurations/ and I still can't seem to figure it out.

MohamedElso commented 6 years ago

@ryannix123 i think you need to add this config. in this file( master-config.yaml )and then restart $ systemctl restart atomic-openshift-master Thanks

ryannix123 commented 6 years ago

Ah, thank makes sense. Thanks, @MohamedElso

So basically I have to edit this area of the YAML file:

admissionConfig:
  pluginConfig:
    BuildDefaults:
      configuration:
        apiVersion: v1
        env: []
        kind: BuildDefaultsConfig
        resources:
          limits: {}
          requests: {}

with

'{"admissionConfig": {"pluginConfig": {"openshift.io/ImagePolicy": {"configuration": {"apiVersion": "v1", "kind": "ImagePolicyConfig", "resolveImages": "AttemptRewrite"}}}}}'