Live data from Hacker News

Creating my personal cloud with HashiCorp

cgamesplay.com

21–30 of 90 posts

Re: Creating my personal cloud with HashiCorp

#21
post #5

As a DevOps guy, I'm not a huge fan of Terraform. Often I hear from enterprises that Terraform is cloud agnostic, but that's often very wrong. Terraform modules are still specific to the cloud platform and a rewrite is required to port an app running on AWS to GCP. If you use AWS, you're probably better off to use AWS Cloudformation and for GCP Google Cloud Deployment manager. A business reason is often that the engi…

I'd point out that one of the biggest advantages of Terraform isn't managing cloud infrastructure (though I certainly like it for this), but for providing a common language for integrating vendors and other 3rd parties into my own cloud infrastructure.

I've worked in a couple organizations that had a lot of success managing things like cloud access security brokers, web application firewall appliances, ticketing systems, identity providers (with and without multi-IdP federation) and more.

Doing this without Terraform is incredibly manual and requires even more manual process to keep these systems in sync with your cloud. Having a common automation framework that can manage this is indispensable--and useful even if you're not using Terraform to manage your core infrastructure.

Re: Creating my personal cloud with HashiCorp

#22
post #13
post #10

Earlier quoted context omitted.

But why not just Cloudformation then? What advantage does Terraform provide over Cloudformation in your opinion?

For one, it's closer to a proper programming language as opposed to straight up data interchange format. Sure if you write it in YAML than you can take advantage of variables but YAML's syntax for variables is pretty gross. Comparing CloudFormation to Terraform is a little like comparing HTML and CSS to Javascript (though Terraform isn't nearly as nice to code in as Javascript -- and I'm not exactly a big fan of Java…

> For one, it's closer to a proper programming language as opposed to straight up data interchange format. Sure if you write it in YAML than you can take advantage of variables but YAML's syntax for variables is pretty gross.

So what is stopping you from using "a proper programming language" to generate the json/yaml cloudformation template?

This is what you see in GCP docs from day one. On AWS, they brainwashed everyone in this corner of "static template with parameters", so that you can "reuse" a template to build your custom stack. It's great for "look what I can do, mom" (but I have no idea what it's doing) but nobody sane would ever trust a 1-km long yaml/json and deploy it. So if you anyway have to inspect it, why not make it easy to inspect? Split into modules, add docs, etc = code to run.

I have no idea how we switched from random scripts to "reusable" random scripts (ansible &co) to random static configuration and then the cherry on top: "reusable" random static configuration. Insane. Abstractions on top of abstractions.

CDK is on the right track, but even there it's a mess, again for the sake of hiding complexity: constructs and deployment. Where did One thing well and Keep it simple stupid go? :)

Re: Creating my personal cloud with HashiCorp

#23
post #16

the qemu driver for nomad seems pretty bare bones compared to kubevirt https://www.nomadproject.io/docs/drivers/qemu https://kubevirt.io/user-guide/virtual_machines/disks_and_vo... Is terraform generally used to deploy workloads to nomad instead of writing tasks directly?

I believe that it does have a provider that talks to Nomad, however I just directly write the Nomad jobs (or use levant, which is a lightweight template for Nomad jobs). The only use of Terraform is to set up the barebones VM and other infrastructure (S3 buckets, etc.)

Re: Creating my personal cloud with HashiCorp

#24
post #4

What does it mean to host a personal cloud vs hosting a server? I thought the point of using cloud services was so you didn’t have to host it yourself.

I am using "personal cloud" to refer to the set of "cloud services" that I am hosting myself on my own server. The advantage of having the server is that my devices have a central syncing hub, and the advantage of hosting myself is no need to trust third parties. There are obviously disadvantages, like having to host it myself.

Re: Creating my personal cloud with HashiCorp

#25
post #5

As a DevOps guy, I'm not a huge fan of Terraform. Often I hear from enterprises that Terraform is cloud agnostic, but that's often very wrong. Terraform modules are still specific to the cloud platform and a rewrite is required to port an app running on AWS to GCP. If you use AWS, you're probably better off to use AWS Cloudformation and for GCP Google Cloud Deployment manager. A business reason is often that the engi…

One of the things I like about Terraform and Pulumi and the non-vendor-specific ones is the cross-cloud features. My very basic Terraform use from the article has a machine set up on Hetzner cloud and an S3 bucket on AWS, for example.

Re: Creating my personal cloud with HashiCorp

#26
post #18
post #11

I was looking into doing something similar with Nomad recently since lately I have been using systemd to launch containers and managing that config with some janky shell scripts. How are you configuring everything to run on a single server, including consul? Isn't Nomad designed to to run on multiple servers or are you running nomad in multiple containers on your VPS? When I looked into this previously I got to https…

For development purposes you very much can run Nomad and Consul on a single host. They recommend you don't, as you lose any HA, of course, but for those of us not seeking 5 nines of availability, that's quite acceptable. In my lab I'm actually running a two-node cluster, but that's 'even worse' and engenders the occasional mildly surprising failure states. Anyway, I can highly recommend setting up Nomad (and some fri…

What's the configuration here? 1 server-client and 1 client? Or are you actually running 2 server-clients?

Re: Creating my personal cloud with HashiCorp

#27
post #14

I had many of the same needs, so I wrote Harbormaster: https://gitlab.com/stavros/harbormaster All it does is manage Compose applications, with a sane directory structure. It's been working great, both for my personal use and for a few companies running production workloads on it. I love that it's super simple and the workflow it has is fantastic, I just push to a repo and everything else happens automatically.

Nice! I may even have looked at that when I was getting started on this project. The two things that jump out at me as "not as easy" are private docker repos and cron jobs. I know that you can run cron images for Docker, but I didn't want the extra layer of indirection.

Re: Creating my personal cloud with HashiCorp

#28
post #14

I had many of the same needs, so I wrote Harbormaster: https://gitlab.com/stavros/harbormaster All it does is manage Compose applications, with a sane directory structure. It's been working great, both for my personal use and for a few companies running production workloads on it. I love that it's super simple and the workflow it has is fantastic, I just push to a repo and everything else happens automatically.

Nice! I may even have looked at that when I was getting started on this project. The two things that jump out at me as "not as easy" are private docker repos and cron jobs. I know that you can run cron images for Docker, but I didn't want the extra layer of indirection.

Hmm, what do you mean? You don't have to use either of those with Harbormaster.

Re: Creating my personal cloud with HashiCorp

#29
post #12
post #5

As a DevOps guy, I'm not a huge fan of Terraform. Often I hear from enterprises that Terraform is cloud agnostic, but that's often very wrong. Terraform modules are still specific to the cloud platform and a rewrite is required to port an app running on AWS to GCP. If you use AWS, you're probably better off to use AWS Cloudformation and for GCP Google Cloud Deployment manager. A business reason is often that the engi…

I'm not the biggest fan of Terraform either but it would be naive to deny that Terraform doesn't still offer a lot of advantages over CloudFormation even if you're not writing cloud agnostic code (even though I do actually agree with your point that Terraform doesn't make your infra cloud agnostic). Terraform offers far more constructs than CloudFormation and there is still a lot to be said for using the same languag…

Terraform Language server together with VSCode is working quite well.

Re: Creating my personal cloud with HashiCorp

#30
post #18

Earlier quoted context omitted.

For development purposes you very much can run Nomad and Consul on a single host. They recommend you don't, as you lose any HA, of course, but for those of us not seeking 5 nines of availability, that's quite acceptable. In my lab I'm actually running a two-node cluster, but that's 'even worse' and engenders the occasional mildly surprising failure states. Anyway, I can highly recommend setting up Nomad (and some fri…

What's the configuration here? 1 server-client and 1 client? Or are you actually running 2 server-clients?

It's not my ideal situation, but pandemic relocation etc means I'm not next to my normal lab (two ESX servers + NAS).

So, that said, yes, server (whitebox) plus desktop (xeon, 32gb) - both running Debian, with Consul, Nomad, Traefik, promtail etc running on both, but no shared NFS between the two, so I've got constraints on most of the important stuff to run on the server (prometheus, cortex, loki, nodered). In practice, desktop is running 24/7, just it occasionally gets a reboot.

Having consul/nomad running as server-client on two machines is undeniably weird, and requires some careful consideration around bootstrap_expect= settings.

Almost all of this is around having a useful facsimile of my work environment, rather than (say) running an SSG public site.

Post reply on HN