@@ -77,8 +77,8 @@ def configure_puppet_server(controller, worker1, worker2)
7777 site_pp = <<-EOS
7878 node /#{ controller } / {
7979 class {'kubernetes':
80- kubernetes_version => '1.16 .6',
81- kubernetes_package_version => '1.16 .6',
80+ kubernetes_version => '1.20 .6',
81+ kubernetes_package_version => '1.20 .6',
8282 controller_address => "$::ipaddress:6443",
8383 container_runtime => 'docker',
8484 manage_docker => false,
@@ -262,7 +262,7 @@ def execute_agent(role)
262262 end
263263 if family =~ /redhat|centos/
264264 runtime = 'docker'
265- cni = 'flannel '
265+ cni = 'weave '
266266 [ 'controller' , 'worker1' , 'worker2' ] . each { |node |
267267 ENV [ 'TARGET_HOST' ] = target_roles ( node ) [ 0 ] [ :name ]
268268 run_shell ( 'setenforce 0 || true' )
@@ -283,7 +283,7 @@ def execute_agent(role)
283283
284284 ENV [ 'TARGET_HOST' ] = target_roles ( 'controller' ) [ 0 ] [ :name ]
285285 run_shell ( 'docker build -t kubetool:latest /etc/puppetlabs/code/environments/production/modules/kubernetes/tooling' )
286- run_shell ( "docker run --rm -v $(pwd)/hieradata:/mnt -e OS=#{ family } -e VERSION=1.16 .6 -e CONTAINER_RUNTIME=#{ runtime } -e CNI_PROVIDER=#{ cni } -e ETCD_INITIAL_CLUSTER=#{ hostname1 } :#{ int_ipaddr1 } -e ETCD_IP=#{ int_ipaddr1 } -e ETCD_PEERS=[#{ int_ipaddr1 } ,#{ int_ipaddr2 } ,#{ int_ipaddr3 } ] -e KUBE_API_ADVERTISE_ADDRESS=#{ int_ipaddr1 } -e INSTALL_DASHBOARD=true kubetool:latest" )
286+ run_shell ( "docker run --rm -v $(pwd)/hieradata:/mnt -e OS=#{ family } -e VERSION=1.20 .6 -e CONTAINER_RUNTIME=#{ runtime } -e CNI_PROVIDER=#{ cni } -e ETCD_INITIAL_CLUSTER=#{ hostname1 } :#{ int_ipaddr1 } -e ETCD_IP=#{ int_ipaddr1 } -e ETCD_PEERS=[#{ int_ipaddr1 } ,#{ int_ipaddr2 } ,#{ int_ipaddr3 } ] -e KUBE_API_ADVERTISE_ADDRESS=#{ int_ipaddr1 } -e INSTALL_DASHBOARD=true kubetool:latest" )
287287 create_remote_file ( "nginx" , "/tmp/nginx.yml" , nginx )
288288 create_remote_file ( "hiera" , "/etc/puppetlabs/puppet/hiera.yaml" , hiera )
289289 run_shell ( 'chmod 644 /etc/puppetlabs/puppet/hiera.yaml' )
@@ -299,7 +299,7 @@ def execute_agent(role)
299299 end
300300
301301 if family =~ /redhat|centos/
302- run_shell ( "echo 'kubernetes::cni_network_provider: https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml ' >> /etc/puppetlabs/code/environments/production/hieradata/#{ family . capitalize } .yaml" )
302+ run_shell ( "echo 'kubernetes::cni_network_provider: https://cloud.weave.works/k8s/net?k8s-version=1.20.6 ' >> /etc/puppetlabs/code/environments/production/hieradata/#{ family . capitalize } .yaml" )
303303 end
304304
305305 run_shell ( "echo 'kubernetes::schedule_on_controller: true' >> /etc/puppetlabs/code/environments/production/hieradata/#{ family . capitalize } .yaml" )
0 commit comments