Przeglądaj źródła

fix dueling controllers - without controllerLeaseTTL set in config, multiple controllers will attempt to start

Jason DeTiberus 9 lat temu
rodzic
commit
a6dd874523

+ 2 - 0
inventory/byo/hosts.example

@@ -76,6 +76,8 @@ openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true',
 #openshift_master_cluster_public_hostname=openshift-ansible.test.example.com
 #openshift_master_cluster_vip=192.168.133.25
 #openshift_master_cluster_public_vip=192.168.133.25
+# Override the default controller lease ttl
+#osm_controller_lease_ttl=30
 
 # default subdomain to use for exposed routes
 #osm_default_subdomain=apps.test.example.com

+ 2 - 0
roles/openshift_master/handlers/main.yml

@@ -7,6 +7,8 @@
   service: name={{ openshift.common.service_type }}-master-api state=restarted
   when: openshift_master_ha | bool
 
+# TODO: need to fix up ignore_errors here
 - name: restart master controllers
   service: name={{ openshift.common.service_type }}-master-controllers state=restarted
   when: openshift_master_ha | bool
+  ignore_errors: yes

+ 1 - 0
roles/openshift_master/tasks/main.yml

@@ -64,6 +64,7 @@
       infra_nodes: "{{ num_infra | default(None) }}"
       disabled_features: "{{ osm_disabled_features | default(None) }}"
       master_count: "{{ openshift_master_count | default(None) }}"
+      controller_lease_ttl: "{{ osm_controller_lease_ttl | default(None) }}"
 
 - name: Install Master package
   yum: pkg={{ openshift.common.service_type }}-master state=present

+ 3 - 1
roles/openshift_master/templates/master.yaml.v1.j2

@@ -16,7 +16,9 @@ assetConfig:
     keyFile: master.server.key
     maxRequestsInFlight: 0
     requestTimeoutSeconds: 0
-controllerLeaseTTL: 0
+{% if openshift_master_ha | bool %}
+controllerLeaseTTL: {{ openshift.master.controller_lease_ttl | default('30') }}
+{% endif %}
 controllers: '*'
 corsAllowedOrigins:
 {% for origin in ['127.0.0.1', 'localhost', openshift.common.ip, openshift.common.public_ip] | union(openshift.common.all_hostnames) | unique %}