diff --git a/inventory/sample/group_vars/k8s_cluster/k8s-net-cilium.yml b/inventory/sample/group_vars/k8s_cluster/k8s-net-cilium.yml index da56c46e3ee4866f81eb8f97e8725fea87f8d9f0..18fc65f97686b35f75da2a98d54f22452f47dd57 100644 --- a/inventory/sample/group_vars/k8s_cluster/k8s-net-cilium.yml +++ b/inventory/sample/group_vars/k8s_cluster/k8s-net-cilium.yml @@ -152,6 +152,9 @@ cilium_l2announcements: false # Hubble ### Enable Hubble without install # cilium_enable_hubble: false +### Enable Hubble-ui +### Installed by default when hubble is enabled. To disable set to false +# cilium_enable_hubble_ui: "{{ cilium_enable_hubble }} ### Enable Hubble Metrics # cilium_enable_hubble_metrics: false ### if cilium_enable_hubble_metrics: true diff --git a/roles/network_plugin/cilium/defaults/main.yml b/roles/network_plugin/cilium/defaults/main.yml index fae0ceeae562cf8635f2de927d3a1115463f81e3..c55bdddcfa78dd54f211ba21740ccab696419524 100644 --- a/roles/network_plugin/cilium/defaults/main.yml +++ b/roles/network_plugin/cilium/defaults/main.yml @@ -144,6 +144,8 @@ cilium_ip_masq_resync_interval: 60s # Hubble ### Enable Hubble without install cilium_enable_hubble: false +### Enable Hubble-ui +cilium_enable_hubble_ui: "{{ cilium_enable_hubble }}" ### Enable Hubble Metrics cilium_enable_hubble_metrics: false ### if cilium_enable_hubble_metrics: true diff --git a/roles/network_plugin/cilium/templates/hubble/cr.yml.j2 b/roles/network_plugin/cilium/templates/hubble/cr.yml.j2 index 4a95565d2765db1cfad38a799b5dd45a0a5c5cd1..ee974b5e35bbafa2c9a4912bb1d0d7b81a9bdcf0 100644 --- a/roles/network_plugin/cilium/templates/hubble/cr.yml.j2 +++ b/roles/network_plugin/cilium/templates/hubble/cr.yml.j2 @@ -60,6 +60,7 @@ rules: - get - list - watch +{% if cilium_enable_hubble_ui %} --- # Source: cilium/templates/hubble-ui-clusterrole.yaml kind: ClusterRole @@ -104,3 +105,4 @@ rules: - get - list - watch +{% endif %} diff --git a/roles/network_plugin/cilium/templates/hubble/crb.yml.j2 b/roles/network_plugin/cilium/templates/hubble/crb.yml.j2 index f033429cecdd3946edde9adfd45bd2dec448420f..e5b8976e80eea07bd88064c3a7bafdb5eb33d066 100644 --- a/roles/network_plugin/cilium/templates/hubble/crb.yml.j2 +++ b/roles/network_plugin/cilium/templates/hubble/crb.yml.j2 @@ -28,6 +28,7 @@ subjects: - kind: ServiceAccount namespace: kube-system name: hubble-relay +{% if cilium_enable_hubble_ui %} --- # Source: cilium/templates/hubble-ui-clusterrolebinding.yaml kind: ClusterRoleBinding @@ -42,3 +43,4 @@ subjects: - kind: ServiceAccount namespace: kube-system name: hubble-ui +{% endif %} diff --git a/roles/network_plugin/cilium/templates/hubble/deploy.yml.j2 b/roles/network_plugin/cilium/templates/hubble/deploy.yml.j2 index f0153d64d93cb86b0fa775d78404879aaa1896d1..fbd3b2fa859e0436f8934c4a5dc59a8ba7f6dc1e 100644 --- a/roles/network_plugin/cilium/templates/hubble/deploy.yml.j2 +++ b/roles/network_plugin/cilium/templates/hubble/deploy.yml.j2 @@ -104,6 +104,7 @@ spec: name: tls {%- endif %} +{% if cilium_enable_hubble_ui %} --- # Source: cilium/templates/hubble-ui/deployment.yaml kind: Deployment @@ -195,3 +196,4 @@ spec: name: tls - emptyDir: {} name: tmp-dir +{% endif %} diff --git a/roles/network_plugin/cilium/templates/hubble/sa.yml.j2 b/roles/network_plugin/cilium/templates/hubble/sa.yml.j2 index 9b3203dbdf44f8f999698363bd3a9a5589bfa225..46de08179d4c49ce3873eadcc341eab257de04f4 100644 --- a/roles/network_plugin/cilium/templates/hubble/sa.yml.j2 +++ b/roles/network_plugin/cilium/templates/hubble/sa.yml.j2 @@ -14,6 +14,7 @@ kind: ServiceAccount metadata: name: hubble-relay namespace: kube-system +{% if cilium_enable_hubble_ui %} --- # Source: cilium/templates/hubble-ui-serviceaccount.yaml apiVersion: v1 @@ -21,3 +22,4 @@ kind: ServiceAccount metadata: name: hubble-ui namespace: kube-system +{% endif %} diff --git a/roles/network_plugin/cilium/templates/hubble/service.yml.j2 b/roles/network_plugin/cilium/templates/hubble/service.yml.j2 index 48e90b82518c136a8968cc4a9ba1cee11f629e93..982487cb023d17f65d0efa8119593b025710aa1c 100644 --- a/roles/network_plugin/cilium/templates/hubble/service.yml.j2 +++ b/roles/network_plugin/cilium/templates/hubble/service.yml.j2 @@ -68,6 +68,7 @@ spec: {% endif -%} targetPort: 4245 --- +{% if cilium_enable_hubble_ui %} # Source: cilium/templates/hubble-ui-service.yaml kind: Service apiVersion: v1 @@ -85,6 +86,7 @@ spec: targetPort: 8081 type: ClusterIP --- +{% endif %} # Source: cilium/templates/hubble/peer-service.yaml apiVersion: v1 kind: Service