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

Refactor rke config to current behavior #2149

Open
oskapt opened this issue Jul 2, 2020 · 4 comments
Open

Refactor rke config to current behavior #2149

oskapt opened this issue Jul 2, 2020 · 4 comments

Comments

@oskapt
Copy link

oskapt commented Jul 2, 2020

RKE version:

1.0.4

Steps to Reproduce:

➤ rke config -l -a
v1.15.9-rancher1-1
v1.16.6-rancher1-2
v1.17.2-rancher1-2
~/D/w/m/r/rke|master✓
➤ rke config --version v1.16.6-rancher1-2
[+] Cluster Level SSH Private Key Path [~/.ssh/id_rsa]:
[+] Number of Hosts [1]:
[+] SSH Address of host (1) [none]:
[+] SSH Port of host (1) [22]:
[+] SSH Private Key Path of host () [none]:
[-] You have entered empty SSH key path, trying fetch from SSH key parameter
[+] SSH Private Key of host () [none]:
[-] You have entered empty SSH key, defaulting to cluster level SSH key: ~/.ssh/id_rsa
[+] SSH User of host () [ubuntu]:
[+] Is host () a Control Plane host (y/n)? [y]:
[+] Is host () a Worker host (y/n)? [n]:
[+] Is host () an etcd host (y/n)? [n]:
[+] Override Hostname of host () [none]:
[+] Internal IP of host () [none]:
[+] Docker socket path on host () [/var/run/docker.sock]:
[+] Network Plugin Type (flannel, calico, weave, canal) [canal]:
[+] Authentication Strategy [x509]:
[+] Authorization Mode (rbac, none) [rbac]:
[+] Kubernetes Docker image [rancher/hyperkube:v1.17.2-rancher1]:
[+] Cluster domain [cluster.local]:
[+] Service Cluster IP Range [10.43.0.0/16]:
[+] Enable PodSecurityPolicy [n]:
[+] Cluster Network CIDR [10.42.0.0/16]:
[+] Cluster DNS Service IP [10.43.0.10]:
[+] Add addon manifest URLs or YAML files [no]:
~/D/w/m/r/rke|master✓
➤ grep kubernetes cluster.yml
  kubernetes_services_sidecar: rancher/rke-tools:v0.1.52
  kubernetes: rancher/hyperkube:v1.17.2-rancher1
kubernetes_version: ""

Results:

  1. The presented default is not hyperkube:v1.16.6-rancher1
  2. Regardless of version provided to rke config --version, kubernetes uses the default version in cluster.yml

-- Edit superseb --
This includes refactoring rke config to match the current standards:

  • Do not use system_images but use kubernetes_version
  • Make kubernetes_version configurable
  • Possibly recognize SSH agent auth socket environment variable and ask the user to use it
@superseb
Copy link
Contributor

superseb commented Jul 7, 2020

This option was added to support listing system-images per version:

			cli.StringFlag{
				Name:  "version",
				Usage: "Generate the default system images for specific k8s versions",
			},

If there is any documentation stating this can be used to setup the cluster yaml, this needs to be changed asap.

And in the process of fixing this, rke config needs to be refactored to use the latest best practices, e.g. using kubernetes_version vs setting system_images amongst other things that have changed in the past.

@oskapt
Copy link
Author

oskapt commented Jul 8, 2020

I don't know if there's any documentation, but here's the question - if each version of RKE can install three versions of Kubernetes, how do you get it to install anything other than the most recent one? It would seem like you would set this as part of rke config, and the --version flag that's available seems like the way you would do it.

@capta1nk1rk
Copy link

@superseb Lab 2 of Rancher Academy actually mentions the use of the rke config --versionfor configuring the kube version in part 1a. This should be removed from that lab writeup.

@superseb superseb changed the title rke config --version doesn't set install version Refactor rke config to current behavior Jan 15, 2021
@oskapt
Copy link
Author

oskapt commented Feb 8, 2021

@superseb Lab 2 of Rancher Academy actually mentions the use of the rke config --versionfor configuring the kube version in part 1a. This should be removed from that lab writeup.

I've removed this from Lab 2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants