Better HN
topnewbestaskshowjobs
Log inSign up

MathiasPius

598 karma · joined Apr 30, 2020 (6y ago) · 51 submissions

https://datavirke.dk

https://github.com/MathiasPius/

Submissions

comment 2y ago · link · parent

This is actually great. I maintain a library[1] for interacting with the Robot interface using Rust, but testing is heavily gated because of the potential costs it might incur, which is why a lot of the purchasing/cancellation APIs haven't been thoroughly tested.

With this billing, I'll be able to do thorough integration testing without breaking the bank.

And of course with hourly billing, horizontal scaling becomes much more feasible.

[1] https://github.com/MathiasPius/hrobot-rs

comment 3y ago · link · parent

This got me curious (and a bit worried) so I checked, and it seems like it might have been differently licensed for commercial use around the time you mention, but that no longer appears to be the case: https://caddy.community/t/caddy-license-for-commercial-use/1...

comment 3y ago · link · parent

My solution for this setup is having ingress controllers on all three nodes, and then specifying all three IPs in all DNS records. That way the end user will "load balance" based on the DNS randomization.

Of course, if a node goes down, a third of the traffic will be lost, but with low TTLs and some planning, you can minimoze the impact of this.

comment 3y ago · link · parent

When it comes to load balancing, I think the hcloud-cloud-controller-manager[1] is probably your best bet, and although I haven't tested it, I'm sure it can be coerced into some kind of working configuration with the vSwitch/Cloud Network coupling, even if none of cluster nodes are actually Cloud-based.

I haven't used Sidero Omni yet, but if it's as well architected as Talos is, I'm sure it's an excellent solution. It still leaves open the question of ordering and provisioning the servers themselves. For simpler use-cases it wouldn't be too difficult to hack together a script to interact with the Hetzner Robot API to achieve this goal, but if I wanted any level of robustness, and if you'll excuse the shameless plug, I think I'd write a custom operator in Rust using my hrobot-rs[2] library :)

As far as the hard-coded IP addresses goes, I think I would simply move that one rule into a separate ClusterWideNetworkPolicy which is created per-node during onboarding and deleted again after. The hard-coded IP addresses are only used before the node is joined to the cluster, so technically the rule becomes obsoleted by the generic "remote-node" one immediately after joining the cluster.[3]

[1] https://github.com/hetznercloud/hcloud-cloud-controller-mana...

[2] https://github.com/MathiasPius/hrobot-rs

[3] https://github.com/MathiasPius/kronform/blob/main/manifests/...

comment 3y ago · link · parent

Hetzner Cloud is officially supported, but that means setting up VPSs in Hetzner's Cloud offering, whereas this project was intended as a more or less independent pure bare-metal cluster. I see they offer Bare Metal support as well, but I haven't dived too deep into it.

I haven't used KubeOne, but I have previously used Syself's https://github.com/syself/cluster-api-provider-hetzner which I believe works in a similar fashion. I think the approach is very interesting and plays right into the Kubernetes Operator playbook and its self-healing ambitions.

That being said, the complexity of the approach, probably in trying to span and resolve inconsistencies across such a wide landscape of providers, caused me quite a bit of grief. I eventually abandoned this approach after having some operator somewhere consistently attempt and fail to spin up a secondary control plane VPS against my wishes. After poring over loads of documentation and half a dozen CRDs in an attempt to resolve it, I threw in my hat.

Of course, Kubermatic is not Syself, and this was about a year ago, so it is entirely possible that both projects are absolutely superb solutions to the problem at this point.

comment 3y ago · link · parent

I rand rados benchmarks and it seems writes are about 74MB/s, whereas both random and sequential reads are running at about 130MB/s, which is about wire speed given the 1Gbit/s NICs.

Complete results are here: https://gist.github.com/MathiasPius/cda8ae32ebab031deb054054...

comment 3y ago · link · parent

I haven't had an excuse to test it yet, but since it's only 6 OSDs across 3 nodes and all of them are spinning rust, I'd be surprised if performance was amazing.

I'm definitely curious to find out though, so I'll run some tests and get back to you!

comment 3y ago · link · parent

I haven't had much opportunity to work with Docker Swarm, but the one time I did, we hit certificate expiration and other issues constantly, and it was not always obvious what was going on. It soured my perception of it a bit, but like I said I hadn't had much prior experience with it, so it might have been on me.

comment 3y ago · link · parent

Absolutely! If at all possible, go managed, preferably with a cloud provider that handles all the hard things for you like load balancing and so on.

*Sometimes* however, you want or need full control, either for compliance or economic reasons, and that's what I set out to explore :)

comment 3y ago · link · parent

Have seen age pop up here and there, but haven't spent the cycles to see where it fits in yet, so I just went with what I knew.

Will definitely take a look though, thanks!

