Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MasterConfiguration should be changed to support more recent k8 #198

Closed
rvasilev opened this issue Oct 8, 2018 · 1 comment
Closed

MasterConfiguration should be changed to support more recent k8 #198

rvasilev opened this issue Oct 8, 2018 · 1 comment

Comments

@rvasilev
Copy link

rvasilev commented Oct 8, 2018

There were a number of changes in kubeadm configuration file structure between 1.9 and 1.11 (kubernetes/kubernetes#63788) and 1.11 to 1.12 (kubernetes/kubernetes#65945), because of this changing of k8 version in the source (#162, #197) will not work.

The easiest workaround IMO - to bump apiVersion: kubeadm.k8s.io/v1alpha2, set #162 to 1.11, create cluster and after that apply kubeadm upgrade to 1.12.

The more flexible way may be to templetize master.yaml or to provide different config generator function based on k8 version.

//GenerateMasterConfiguration generate the kubernetes config for master
func GenerateMasterConfiguration(masterNode Node, masterNodes, etcdNodes []Node) string {
masterConfigTpl := `apiVersion: kubeadm.k8s.io/v1alpha1
kind: MasterConfiguration
api:
advertiseAddress: %s
networking:
podSubnet: 10.244.0.0/16
apiServerCertSANs:
- %s
- 127.0.0.1
`
etcdConfig := `etcd:
endpoints:`
masterConfig := fmt.Sprintf(masterConfigTpl, masterNode.PrivateIPAddress, masterNode.IPAddress)
for _, node := range masterNodes {
masterConfig = fmt.Sprintf("%s%s\n", masterConfig, " - "+node.PrivateIPAddress)
}
if len(etcdNodes) > 0 {
masterConfig = masterConfig + etcdConfig + "\n"
for _, node := range etcdNodes {
masterConfig = fmt.Sprintf("%s%s\n", masterConfig, " - http://"+node.PrivateIPAddress+":2379")
}
}
return masterConfig
}

And the best way will be to support latest and previous stable version of k8s.

@xetys
Copy link
Owner

xetys commented Jan 29, 2019

This has happened in #243

@xetys xetys closed this as completed Jan 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants