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

external etcd support #68

Merged
merged 10 commits into from Mar 16, 2018
Merged

external etcd support #68

merged 10 commits into from Mar 16, 2018

Conversation

jnummelin
Copy link
Contributor

@jnummelin jnummelin commented Mar 13, 2018

Support for external etcd configuration, needs top level etcd config in the cluster yaml.

TODOs:

  • certs for etcd
  • make sure it works with cri-o too
  • take in official 1.10 kubeadm when it's released. should come out next week or so

fixes #46

@jnummelin
Copy link
Contributor Author

Certificate setup seems to have some issue on kubeadm side: kubernetes/kubeadm#730

add some specs for master config generator

add etcd cert support

use certs for external etcd
@jnummelin
Copy link
Contributor Author

Should we wait for official 1.10 kubeadm or merge this with the "hack" to get 1.10.beta kubeadm in and have separate issue to fix that when official release comes out?

@jnummelin jnummelin changed the title [WIP] external etcd support external etcd support Mar 15, 2018
Gemfile.lock Outdated
@@ -0,0 +1,130 @@
PATH
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably should not be part of this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, I'll take it out

user: vagrant
role: master
ssh_key_path: ~/.vagrant.d/insecure_private_key
container_runtime: docker
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to define container_runtime, it defaults to docker.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but does not hurt either :)

options << "--apiserver-advertise-address #{@master.address}"
end
cfg = generate_config
tmp_file = File.join('/tmp', 'kubeadm.cfg.' + SecureRandom.hex(16))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be removed after init?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I'll make it happen

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@ssh.upload(StringIO.new(cfg.to_yaml), tmp_file)

# Copy etcd certs over if needed
exec_script('configure-etcd-certs.sh', {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the reasoning behind this vs using scp to transfer files?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't scp into /etc/.... This makes it happen without scp+exec('sudo mv ...')

# See: https://github.com/kubernetes/kubernetes/pull/59057
# FIXME Remove when we're using official 1.10 kubeadm
curl -o /usr/bin/kubeadm https://storage.googleapis.com/kubernetes-release/release/v1.10.0-beta.3/bin/linux/amd64/kubeadm
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

amd64 is hardcoded.. should probably be <%= arch.name %>.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And if we download binary we don't need kubeadm from repos?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to figure out the arch in the script itself as it is running on the actual host. Makes it more robust IMO.

We need also some kubeadm version override to hande this kind of case where we run different versions of kubeadm and kube itself.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -0,0 +1,116 @@
require "kupo/config"
require "kupo/phases/configure_master"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leftovers from earlier style of cert handling, removed now



describe '#call' do

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something missing here?

@jnummelin
Copy link
Contributor Author

fixed all the commented issues, PTAL @jakolehm

curl -o /usr/bin/kubeadm https://storage.googleapis.com/kubernetes-release/release/v1.10.0-beta.3/bin/linux/amd64/kubeadm
# Get kubeadm binary directly
arch=`uname -m`
case "$arch" in
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant that arch should come as a variable from phase. We already collect host.cpu_arch information.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@jakolehm jakolehm added the enhancement New feature or request label Mar 16, 2018
@jakolehm jakolehm added this to the 0.3 milestone Mar 16, 2018
Copy link
Contributor

@jakolehm jakolehm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs missing (README).

README.md Outdated
@@ -50,6 +50,25 @@ You can view full sample of cluster.yml [here](./cluster.example.yml).
- `pod_network_cidr` - IP address range for the pod network. (default "10.32.0.0/12")
- `trusted_subnets` - array of trusted subnets where overlay network can be used without IPSEC.

## Using external Etcd

Kupo can spin up Kubernetes using an externally managed Etcd. In this case you need to define the external etcd details in your `cluster.yml` file:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Etcd -> etcd (lowercase)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@jnummelin jnummelin merged commit 5be93dd into master Mar 16, 2018
@jnummelin jnummelin deleted the feature/external-etcd branch March 16, 2018 07:35
This was referenced Mar 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

External etcd support
2 participants