add kubernetes service route only for kubernetes nodes
Change-Id: Ib70cbfde510fa59e5f6ce818aa61a2db660380c3
diff --git a/classes/cluster/virtual-mcp11-k8s-calico/kubernetes/init.yml b/classes/cluster/virtual-mcp11-k8s-calico/kubernetes/init.yml
index 7755ad1..79b48da 100644
--- a/classes/cluster/virtual-mcp11-k8s-calico/kubernetes/init.yml
+++ b/classes/cluster/virtual-mcp11-k8s-calico/kubernetes/init.yml
@@ -55,6 +55,13 @@
linux:
network:
+ interface:
+ ens4:
+ route:
+ kubernetes_services:
+ address: 10.254.0.0
+ netmask: 255.255.0.0
+ gateway: ${_param:single_address}
resolv:
dns:
- 10.254.0.10
@@ -106,3 +113,17 @@
names:
- ${_param:kubernetes_monitor_node01_hostname}
- ${_param:kubernetes_monitor_node01_hostname}.${_param:cluster_domain}
+ system:
+ rc:
+ local: |
+ #!/bin/sh -e
+ #
+ # rc.local
+ #
+ ######### This file is managed by Salt! ##########
+ # This script is executed at the end of each multiuser runlevel.
+ # Make sure that the script will "exit 0" on success or any other
+ # value on error.
+ #
+ ip r a 10.254.0.0/16 dev ens4
+ exit 0