Browse Source

Merge pull request #9122 from nak3/heketi-url-svc

Use service name for heketi url
Vadim Rutkovsky 6 years ago
parent
commit
a4ec9d422a

+ 0 - 32
roles/openshift_storage_glusterfs/tasks/glusterfs_common.yml

@@ -282,22 +282,6 @@
     when:
     - glusterfs_heketi_admin_key is defined
 
-  - name: Get heketi route
-    oc_obj:
-      namespace: "{{ glusterfs_namespace }}"
-      kind: route
-      state: list
-      name: "heketi-{{ glusterfs_name }}"
-    register: heketi_route
-    when:
-    - glusterfs_heketi_is_native
-
-  - name: Determine StorageClass heketi URL
-    set_fact:
-      glusterfs_heketi_route: "{{ heketi_route.results.results[0]['spec']['host'] }}"
-    when:
-    - glusterfs_heketi_is_native
-
   - name: Generate GlusterFS StorageClass file
     template:
       src: "glusterfs-storageclass.yml.j2"
@@ -332,22 +316,6 @@
         data: "{{ glusterfs_heketi_admin_key }}"
     when: glusterfs_heketi_admin_key is defined
 
-  - name: Get heketi route
-    oc_obj:
-      namespace: "{{ glusterfs_namespace }}"
-      kind: route
-      state: list
-      name: "heketi-{{ glusterfs_name }}"
-    register: heketi_route
-    when:
-    - glusterfs_heketi_is_native
-
-  - name: Determine StorageClass heketi URL
-    set_fact:
-      glusterfs_heketi_route: "{{ heketi_route.results.results[0]['spec']['host'] }}"
-    when:
-    - glusterfs_heketi_is_native
-
   - name: Generate Gluster Block StorageClass file
     template:
       src: "gluster-block-storageclass.yml.j2"

+ 1 - 1
roles/openshift_storage_glusterfs/templates/gluster-block-storageclass.yml.j2

@@ -9,7 +9,7 @@ metadata:
 {% endif %}
 provisioner: gluster.org/glusterblock
 parameters:
-  resturl: "http://{% if glusterfs_heketi_is_native %}{{ glusterfs_heketi_route }}{% else %}{{ glusterfs_heketi_url }}:{{ glusterfs_heketi_port }}{% endif %}"
+  resturl: "http://{% if glusterfs_heketi_is_native %}heketi-{{ glusterfs_name }}.{{ glusterfs_namespace }}.svc:8080{% else %}{{ glusterfs_heketi_url }}:{{ glusterfs_heketi_port }}{% endif %}"
   restuser: "admin"
   chapauthenabled: "true"
   hacount: "3"

+ 1 - 1
roles/openshift_storage_glusterfs/templates/glusterfs-storageclass.yml.j2

@@ -9,7 +9,7 @@ metadata:
 {% endif %}
 provisioner: kubernetes.io/glusterfs
 parameters:
-  resturl: "http://{% if glusterfs_heketi_is_native %}{{ glusterfs_heketi_route }}{% else %}{{ glusterfs_heketi_url }}:{{ glusterfs_heketi_port }}{% endif %}"
+  resturl: "http://{% if glusterfs_heketi_is_native %}heketi-{{ glusterfs_name }}.{{ glusterfs_namespace }}.svc.svc.cluster.local:8080{% else %}{{ glusterfs_heketi_url }}:{{ glusterfs_heketi_port }}{% endif %}"
   restuser: "admin"
 {% if glusterfs_heketi_admin_key is defined %}
   secretNamespace: "{{ glusterfs_namespace }}"