Skip to content

Cloud init is for suckers

Cloud-init is designed for early initialization of cloud instances. It is prevalent in the world of cloud computing, particularly with major cloud service providers such as AWS, Azure, Google Cloud, and Hetzner Cloud. This tool is essential for cloud users as it allows for the automated configuration of cloud instances upon boot-up, making it easier to manage large-scale deployments and automate repetitive setup tasks.

The key features of cloud-init include:

  1. Customization and Configuration: Cloud-init can run various customization scripts and commands during the boot process, allowing for the automatic configuration of system settings, network configuration, and management of user accounts.

  2. Package Installation: It can automatically install required packages and software, which is particularly useful for setting up standardized environments across multiple instances.

  3. Integration with Cloud Platforms: Cloud-init works seamlessly with different cloud platforms, ensuring that instances are initialized with the right configurations regardless of the underlying cloud provider.

  4. Extensibility: It supports custom scripts and modules, making it adaptable to a wide range of initialization tasks.

  5. Support for Multiple Distributions: Cloud-init is not limited to a single operating system; it supports various Linux distributions and other Unix-like systems.

Given your preference for local tools and sovereign methods, while cloud-init is inherently designed for cloud environments, it's worth noting that its principles can inspire similar automation and initialization practices in non-cloud, local environments. You could develop or use similar scripting and automation tools that align with your ethos of keeping data on local disks and avoiding reliance on cloud services. Tools like Ansible, Puppet, and Chef, for example, offer automation capabilities that can be used in local environments. Additionally, your experience with Bash scripting can be leveraged to create custom initialization and configuration scripts for local systems.

A koad:io/meteor #cloud-config script.

This cloud-init script combined with ZeroTier creates a powerful and flexible setup where (a koad-io entity) can immediately become part of a secure network upon deployment, ready to take on a variety of tasks. This approach aligns well with our preference for sovereign tools and methods, as it provides a high degree of control over the network and services you deploy.

#cloud-config
users:
  - name: koad
    groups: users, admin
    sudo: ALL=(ALL) NOPASSWD:ALL
    shell: /bin/bash
    ssh_authorized_keys:
      - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIH7XOJyArUKUlUAPsmZ2J3wPHOCla9QAUphWmIRr4KFI wonderland@koad.sh
  - name: alice
    groups: users, admin
    sudo: ALL=(ALL) NOPASSWD:ALL
    shell: /bin/bash
    ssh_authorized_keys:
      - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHuODQcu38lmCPxi7YwSYxKeju1592ljvjBT3xuZ7fv8 alice@mary
packages:
  - curl
  - ufw
package_update: true
package_upgrade: true
runcmd:
  - curl -s 'https://raw.githubusercontent.com/zerotier/ZeroTierOne/master/doc/contact%40zerotier.com.gpg' | gpg --import
  - if z=$(curl -s 'https://install.zerotier.com/' | gpg); then echo "$z" | bash; fi
  - curl https://install.meteor.com/ | sh
  - zerotier-cli join 1c309d8a3c1aced23
  - ufw allow in on 22lrvylrvyrrztht
  - ufw enable
  - reboot

Ensure that you understand each line of the script and modify it according to your needs, especially the SSH keys and the ZeroTier network ID. Let's delve a bit deeper into how this process works with your cloud-init script and the incorporation of ZeroTier:

  1. ZeroTier Network Joining:
  2. As soon as the VPS instance (Alice) is initialized, it joins a predefined ZeroTier network. This is accomplished by the script executing the zerotier-cli join command with your network's ID.

  3. Network Authorization and Visibility:

  4. Once Alice joins the ZeroTier network, she becomes a part of a virtualized network overlay. This allows her to be visible and accessible to other devices on the same ZeroTier network.
  5. For Alice to begin functioning fully, she might need to be authorized on the ZeroTier network through its control panel. This depends on your ZeroTier network's configuration (whether it's set to auto-approve new members or requires manual approval).

  6. Resource Utilization for Goals:

  7. After joining the network and being authorized, Alice can begin utilizing the VPS resources to accomplish her goals, such as hosting web services, APIs, PWAs, running daemons or Docker containers, and managing databases.

  8. Flexibility and Access:

  9. The use of ZeroTier means that Alice, or any service running on the VPS, can be accessed securely from any device that is also a member of the same ZeroTier network. This creates a secure and flexible network environment, allowing you to manage and access your services from various devices.

  10. Simplified Management and Enhanced Security:

  11. This setup allows for simplified management of services across different platforms and devices. It also enhances security, as ZeroTier provides end-to-end encryption across its network.