From 6bff338bad2073b43b21d0f0545cf64aeee270f9 Mon Sep 17 00:00:00 2001
From: charlychiu <charlychiu@gmail.com>
Date: Wed, 2 Nov 2022 15:14:46 +0800
Subject: [PATCH] fix: hubble relay tls error (#9457)

---
 roles/network_plugin/cilium/templates/cilium/config.yml.j2 | 2 +-
 roles/network_plugin/cilium/templates/hubble/config.yml.j2 | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/roles/network_plugin/cilium/templates/cilium/config.yml.j2 b/roles/network_plugin/cilium/templates/cilium/config.yml.j2
index 313821ab1..7a524c6ba 100644
--- a/roles/network_plugin/cilium/templates/cilium/config.yml.j2
+++ b/roles/network_plugin/cilium/templates/cilium/config.yml.j2
@@ -175,7 +175,7 @@ data:
 {% endif %}
   hubble-listen-address: ":4244"
 {% if cilium_enable_hubble and cilium_hubble_install %}
-  hubble-disable-tls: "false"
+  hubble-disable-tls: "{% if cilium_hubble_tls_generate %}false{% else %}true{% endif %}"
   hubble-tls-cert-file: /var/lib/cilium/tls/hubble/server.crt
   hubble-tls-key-file: /var/lib/cilium/tls/hubble/server.key
   hubble-tls-client-ca-files: /var/lib/cilium/tls/hubble/client-ca.crt
diff --git a/roles/network_plugin/cilium/templates/hubble/config.yml.j2 b/roles/network_plugin/cilium/templates/hubble/config.yml.j2
index d9723db03..4f42abe85 100644
--- a/roles/network_plugin/cilium/templates/hubble/config.yml.j2
+++ b/roles/network_plugin/cilium/templates/hubble/config.yml.j2
@@ -16,7 +16,8 @@ data:
     tls-client-cert-file: /var/lib/hubble-relay/tls/client.crt
     tls-client-key-file: /var/lib/hubble-relay/tls/client.key
     tls-hubble-server-ca-files: /var/lib/hubble-relay/tls/hubble-server-ca.crt
-    disable-server-tls: true
+    disable-server-tls: {% if cilium_hubble_tls_generate %}false{% else %}true{% endif %}
+    disable-client-tls: {% if cilium_hubble_tls_generate %}false{% else %}true{% endif %}
 ---
 # Source: cilium/templates/hubble-ui-configmap.yaml
 apiVersion: v1
-- 
GitLab