comment 3y ago · link · parent

I believe the recommended[1] way to deploy Talos to Hetzner Cloud (not bare metal) is to use the rescue system and Hashicorp Packer to upload the Talos ISO, deploying your VPS using this image, and then configuring Talos using the standard bootstrapping procedure.

This post series is specifically aimed at deploying a pure-metal cluster.

[1] https://www.talos.dev/v1.5/talos-guides/install/cloud-platfo...

comment 3y ago · link · parent

I recently rebuilt my Kubernetes cluster running across three dedicated servers hosted by Hetzner and decided to document the process. It turned into a (so far) 8-part series covering everything from bootstrapping and firewalls to setting up persistent storage with Ceph.

Part I: Talos on Hetzner https://datavirke.dk/posts/bare-metal-kubernetes-part-1-talo...

Part II: Cilium CNI & Firewalls https://datavirke.dk/posts/bare-metal-kubernetes-part-2-cili...

Part III: Encrypted GitOps with FluxCD https://datavirke.dk/posts/bare-metal-kubernetes-part-3-encr...

Part IV: Ingress, DNS and Certificates https://datavirke.dk/posts/bare-metal-kubernetes-part-4-ingr...

Part V: Scaling Out https://datavirke.dk/posts/bare-metal-kubernetes-part-5-scal...

Part VI: Persistent Storage with Rook Ceph https://datavirke.dk/posts/bare-metal-kubernetes-part-6-pers...

Part VII: Private Registry with Harbor https://datavirke.dk/posts/bare-metal-kubernetes-part-7-priv...

Part VIII: Containerizing our Work Environment https://datavirke.dk/posts/bare-metal-kubernetes-part-8-cont...

And of course, when it all falls apart: Bare-metal Kubernetes: First Incident https://datavirke.dk/posts/bare-metal-kubernetes-first-incid...

Source code repository (set up in Part III) for node configuration and deployed services is available at https://github.com/MathiasPius/kronform

While the documentation was initially intended more as a future reference for myself as well as a log of decisions made, and why I made them, I've received some really good feedback and ideas already, and figured it might be interesting to the hacker community :)

43.

Bare-Metal Kubernetes, Part I: Talos on Hetzner(datavirke.dk ↗)

214 points · by MathiasPius · 3y ago · 77 comments

44.

Fallible – The lost sibling of Result and Option(datavirke.dk ↗)

3 points · by MathiasPius · 3y ago · discuss

comment 4y ago · link · parent

One way in which it is useful, is that you can tag your build artifacts (like docker images) with the commit id in the development branch, and just re-tag them when you want to promote the artifact to main or production, or whatever.

Without this option, you have to either rely on branch names when promoting, which means you can't tie your build to a specific commit in your main branch anymore[1], or you can rebuild your image from the new commit, potentially producing an entirely different artifact which might differ from the one you just tested and validated on your development branch.

[1] Unless you back-fill that information after merge, but the workflow is getting really convoluted at this point.

comment 4y ago · link · parent

The Rust formatting macros depend on string literals because the macro expansion necessarily happens at compile-time, which means that it's not possible to override the actual format string at runtime, nor is recursive resolution possible.

It's obviously still possible to implement the Display trait for a type in a way which makes it susceptible to code execution attacks, but that doesn't really have anything to do with string formatting.

comment 5y ago · link · parent

It's so that a reader of the calling code can immediately reason about which calls might be mutating state. If you have 10 calls, all taking &bytes, any of which may or may not be mutating the data while others are merely reading it, it becomes very difficult to reason about.

By being explicit about this, Rust becomes easier to read, but (slightly) harder to write.

comment 5y ago · link · parent

How do you know that the first certificate was not produced by the MitM?

comment 5y ago · link · parent

And if the international community had been more critical of the US claims on the alleged weapons of mass destruction of Saddam Hussein, 2 decades of war and the deaths of millions could likely have been avoided.

It's not as black and white as that, and I believe some measure of restraint is valuable when making decisions that can have unbounded consequences. Sometimes making the right decision eventually is better than making the wrong decision immediately.

comment 6y ago · link · parent

A custom tld is only custom until it's not (see .dev, .corp), and using them for intranet purposes is widely regarded as bad practice.

If you're already serving regular content over HTTPS internally, then I don't see the big issue in serving video and images the same way, but I'm not familiar with your particular use case so you may of course have a point here that I'm ignorant of.

comment 6y ago · link · parent

In regards to point number 2: the Name Constraints extension[1] appears to be getting more support, at least in Chrome and Firefox on non-OSX devices[2], which could help mitigate the very serious vulnerability presented by installing root certificates, by limiting the CAs scope to just the company domain, for example.

[1] https://tools.ietf.org/html/rfc5280#section-4.2.1.10

[2] https://nameconstraints.bettertls.com/

12