An open API service indexing awesome lists of open source software.

https://github.com/ginolatorilla/local-platform

A reduced version of k8s-homenet
https://github.com/ginolatorilla/local-platform

argocd argocd-managed bash bash-script k8s k8s-at-home kubeadm kubeadm-cluster kubeadm-lab kubernetes kubernetes-cluster lima lima-vm

Last synced: 2 months ago
JSON representation

A reduced version of k8s-homenet

Awesome Lists containing this project

README

          

# My Local Platform

This is a laptop-only version of my [home lab](https://github.com/ginolatorilla/k8s-homenet/).

## Specifications

| Item | Value |
| ---------------------------- | ----------------------------- |
| Hypervisor | [Lima VM](https://lima-vm.io) |
| Hypervisor version | limactl 1.0.1 |
| Host OS | MacOS (Darwin) |
| Guest OS | Ubuntu 22.04 |
| Guest CPU architecture | arm64 |
| Kubernetes version | 1.35.2 |
| Container runtime | CRI-O |
| Container runtime version | 1.35 |
| Container networking | Calico |
| Container networking version | 3.27.0 |
| Ingress controller | Nginx |
| Ingress controller version | 3.4.3 |
| Private registry (cluster) | registry:5001 |
| Private registry (host) | localhost:5001 |

## Requirements

- limactl
- helm
- kubectl
- docker (cli)
- skopeo
- htpasswd
- sed
- terraform
- jq

## Quickstart

```shell
./install.sh
```

### Resetting the VM

1. Modify `k8s.lima.yaml`
2. Run `./install.sh --reset-vm`.
3. Wait for all the pods to restart.

### Resetting the cluster

1. Modify any file in `kubeadm/*`
2. Run `./install.sh --reset-cluster`.

## Port forwarding

Lima automatically forwards the following localhost ports to the host:

| Port | Service |
| ---- | ----------------------------------- |
| 80 | Forwarder to Ingress HTTP NodePort |
| 443 | Forwarder to Ingress HTTPS NodePort |
| 6443 | Kubernetes API |
| 5001 | Distribution registry |

## Ingress

Socat runs as a systemd service in the background that forwards VM ports 80 and 443 to the clusters nodeports.

The certificate authority is generated to `./outputs/certs/ownca.crt`. Make sure you install this CA to your host.

Since the ingresses will be listening to hostnames, make sure you add them to your `/etc/hosts` file
or use `.localhost`.

## Filesystem mounts

The `~/.lima/k8s/data` folder is mounted to the VM as `/mnt/data`. The PV provisioner (based from Rancher)
will mount volumes to this directory, ensuring application data will survive if the cluster is destroyed.
This will also contain the Kubernetes API server audit logs.

## Airgap images

A private container registry will run in Docker and listen on the host at `0.0.0.0:5001`. The images listed in `images.txt`
will be pushed to the registry, resulting in the final URL `registry:5001/`. The node will resolve `registry` to the host's IP.