Browse Source

Using ca-bundle.crt to connect to local etcd if master.etcd-ca.crt DNE

ewolinetz 7 years ago
parent
commit
afdf701f9e

+ 7 - 0
roles/openshift_service_catalog/tasks/install.yml

@@ -86,6 +86,12 @@
     resource_name: admin
     user: "system:serviceaccount:kube-service-catalog:default"
 
+- name: Checking for master.etcd-ca.crt
+  stat:
+    path: /etc/origin/master/master.etcd-ca.crt
+  register: etcd_ca_crt
+  check_mode: no
+
 ## api server
 - template:
     src: api_server.j2
@@ -99,6 +105,7 @@
     memory_request: none
     cors_allowed_origin: localhost
     etcd_servers: "{{ openshift.master.etcd_urls | join(',') }}"
+    etcd_cafile: "{{ '/etc/origin/master/master.etcd-ca.crt' if etcd_ca_crt.stat.exists else '/etc/origin/master/ca-bundle.crt' }}"
     node_selector: "{{ openshift_service_catalog_nodeselector | default ({'openshift-infra': 'apiserver'}) }}"
 
 - name: Set Service Catalog API Server daemonset

+ 1 - 1
roles/openshift_service_catalog/templates/api_server.j2

@@ -31,7 +31,7 @@ spec:
         - --etcd-servers
         - {{ etcd_servers }}
         - --etcd-cafile
-        - /etc/origin/master/master.etcd-ca.crt
+        - {{ etcd_cafile }}
         - --etcd-certfile
         - /etc/origin/master/master.etcd-client.crt
         - --etcd-keyfile