summaryrefslogtreecommitdiff
path: root/roles/kubernetes/kubeadm/master/tasks/net_kubeguard.yml
diff options
context:
space:
mode:
Diffstat (limited to 'roles/kubernetes/kubeadm/master/tasks/net_kubeguard.yml')
-rw-r--r--roles/kubernetes/kubeadm/master/tasks/net_kubeguard.yml14
1 files changed, 12 insertions, 2 deletions
diff --git a/roles/kubernetes/kubeadm/master/tasks/net_kubeguard.yml b/roles/kubernetes/kubeadm/master/tasks/net_kubeguard.yml
index 95fee7c8..f364fb5f 100644
--- a/roles/kubernetes/kubeadm/master/tasks/net_kubeguard.yml
+++ b/roles/kubernetes/kubeadm/master/tasks/net_kubeguard.yml
@@ -1,3 +1,13 @@
---
-### kubeguard needs to be deployed before the cluster has been initialized.
-### there is nothing more todo here.
+- name: install kube-router variant
+ when: "kubernetes_network_plugin_variant == 'with-kube-router'"
+ block:
+ - name: generate kubeguard (kube-router) configuration
+ template:
+ src: "net_kubeguard/kube-router.{{ kubernetes_network_plugin_version }}.yml.j2"
+ dest: /etc/kubernetes/network-plugin.yml
+
+ - name: install kubeguard (kube-router) on to the cluster
+ command: kubectl --kubeconfig /etc/kubernetes/admin.conf apply -f /etc/kubernetes/network-plugin.yml
+ register: kubeguard_apply_result
+ changed_when: (kubeguard_apply_result.stdout_lines | reject("regex", " unchanged$") | list | length) > 0