-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[WIP] Kubeadm bootstrapper #1825
Conversation
bb49c11
to
ed66cd3
Compare
ed66cd3
to
384bc9b
Compare
Codecov Report
@@ Coverage Diff @@
## master #1825 +/- ##
==========================================
- Coverage 36.25% 30.58% -5.67%
==========================================
Files 51 70 +19
Lines 3462 4162 +700
==========================================
+ Hits 1255 1273 +18
- Misses 2024 2716 +692
+ Partials 183 173 -10
Continue to review full report at Codecov.
|
The command runner is a common interface for both commands ran on the host and ssh commands. Thsi way, the bootstrapper can set up the cluster, unaware of the vm-driver being a hypervisor or none.
5969a13
to
6649952
Compare
6649952
to
9926776
Compare
@@ -114,6 +116,10 @@ var settings = []Setting{ | |||
set: SetString, | |||
}, | |||
{ | |||
name: Bootstrapper, | |||
set: SetString, //TODO(r2d4): more validation here? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps validation function here that checks against a list of available bootstrappers
} | ||
|
||
func (k *KubeadmBootstrapper) RestartCluster(k8s bootstrapper.KubernetesConfig) error { | ||
if err := k.c.Run("rm -rf /etc/kubernets/*.conf"); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be /etc/kubernetes/*.conf
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. Maybe I can remove this if it wasn't doing anything
description: "logs -f", | ||
follow: true, | ||
}, | ||
// TODO(r2d4): fix this test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix
@@ -135,11 +136,31 @@ const ( | |||
) | |||
|
|||
const ( | |||
KubeletServiceFile = "/lib/systemd/system/kubelet.service" | |||
KubeletSystemdConfFile = "/etc/systemd/system/kubelet.service.d/10-kubeadm.conf" | |||
KubeadmConfigFile = "/var/lib/kubeadm.yaml" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
put in /etc/kubernetes
func DeleteFile(f assets.CopyableFile, client *ssh.Client) error { | ||
return RunCommand(client, GetDeleteFileCommand(f)) | ||
} | ||
func GetShell(session *ssh.Session, cmd string) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we actually need this
) | ||
|
||
// SSHSession provides methods for running commands on a host. | ||
type SSHSession interface { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where was this used?
} | ||
//TODO(r2d4): Move this test to bootstrapper package | ||
|
||
// func TestNewSSHClient(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix this
Is there something I can do to help/test? For context: I mainly use https://github.com/Mirantis/kubeadm-dind-cluster as it is very helpful to be able to get a |
@minikube-bot retest this please |
This branch is a bit out of a date now - as I split most of the changes into smaller PRs (command runner, localkube bootstrapped). The last part of this is just splitting out the kubeadm changes to a new PR, which I should hopefully get to soon. I've just been a bit busy with other things. |
I've rebased and opened up #1903 |
Some TODOs
phase alpha controlplane
command. This was recently merged.TODOs probably in scope for this PR
/data
)