ansibleplaybookbundle / hello-world-apb Goto Github PK
View Code? Open in Web Editor NEWAn APB which deploys a sample Hello World! application
An APB which deploys a sample Hello World! application
Error attempting to update pod with last operation annotation. Missing key from environment: 'POD_NAME'
complete logs:
# apb version
Version: apb-1.1.15
# docker run --rm --net=host -v $HOME/.kube:/opt/apb/.kube:z -u $UID docker.io/ansibleplaybookbundle/hello-world-apb provision --extra-vars 'namespace=hello-world'
Status: Downloaded newer image for docker.io/ansibleplaybookbundle/hello-world-apb:latest
+ [[ provision --extra-vars namespace=hello-world == *\s\2\i\/\a\s\s\e\m\b\l\e* ]]
+ ACTION=provision
+ shift
+ playbooks=/opt/apb/actions
+ CREDS=/var/tmp/bind-creds
+ TEST_RESULT=/var/tmp/test-result
+ whoami
+ set +x
+ [[ -e /opt/apb/actions/provision.yaml ]]
+ [[ -e /opt/apb/actions/provision.yml ]]
+ ANSIBLE_ROLES_PATH=/etc/ansible/roles:/opt/ansible/roles
+ ansible-playbook /opt/apb/actions/provision.yml --extra-vars namespace=hello-world
[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] *********************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Error attempting to update pod with last operation annotation. Missing key from environment: 'POD_NAME'"}
to retry, use: --limit @/opt/apb/actions/provision.retry
PLAY RECAP *********************************************************************
localhost : ok=0 changed=0 unreachable=0 failed=1
+ EXIT_CODE=2
+ set +ex
+ '[' -f /var/tmp/test-result ']'
+ exit 2
How does the value of the variable OPENSHIFT_TARGET
look like?
Whatever value I tried, I always have:
TASK [provision-hello-world-apb : create deployment config] ********************
fatal: [localhost]: FAILED! => {"changed": false, "error": null, "msg": "Failed to retrieve requested object: <urllib3.connection.VerifiedHTTPSConnection object at 0x4048650>: Failed to establish a new connection: [Errno 111] Connection refused"}
I tried my OpenShift Origin TCP addresses: 192.168.42.174:8443
and https://192.168.42.174:8443
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
I'm using that playbook as an example for our own APB here https://github.com/nuxeo-sandbox/nuxeo-apb-catalog/.
I'm figuring that using the {{_apb_service_instance_id}} to generate the resources name may lead to too long resources name (more than 63 characters) which ends up with the following error:
metadata.labels: Invalid value: "nuxeo-elasticsearch-f168d75e-aa07-41f9-98de-5e1037933c62-client-0": must be no more than 63 characters
With hello-world
, it's ok as the name is not very long but it becomes quite fast a very constraining limit if you intend to publish that sample as a blueprint. It seems that in Openshift, the service instances are using 5 characters long hash.
WDYT?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.