Bug 1158704
| Summary: | Broker fails to create HA DNS entry for application created highly available | ||
|---|---|---|---|
| Product: | OpenShift Container Platform | Reporter: | Miciah Dashiel Butler Masters <mmasters> |
| Component: | Node | Assignee: | chris alfonso <calfonso> |
| Status: | CLOSED ERRATA | QA Contact: | libra bugs <libra-bugs> |
| Severity: | medium | Docs Contact: | |
| Priority: | high | ||
| Version: | 2.2.0 | CC: | adellape, bleanhar, hbrock, jokerman, misalunk, mmccomas, pruan, xiama |
| Target Milestone: | --- | Keywords: | Reopened |
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | rubygem-openshift-origin-controller-1.31.5.2-1.el6op | Doc Type: | Bug Fix |
| Doc Text: |
Due a bug in the broker's controller library, DNS entries for high-availability applications were not created properly at creation time when using the broker REST API. This was inconsistent with the behavior when creating an application then performing the enable-ha or make-ha action on the existing application. This bug fix updates the controller, as a result the DNS entries are created properly. After applying this update, the openshift-broker service must be restarted.
|
Story Points: | --- |
| Clone Of: | Environment: | ||
| Last Closed: | 2014-12-10 13:24:43 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 1131518 | ||
I'm fixing this upstream https://github.com/openshift/origin-server/pull/5956 and will update once the patch is merged, and pulled into enterprise. This has been built in brew https://brewweb.devel.redhat.com/buildinfo?buildID=398700 Check on puddle [2.2.z/2014-11-20.1]
1. Allow ha and ha-dns on broker
# grep HA /etc/openshift/broker.conf
DEFAULT_ALLOW_HA="false"
ALLOW_HA_APPLICATIONS="true"
MANAGE_HA_DNS="true"
HA_DNS_PREFIX="ha-"
#oo-admin-ctl-user -l user --allowha true
2. Create two apps
#rhc app create phpapp1 php-5.4 -s
#rhc app create phpapp2 php-5.4 -s
3. make ha
#rhc app enable-ha phpapp1
#rhc app enable-ha phpapp2
4. Check the ha-dns
#host ha--phpapp2-xiaom.ose22-auto.com.cn
#host ha--phpapp1-xiaom.ose22-auto.com.cn
The output:
ha-phpapp2-xiaom.ose22-auto.com.cn is an alias for www.example.com.
www.example.com has address 93.184.216.119
www.example.com has IPv6 address 2606:2800:220:6d:26bf:1447:1097:aa7
ha-phpapp2-xiaom.ose22-auto.com.cn is an alias for www.example.com.
www.example.com has address 93.184.216.119
www.example.com has IPv6 address 2606:2800:220:6d:26bf:1447:1097:aa7
(In reply to Ma xiaoqiang from comment #5) > Check on puddle [2.2.z/2014-11-20.1] > > 1. Allow ha and ha-dns on broker > # grep HA /etc/openshift/broker.conf > DEFAULT_ALLOW_HA="false" > ALLOW_HA_APPLICATIONS="true" > MANAGE_HA_DNS="true" > HA_DNS_PREFIX="ha-" > #oo-admin-ctl-user -l user --allowha true > 2. Create two apps > #rhc app create phpapp1 php-5.4 -s > #rhc app create phpapp2 php-5.4 -s > > 3. make ha > #rhc app enable-ha phpapp1 > #rhc app enable-ha phpapp2 > > 4. Check the ha-dns > #host ha--phpapp2-xiaom.ose22-auto.com.cn > #host ha--phpapp1-xiaom.ose22-auto.com.cn > > The output: > ha-phpapp2-xiaom.ose22-auto.com.cn is an alias for www.example.com. > www.example.com has address 93.184.216.119 > www.example.com has IPv6 address 2606:2800:220:6d:26bf:1447:1097:aa7 > > ha-phpapp2-xiaom.ose22-auto.com.cn is an alias for www.example.com. > www.example.com has address 93.184.216.119 > www.example.com has IPv6 address 2606:2800:220:6d:26bf:1447:1097:aa7 5. create app with ha option #vim /usr/lib/ruby/gems/1.8/gems/rhc-1.31.3.1/lib/rhc/commands/app.rb + 604 app_options[:ha] = true # rhc app create phpapp5 php-5.4 -s --no-git 6. # host ha-phpapp5-xiaom.ose22-auto.com.cn ha-phpapp5-xiaom.ose22-auto.com.cn is an alias for www.example.com. www.example.com has address 93.184.216.119 www.example.com has IPv6 address 2606:2800:220:6d:26bf:1447:1097:aa7 Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2014-1979.html |
Description of problem: If I use the broker's REST API to create a new application highly available, the broker does not create an HA DNS record for the application. This is inconsistent with the behaviour when I make a new application and then perform the enable-ha/make-ha action on the existing application. How reproducible: Consistently. Steps to Reproduce: 1. Install OpenShift Enterprise 2.2 PaaS with HA applications enabled and HA enabled for some user. 2. Create a scalable application using `rhc app create testapp8 php-5.4 --no-git -s` using the PaaS and user created in Step 1. 3. Verify that the application created in Step 2 was created successfully and is scalable with 1 gear using `rhc app show testapp8`. 4. Check whether the application created in Step 2 has an HA DNS record using `host ha-testapp8-ose.apps.example.com`. 5. Make the application created in Step 2 HA using `rhc app enable-ha testapp8`. 6. Verify that the application created in Step 2 now has two gears using `rhc app show testapp8`. 7. Verify that the application created in Step 2 now has an HA DNS record using `host ha-testapp8-ose.apps.example.com`. 8. Modify rhc to create new applications HA. 9. Create a new scalable, HA application using `rhc app create testapp9 php-5.4 --no-git -s` on the PaaS created in Step 1. 10. Verify that the application created in Step 9 was created successfully and is scalable with 2 gears (indicating that it is indeed HA) using `rhc app show testapp9`. 11. Check whether the application created in Step 9 has an HA DNS record using `host ha-testapp9-ose.apps.example.com`. Actual results: Step 1: # grep HA /etc/openshift/broker.conf DEFAULT_ALLOW_HA="false" ALLOW_HA_APPLICATIONS="true" # Should OpenShift handle the registration and deregistration of HA DNS entries pointing to the external router? # Set this to "true" if you want OpenShift to create/delete HA DNS entries upon application creation/deletion. # When using an external router, if this flag is set to "false", the HA DNS entries will need to be created externally. MANAGE_HA_DNS="true" # This is the public hostname that the HA DNS entries for an application point to # http://${HA_DNS_PREFIX}${APP_NAME}-${DOMAIN_NAME}${HA_DNS_SUFFIX}.${CLOUD_DOMAIN} HA_DNS_PREFIX="ha-" HA_DNS_SUFFIX="" ALLOW_MULTIPLE_HAPROXY_ON_NODE="false" # oo-admin-ctl-user -l demo --allowha true User demo already has HA set to true User demo: plan: consumed domains: 3 max domains: 10 consumed gears: 18 max gears: 100 max tracked storage per gear: 0 max untracked storage per gear: 0 max teams: 0 viewing all global teams allowed: false gear sizes: small sub accounts allowed: false private SSL certificates allowed: false inherit gear sizes: false HA allowed: true # Step 2: # rhc app create testapp8 php-5.4 --no-git -s Application Options ------------------- Domain: ose Cartridges: php-5.4 Gear Size: default Scaling: yes Creating application 'testapp8' ... done Waiting for your DNS name to be available ... done Your application 'testapp8' is now available. URL: http://testapp8-ose.apps.example.com/ SSH to: 54515cb124d7b1e73b000001.example.com Git remote: ssh://54515cb124d7b1e73b000001.example.com/~/git/testapp8.git/ Run 'rhc show-app testapp8' for more details about your app. Step 3: # rhc app show testapp8 testapp8 @ http://testapp8-ose.apps.example.com/ (uuid: 54515cb124d7b1e73b000001) ------------------------------------------------ Domain: ose Created: 5:31 PM Gears: 1 (defaults to small) Git URL: ssh://54515cb124d7b1e73b000001.example.com/~/git/testapp8.git/ SSH: 54515cb124d7b1e73b000001.example.com Deployment: auto (on git push) haproxy-1.4 (Web Load Balancer) ------------------------------- Gears: Located with php-5.4 php-5.4 (PHP 5.4) ----------------- Scaling: x1 (minimum: 1, maximum: available) on small gears Step 4: # host ha-testapp8-ose.apps.example.com Host ha-testapp8-ose.apps.example.com not found: 3(NXDOMAIN) Step 5: # rhc app enable-ha testapp8 RESULT: testapp8 is now highly available Step 6: # rhc app show testapp8 testapp8 @ http://testapp8-ose.apps.example.com/ (uuid: 54515cb124d7b1e73b000001) ------------------------------------------------ Domain: ose Created: 5:31 PM Gears: 2 (defaults to small) Git URL: ssh://54515cb124d7b1e73b000001.example.com/~/git/testapp8.git/ SSH: 54515cb124d7b1e73b000001.example.com Deployment: auto (on git push) haproxy-1.4 (Web Load Balancer) ------------------------------- Gears: Located with php-5.4 php-5.4 (PHP 5.4) ----------------- Scaling: x2 (minimum: 2, maximum: available) on small gears Step 7: # host ha-testapp8-ose.apps.example.com ha-testapp8-ose.apps.example.com is an alias for www.example.com. www.example.com has IPv6 address 2606:2800:220:6d:26bf:1447:1097:aa7 Step 8: # vi /usr/lib/ruby/gems/1.8/gems/rhc-1.31.3.1/lib/rhc/commands/app.rb # diff -u /usr/lib/ruby/gems/1.8/gems/rhc-1.31.3.1/lib/rhc/commands/app.rb{.old,} --- /usr/lib/ruby/gems/1.8/gems/rhc-1.31.3.1/lib/rhc/commands/app.rb.old 2014-10-29 17:34:39.678187439 -0400 +++ /usr/lib/ruby/gems/1.8/gems/rhc-1.31.3.1/lib/rhc/commands/app.rb 2014-10-29 17:35:08.080182979 -0400 @@ -600,6 +600,7 @@ app_options[:deployment_branch] = deployment_branch if deployment_branch app_options[:deployment_type] = deployment_type if deployment_type app_options[:region] = region if region + app_options[:ha] = true debug "Creating application '#{name}' with these options - #{app_options.inspect}" rest_domain.add_application(name, app_options) rescue RHC::Rest::Exception => e Step 9: # rhc app create testapp9 php-5.4 --no-git -s Application Options ------------------- Domain: ose Cartridges: php-5.4 Gear Size: default Scaling: yes Creating application 'testapp9' ... done Waiting for your DNS name to be available ... done Your application 'testapp9' is now available. URL: http://testapp9-ose.apps.example.com/ SSH to: 54515da124d7b1e73b000035.example.com Git remote: ssh://54515da124d7b1e73b000035.example.com/~/git/testapp9.git/ Run 'rhc show-app testapp9' for more details about your app. Step 10: # rhc app show testapp9 testapp9 @ http://testapp9-ose.apps.example.com/ (uuid: 54515da124d7b1e73b000035) ------------------------------------------------ Domain: ose Created: 5:35 PM Gears: 2 (defaults to small) Git URL: ssh://54515da124d7b1e73b000035.example.com/~/git/testapp9.git/ SSH: 54515da124d7b1e73b000035.example.com Deployment: auto (on git push) haproxy-1.4 (Web Load Balancer) ------------------------------- Gears: Located with php-5.4 php-5.4 (PHP 5.4) ----------------- Scaling: x2 (minimum: 2, maximum: available) on small gears Step 11: # host ha-testapp9-ose.apps.example.com Host ha-testapp9-ose.apps.example.com not found: 3(NXDOMAIN) Expected results: At Step 11, we should see that the broker has added a DNS record ha-testapp9-ose.apps.example.com for the new HA application created in Step 9, the same that we see a DNS record ha-testapp8-ose.apps.example.com for the application that was made HA in Step 5. Additional info: The REST API that I am using (the "ha" flag when creating an application) is not documented in the REST API guide, and everything works fine if I first create the application and then make it HA, so I would consider this issue low priority. However, the API does take the ha property that halfway works (as shown above), and we have a testcase for this property: https://github.com/openshift/origin-server/blob/master/controller/app/controllers/applications_controller.rb#L59 https://github.com/openshift/origin-server/blob/master/broker/test/functional/application_test.rb#L150 The REST API guide only documents the API to make an existing application HA: https://access.redhat.com/documentation/en-US/OpenShift_Enterprise/2/html-single/REST_API_Guide/index.html#Make_an_Application_Highly_Available_HA This defect blocks resolution of bug 1131518.