Giter VIP home page Giter VIP logo

infrastructure's Introduction

Raspberry Pi and all the others

Hi, I am Nicklas and I โค๏ธ to ๐Ÿš€ to single board computers. No, matter if it is a

  • Raspberry Pi 4
  • Odroid HC2
  • Rock Pi X
  • Cubieboard 3

I โค๏ธ the ๐Ÿ’ก of single board computers, low โšก consumption and low ๐Ÿ’ฐ. In my spare โฒ๏ธ I write code for infrastructure automation or explore the Kubernetes ecosystem.

๐Ÿšฉ Quick facts

  • ๐ŸŒฑ Iโ€™m currently learning netbooting, baremetal provisioning and Go.
  • ๐Ÿ’ฌ Ask me about Kubernetes, Linux, networking, embedded software development, PCB design and IoT.
  • ๐Ÿ˜„ Pronouns: he/him
  • โšก Fun fact: I broke my first computer, a used Dell Dimension 4550, because curious 12-year-old me took the CPU out of the socket. This is when computer science and engineering got a hold of me.

๐Ÿš€ Production-ready projects

๐Ÿงช Experimental projects

๐Ÿ”– Bookmarks

๐Ÿ“ˆ Statistics

Nicklas' GitHub stats Nicklas' GitHub top languages

infrastructure's People

Contributors

dependabot[bot] avatar nicklasfrahm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

infrastructure's Issues

Create bootstrap script or tool

I would like to have a CLI or script that I can run against a fresh router after provisioning to do the following tasks:

  • Set hostname
  • Change user password

The tasks below should most likely be carried out via a service running inside k3s:

  • Configure dynamic DNS
  • Configure router ID and ASN

For more info consider the source file cmd/ic/zone/up.go.

Prevent laptop nodes from shutting down

First disable hybernation:

sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target

Also edit the /etc/systemd/logind.conf to look similar to this:

#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it under the
#  terms of the GNU Lesser General Public License as published by the Free
#  Software Foundation; either version 2.1 of the License, or (at your option)
#  any later version.
#
# Entries in this file show the compile time defaults. Local configuration
# should be created by either modifying this file, or by creating "drop-ins" in
# the logind.conf.d/ subdirectory. The latter is generally recommended.
# Defaults can be restored by simply deleting this file and all drop-ins.
#
# Use 'systemd-analyze cat-config systemd/logind.conf' to display the full config.
#
# See logind.conf(5) for details.

[Login]
#NAutoVTs=6
#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
#InhibitDelayMaxSec=5
#UserStopDelaySec=10
#HandlePowerKey=poweroff
#HandleSuspendKey=suspend
#HandleHibernateKey=hibernate
HandleLidSwitch=ignore
HandleLidSwitchExternalPower=ignore
HandleLidSwitchDocked=ignore
#HandleRebootKey=reboot
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
LidSwitchIgnoreInhibited=no
#RebootKeyIgnoreInhibited=no
#HoldoffTimeoutSec=30s
#IdleAction=ignore
#IdleActionSec=30min
#RuntimeDirectorySize=10%
#RuntimeDirectoryInodesMax=400k
#RemoveIPC=yes
#InhibitorsMax=8192
#SessionsMax=8192

Enable cgroups via cloud-init

Currently, k3s does not work out of the box when bootstrapping the OS with cloud-init. It is required to manually add cgroup_enable=cpuset cgroup_enable=memory cgroup_memory=1 to /boot/firmware/cmdline.txt.

Configure branches and labels

The following parameters should be configured for all repositories:

  • Set default branch to main
  • Configure branch protection
  • Set up unified set of labels across all repositories

Attached you may also find a code sample of a previous iteration.

var labels = []Label{
	NewLabel("f44336", "bug", "Something isn't working"),
	NewLabel("e91e63", "dependencies", "Pull requests that updates a dependency file"),
	NewLabel("9e9e9e", "duplicate", "This issue or pull request already exists"),
	NewLabel("3f51b5", "feature", "New feature or request"),
	NewLabel("673ab7", "good first issue", "Good for newcomers"),
	NewLabel("009688", "help wanted", "Extra attention is needed"),
	NewLabel("ffeb3b", "invalid", "This doesn't seem right"),
	NewLabel("9c27b0", "question", "Further information is requested"),
	NewLabel("ffffff", "wontfix", "This will not be worked on"),
	NewLabel("304ffe", "python", "Pull requests that update Python code"),
	NewLabel("00bcd4", "go", "Pull requests that update Go code"),
}

type Label struct {
	Color       string
	Name        string
	Description string
}

func NewLabel(color string, name string, description string) Label {
	return Label{Color: color, Name: name, Description: description}
}

func ConfigureLabels(ctx *pulumi.Context, provider *github.Provider, repo Repository, id pulumi.StringOutput) error {
	for _, label := range labels {
		_, err := github.NewIssueLabel(ctx, fmt.Sprintf("%s-%s", repo.Name, label.Name), &github.IssueLabelArgs{
			Repository:  id,
			Color:       pulumi.String(label.Color),
			Name:        pulumi.String(label.Name),
			Description: pulumi.String(label.Description),
		}, pulumi.Provider(provider))
		if err != nil {
			return err
		}
	}

	return nil
}

func ConfigureBranches(ctx *pulumi.Context, provider *github.Provider, repo Repository) error {
	branch := "main"

	_, err := github.NewBranch(ctx, fmt.Sprintf("%s-%s", repo.Name, branch), &github.BranchArgs{
		Repository: pulumi.String(repo.Name),
		Branch:     pulumi.String(branch),
	}, pulumi.Provider(provider))
	if err != nil {
		return err
	}

	return nil
}

Set up CMS for Olcia

We would like to host a Ghost instance for Olcia. To complete this task we need the following things:

  • Set Ola's blog title
  • set up Ola's DNS records for odance.dk
  • Install Liebling Ghost theme
  • Send credentials to Ola

Deploy updates to network-config

If a network-config is changed, these changes should automatically be deployed via CI.

  • Set up new job as part of baremetal deployment process

Configure mom's infrastructure

Currently, I set up access to my mom's PC for remote maintenance via a shared keypair. This keypair will be replaced by a specifically generated RSA keypair, which requires the PC to be on. Additionally, the connection information such as hostname and username should be somehow stored as part of this repository.

  • Finish setup of personal keypair for remote access
  • Test setup with personal keypair and remove shared keypair
  • Store connection information in git repository
  • Document infrastructure setup

RBAC using Argo CD app of apps for dedicated cluster

Currently, when deploying an app of apps for a dedicated cluster, we need to rely on the user to only deploy to the designated project. There is however no enforcement at the moment. We need to identify a better way so that the user of a dedicated cluster can't deploy to an arbitrary project.

Trust is good, but control is better.

Deploy new site in Aarhus

The following tasks are to be carried out:

  • Provision router and management cluster workhorse-0
  • Rename sites to tph99, plk42 and bl8

Investigate kexec

To apply security updates without downtime to the router, kexec should be investigated as a tool for quick reboots.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.