Skip to content

Commit d37ac1d

Browse files
author
scott coulton
committed
first commit to add cri-containerd
final commit for cri_containerd
1 parent c450164 commit d37ac1d

File tree

3 files changed

+25
-4
lines changed

3 files changed

+25
-4
lines changed

tooling/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ RUN set -x && \
2525

2626
WORKDIR /mnt
2727

28-
ENTRYPOINT ["sh", "-c", "/etc/k8s/kube_tool.rb -f ${FQDN} -i ${IP} -b ${BOOTSTRAP_CONTROLLER_IP} -e ${ETCD_INITIAL_CLUSTER} -t ${ETCD_IP} -a ${KUBE_API_ADVERTISE_ADDRESS} -d ${INSTALL_DASHBOARD}"]
28+
ENTRYPOINT ["sh", "-c", "/etc/k8s/kube_tool.rb -o ${OS} -v ${VERSION} -r ${CONTAINER_RUNTIME} -f ${FQDN} -i ${IP} -b ${BOOTSTRAP_CONTROLLER_IP} -e ${ETCD_INITIAL_CLUSTER} -t ${ETCD_IP} -a ${KUBE_API_ADVERTISE_ADDRESS} -d ${INSTALL_DASHBOARD}"]

tooling/kube_tool.rb

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,22 @@
77
require_relative 'kube_tool/clean_up.rb'
88
require_relative 'kube_tool/other_params.rb'
99

10-
options = {:fqdn => nil, :ip => nil, :bootstrap_controller_ip => nil, :etcd_initial_cluster => nil, :etcd_ip => nil, :kube_api_advertise_address => nil, :install_dashboard => nil}
10+
options = {:os => nil, :version => nil, :container_runtime => nil, :fqdn => nil, :ip => nil, :bootstrap_controller_ip => nil, :etcd_initial_cluster => nil, :etcd_ip => nil, :kube_api_advertise_address => nil, :install_dashboard => nil}
1111

1212
parser = OptionParser.new do|opts|
13+
14+
opts.on('-o', '--os-type os-type', 'the os that kubernetes will run on') do |os|
15+
options[:os] = os;
16+
end
17+
18+
opts.on('-v', '--version version', 'the kubernetes version to install') do |version|
19+
options[:version] = version;
20+
end
21+
22+
opts.on('-r', '--container_runtime container runtime', 'the container runtime to use. this can only be docker or cri_containerd') do |container_runtime|
23+
options[:container_runtime] = container_runtime;
24+
end
25+
1326
opts.on('-f', '--fqdn fqdn', 'fqdn') do |fqdn|
1427
options[:fqdn] = fqdn;
1528
end
@@ -63,7 +76,7 @@ def build_hiera(hash)
6376
CreateCerts.kube_scheduler
6477
CreateCerts.kube_workers
6578
CreateToken.bootstrap
66-
OtherParams.create(hash[:bootstrap_controller_ip], hash[:fqdn], hash[:etcd_initial_cluster], hash[:etcd_ip], hash[:kube_api_advertise_address], hash[:install_dashboard])
79+
OtherParams.create(hash[:os], hash[:version], hash[:container_runtime], hash[:bootstrap_controller_ip], hash[:fqdn], hash[:etcd_initial_cluster], hash[:etcd_ip], hash[:kube_api_advertise_address], hash[:install_dashboard])
6780
CleanUp.remove_files
6881
end
6982
end

tooling/kube_tool/other_params.rb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,21 @@
22

33
class OtherParams
44

5-
def OtherParams.create(bootstrap_controller_ip, fqdn, etcd_initial_cluster, etcd_ip, kube_api_advertise_address, install_dashboard)
5+
def OtherParams.create(os, version, container_runtime, bootstrap_controller_ip, fqdn, etcd_initial_cluster, etcd_ip, kube_api_advertise_address, install_dashboard)
66
if install_dashboard.match('true')
77
install = true
88
else
99
install = false
1010
end
11+
if os.match('debian')
12+
kubernetes_package_version = "#{version}-00"
13+
elsif os.match('rhel')
14+
kubernetes_package_version = version
15+
end
1116
data = Hash.new
17+
data['kubernetes::kubernetes_version'] = version
18+
data['kubernetes::kubernetes_package_version'] = kubernetes_package_version
19+
data['kubernetes::container_runtime'] = container_runtime
1220
data['kubernetes::kubernetes_fqdn'] = fqdn
1321
data['kubernetes::bootstrap_controller_ip'] = bootstrap_controller_ip
1422
data['kubernetes::etcd_initial_cluster'] = etcd_initial_cluster

0 commit comments

Comments
 (0)