ansibleplaybookbundle / mediawiki-apb Goto Github PK
View Code? Open in Web Editor NEWAn APB which deploys Mediawiki
An APB which deploys Mediawiki
So while playing around with the mediawiki-apb, I realized that if you're using GlusterFS via Heketi, that it will fail to deploy due to a name length greater than 63 chars while creating a Service object. Unfortunately, this isn't part of the APB deployment, but rather part of the GlusterFS/Heketi service within Kubernetes generating a Service object which results in too long of a name.
The problem is that Kubernetes creates the Service object by prepending glusterfs-dynamic-
to the front of the app_name
value from the Provisioned Service / Deployment. This then results in a name which is much longer than 63 chars, and results in the application failing to deploy.
Instead of the current default value of app_name
which looks like this:
app_name: "mediawiki-{{ _apb_service_instance_id }}"
I'd like to suggest we create a shorter version of that same thing. The solution I've been using is this:
app_name: "mediawiki-{{ _apb_service_instance_id.split('-')[0] }}"
I'm not sure what the impact of this would be long term, or in practice. I'm not sure if this would cause issues with people creating a lot of these applications programmatically in the same namespace, or if that is really even a situation we need to worry about? Obviously we could get conflicts since we're lobbing off a bunch of data on the end. We could still add another label to the deployments with the full service_instance_id attached to it if that seemed necessary.
Looking for thoughts, as I think this is a problem across a lot of the applications. The mariadb-apb
seems to be ok, which means the alternate solution is that all APB names need to be 11 chars or less (not ideal).
Ran into an issue with the apb test
command on this project. I was really just trying to make sure that the apb test
command functioned as it should from the apb tool's perspective. Logs from the apb pod below:
(apb) ➜ ansible-playbook-bundle git:(run-command) ✗ oc logs -n apb-test-mediawiki-apb apb-test-mediawiki-apbmszfw
+ [[ test --extra-vars {"namespace": "apb-test-mediawiki-apb"} == *\s\2\i\/\a\s\s\e\m\b\l\e* ]]
+ ACTION=test
+ shift
+ playbooks=/opt/apb/actions
+ CREDS=/var/tmp/bind-creds
+ TEST_RESULT=/var/tmp/test-result
+ whoami
+ '[' -w /etc/passwd ']'
++ id -u
+ echo 'apb:x:1000180000:0:apb user:/opt/apb:/sbin/nologin'
+ oc-login.sh
Attempting to login with a service account...
Logged into "https://kubernetes.default:443" as "system:serviceaccount:apb-test-mediawiki-apb:apb-test-mediawiki-apbjlh4r" using the token provided.
You have one project on this server: "apb-test-mediawiki-apb"
Using project "apb-test-mediawiki-apb".
Welcome! See 'oc help' to get started.
+ set +x
+ [[ -e /opt/apb/actions/test.yaml ]]
+ [[ -e /opt/apb/actions/test.yml ]]
+ ANSIBLE_ROLES_PATH=/etc/ansible/roles:/opt/ansible/roles
+ ansible-playbook /opt/apb/actions/test.yml --extra-vars '{"namespace": "apb-test-mediawiki-apb"}'
PLAY [test media wiki abp] *****************************************************
TASK [ansible.kubernetes-modules : Install latest openshift client] ************
skipping: [localhost]
TASK [Load default variables for testing] **************************************
ok: [localhost]
TASK [create project for namespace] ********************************************
ok: [localhost]
TASK [Run the provision role.] *************************************************
TASK [provision-mediawiki123-apb : create mediawiki123 route] ******************
changed: [localhost]
TASK [provision-mediawiki123-apb : create persistent volume claim] *************
changed: [localhost]
TASK [provision-mediawiki123-apb : create deployment config] *******************
changed: [localhost]
TASK [provision-mediawiki123-apb : create mediawiki123 service] ****************
changed: [localhost]
TASK [Run the verify role.] ****************************************************
TASK [verify-mediawiki123-apb : url check for media wiki] **********************
fatal: [localhost]: FAILED! => {"cache_control": "private, max-age=0, no-cache, no-store", "changed": false, "connection": "close", "content": "<html>\n <head>\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n\n <style type=\"text/css\">\n /*!\n * Bootstrap v3.3.5 (http://getbootstrap.com)\n * Copyright 2011-2015 Twitter, Inc.\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n */\n /*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */\n html {\n font-family: sans-serif;\n -ms-text-size-adjust: 100%;\n -webkit-text-size-adjust: 100%;\n }\n body {\n margin: 0;\n }\n h1 {\n font-size: 1.7em;\n font-weight: 400;\n line-height: 1.3;\n margin: 0.68em 0;\n }\n * {\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n }\n *:before,\n *:after {\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n }\n html {\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n }\n body {\n font-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n line-height: 1.66666667;\n font-size: 13px;\n color: #333333;\n background-color: #ffffff;\n margin: 2em 1em;\n }\n p {\n margin: 0 0 10px;\n font-size: 13px;\n }\n .alert.alert-info {\n padding: 15px;\n margin-bottom: 20px;\n border: 1px solid transparent;\n background-color: #f5f5f5;\n border-color: #8b8d8f;\n color: #363636;\n margin-top: 30px;\n }\n .alert p {\n padding-left: 35px;\n }\n a {\n color: #0088ce;\n }\n\n ul {\n position: relative;\n padding-left: 51px;\n }\n p.info {\n position: relative;\n font-size: 15px;\n margin-bottom: 10px;\n }\n p.info:before, p.info:after {\n content: \"\";\n position: absolute;\n top: 9%;\n left: 0;\n }\n p.info:before {\n content: \"i\";\n left: 3px;\n width: 20px;\n height: 20px;\n font-family: serif;\n font-size: 15px;\n font-weight: bold;\n line-height: 21px;\n text-align: center;\n color: #fff;\n background: #4d5258;\n border-radius: 16px;\n }\n\n @media (min-width: 768px) {\n body {\n margin: 4em 3em;\n }\n h1 {\n font-size: 2.15em;}\n }\n\n </style>\n </head>\n <body>\n <div>\n <h1>Application is not available</h1>\n <p>The application is currently not serving requests at this endpoint. It may not have been started or is still starting.</p>\n\n <div class=\"alert alert-info\">\n <p class=\"info\">\n Possible reasons you are seeing this page:\n </p>\n <ul>\n <li>\n <strong>The host doesn't exist.</strong>\n Make sure the hostname was typed correctly and that a route matching this hostname exists.\n </li>\n <li>\n <strong>The host exists, but doesn't have a matching path.</strong>\n Check if the URL path was typed correctly and that the route was created using the desired path.\n </li>\n <li>\n <strong>Route and path matches, but all pods are down.</strong>\n Make sure that the resources exposed by this route (pods, services, deployment configs, etc) have at least one pod running.\n </li>\n </ul>\n </div>\n </div>\n </body>\n</html>\n", "content_type": "text/html", "failed_when_result": true, "msg": "Status code was not [200]: HTTP Error 503: Service Unavailable", "pragma": "no-cache", "redirected": false, "status": 503, "url": "http://mediawiki123-apb-test-mediawiki-apb.172.17.0.1.nip.io"}
to retry, use: --limit @/opt/apb/actions/test.retry
PLAY RECAP *********************************************************************
localhost : ok=6 changed=4 unreachable=0 failed=1
+ EXIT_CODE=2
+ set +ex
+ '[' -f /var/tmp/test-result ']'
+ exit 2
I've created an OpenShift project with this APB. I use OpenShift 3 Starter and console web. Build is OK. Deployment is OK. But hostname redirects to Mediawiki. It redirects to "Red Hat Enterprise Linux Test Page".
Thank you.
Let's revisit the below and see if we can remove this hardcoded IP for k8s support.
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.