ansibleplaybookbundle / hello-world-apb

An APB which deploys a sample Hello World! application
3 stars 10 forks source link

Deployment in version "v1" cannot be handled as a Deployment: no kind "Deployment" is registered for version "v1","reason":"BadRequest #7

Closed cmoulliard closed 6 years ago

cmoulliard commented 6 years ago

Infos

When I execute this command at the root of this project , I get this error

make openshift-test         
make: shuf: Command not found
#
oc login --token=vPko7QPIrN3AYR2r00lMGfHU1lsj5K-Mg_W6Xw_xla0
Logged into "https://192.168.65.5:8443" as "admin" using the token provided.

You have access to the following projects and can switch between them with 'oc project <projectname>':

  * default
    demo
    kube-public
    kube-system
    myproject
    openshift
    openshift-infra
    openshift-node
    openshift-web-console

Using project "default".
oc new-project test-666
Now using project "test-666" on server "https://192.168.65.5:8443".

You can add applications to this project with the 'new-app' command. For example, try:

    oc new-app centos/ruby-22-centos7~https://github.com/openshift/ruby-ex.git

to build a new example application in Ruby.
docker login -u admin -p vPko7QPIrN3AYR2r00lMGfHU1lsj5K-Mg_W6Xw_xla0 172.30.1.1:5000
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
Login Succeeded
docker tag ansibleplaybookbundle/hello-world-apb:centos7-v0.1 172.30.1.1:5000/test-666/hello-world-apb
docker push 172.30.1.1:5000/test-666/hello-world-apb
The push refers to a repository [172.30.1.1:5000/test-666/hello-world-apb]
6ab2554e5d14: Layer already exists 
8610a6b94ac7: Layer already exists 
58d0588ffe22: Layer already exists 
d47462ed4744: Layer already exists 
a7adac873734: Layer already exists 
93152a8ddb8c: Layer already exists 
18ec667f3e2a: Layer already exists 
61f16038edb3: Layer already exists 
718fedf9f71d: Layer already exists 
e9436457c208: Layer already exists 
5c4eba674ae7: Layer already exists 
03f68d9d4963: Layer already exists 
42d12b259279: Layer already exists 
bdbfcc6ed135: Layer already exists 
feff30c11a2d: Layer already exists 
278bcde4bbb8: Layer already exists 
43e653f84b79: Layer already exists 
latest: digest: sha256:b87f73c42c5f8c410906706494831909b93cafd55186c1aa759d0e57376deb2b size: 3885
oc create sa apb
serviceaccount "apb" created
oc adm policy add-role-to-user admin -z apb
role "admin" added: "apb"
oc run hello-world-apb --image=172.30.1.1:5000/test-666/hello-world-apb --restart=Never --attach=true --overrides='{"apiVersion":"v1","spec":{"serviceAccountName":"apb"}}' -- provision -e namespace=test-666
If you don't see a command prompt, try pressing enter.
[DEPRECATION WARNING]: openshift_raw is kept for backwards compatibility but 
usage is discouraged. The module documentation details page may explain more 
about this rationale.. This feature will be removed in a future release. 
Deprecation warnings can be disabled by setting deprecation_warnings=False in 
ansible.cfg.
[DEPRECATION WARNING]: k8s_raw is kept for backwards compatibility but usage is
 discouraged. The module documentation details page may explain more about this
 rationale.. This feature will be removed in a future release. Deprecation 
warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
 [WARNING]: Found variable using reserved name: name

PLAY [hello-world-apb provision] ***********************************************

TASK [ansibleplaybookbundle.asb-modules : debug] *******************************
skipping: [localhost]

TASK [hello-world-apb : Update last operation] *********************************
skipping: [localhost]

TASK [hello-world-apb : deployment config state=present] ***********************
skipping: [localhost]

TASK [hello-world-apb : deployment state=present] ******************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was:     raise ApiException(http_resp=r)
fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n  File \"/tmp/ansible_4DVTVs/ansible_module_k8s_raw.py\", line 165, in <module>\n    main()\n  File \"/tmp/ansible_4DVTVs/ansible_module_k8s_raw.py\", line 161, in main\n    KubernetesRawModule().execute_module()\n  File \"/tmp/ansible_4DVTVs/ansible_modlib.zip/ansible/module_utils/k8s/raw.py\", line 83, in execute_module\n  File \"/tmp/ansible_4DVTVs/ansible_modlib.zip/ansible/module_utils/k8s/raw.py\", line 141, in perform_action\n  File \"/usr/lib/python2.7/site-packages/openshift-0.5.0-py2.7.egg/openshift/dynamic/client.py\", line 33, in inner
    raise api_exception(e)
openshift.dynamic.exceptions.BadRequestError: 400
Reason: Bad Request
HTTP response headers: HTTPHeaderDict({'Date': 'Thu, 31 May 2018 15:16:46 GMT', 'Content-Length': '234', 'Content-Type': 'application/json', 'Cache-Control': 'no-store'})
HTTP response body: {\"kind\":\"Status\",\"apiVersion\":\"v1\",\"metadata\":{},\"status\":\"Failure\",\"message\":\"Deployment in version \\\"v1\\\" cannot be handled as a Deployment: no kind \\\"Deployment\\\" is registered for version \\\"v1\\\"\",\"reason\":\"BadRequest\",\"code\":400}

Original traceback: 
File \"/usr/lib/python2.7/site-packages/openshift-0.5.0-py2.7.egg/openshift/dynamic/client.py\", line 31, in inner
    resp = func(self, resource, *args, **kwargs
  File \"/usr/lib/python2.7/site-packages/openshift-0.5.0-py2.7.egg/openshift/dynamic/client.py\", line 157, in create\n    return self.request('post', path, body=body, **kwargs)
  File \"/usr/lib/python2.7/site-packages/openshift-0.5.0-py2.7.egg/openshift/dynamic/client.py\", line 253, in request\n    _return_http_data_only=params.get('_return_http_data_only', True)
  File \"/usr/lib/python2.7/site-packages/kubernetes/client/api_client.py\", line 321, in call_api
    _return_http_data_only, collection_formats, _preload_content, _request_timeout)\n\n  File \"/usr/lib/python2.7/site-packages/kubernetes/client/api_client.py\", line 155, in __call_api
    _request_timeout=_request_timeout)\n\n  File \"/usr/lib/python2.7/site-packages/kubernetes/client/api_client.py\", line 364, in request\n    body=body)
  File \"/usr/lib/python2.7/site-packages/kubernetes/client/rest.py\", line 266, in POST    body=body)\n\n  File \"/usr/lib/python2.7/site-packages/kubernetes/client/rest.py\", line 222, in request\n    raise ApiException(http_resp=r)
", "module_stdout": "", "msg": "MODULE FAILURE", "rc": 1}

PLAY RECAP *********************************************************************
localhost                  : ok=0    changed=0    unreachable=0    failed=1   

pod test-666/hello-world-apb terminated (Error)
make: *** [openshift-test] Error 2