StarpTech / k-andy

Low cost Kubernetes stack for startups, prototypes, and playgrounds on Hetzner Cloud.
MIT License
141 stars 20 forks source link

feat: convert into terraform module #6

Closed toabi closed 3 years ago

toabi commented 3 years ago

As discussed in #5, this makes it usable as a module. Major changes include:

Sure those are a lot of changes at once. Let me know what you think about it.

toabi commented 3 years ago

I added more features in single commits.

StarpTech commented 3 years ago

Awesome work! I have some small points:

toabi commented 3 years ago

I'll do all that tomorrow.

toabi commented 3 years ago
toabi commented 3 years ago

What do you think about enforcing https://www.conventionalcommits.org/en/v1.0.0/#summary from now on in this repository? I personally like it, because one can also autogenerate semantic versions and an okay changelog from them.

StarpTech commented 3 years ago

What do you think about enforcing conventionalcommits.org/en/v1.0.0/#summary from now on in this repository? I personally like it, because one can also autogenerate semantic versions and an okay changelog from them.

I like it too as long as it's automated and ensured. The repo has very low activity, not sure if it is worth it.

toabi commented 3 years ago

Jeah, let's leave that for the future.

I think I'm done with the tasks. Everything which was possible in the past is supported. Some parts are even easier (no need for own ssh key). It's a nice base I'll experiment more on. But for the first refactor I think this is a good start.

toabi commented 3 years ago

One thing I noticed: replacing servers is not working because of name collision. It's maybe better to add random IDs.

StarpTech commented 3 years ago

One thing I noticed: replacing servers is not working because of name collision. It's maybe better to add random IDs.

Good point. Let's do it.

toabi commented 3 years ago

It might even make sense to have a variable where you disable the initial bootstrap control plane and add "normal" agents which join the others. Because the cloud-init of the first one makes sense only once I guess. But I have to read a bit more about how the HA k3s control plane works/recovers.

StarpTech commented 3 years ago

One small point left: Add kubeconfig-*.yaml to gitignore apart from that 👍

toabi commented 3 years ago

One small point left: Add kubeconfig-*.yaml to gitignore apart from that 👍

There is https://github.com/toabi/k-andy/blob/feature/modularize/example/.gitignore#L3 - and in the main module it's not necessary because the config will be written where the module is used. It's not necessary anymore to checkout this repository, it can be just in any terraform project as:

module "some_cluster" {
  source = "git::https://github.com/toabi/k-andy.git?ref=feature/modularize"
  hcloud_token = "ABC"
  name = "demo"
  server_locations = ["nbg1", "fsn1"]
  agent_server_type = "cx11"
  agent_server_count = 3
  server_additional_packages = ["open-iscsi"]
}
StarpTech commented 3 years ago

I didn't see it, thanks.