update pronouns, css, progress on fp post
This commit is contained in:
parent
e4490fb4e3
commit
89c255c89a
5 changed files with 204 additions and 126 deletions
|
|
@ -1,134 +1,92 @@
|
||||||
---
|
---
|
||||||
title: Mira's attempts to understand Kuwubernetes
|
title: Mira attempts to lock the fuck in and figure out how to k8s
|
||||||
date: 2025-04-07
|
date: 2025-04-07
|
||||||
---
|
---
|
||||||
|
# Current Setup
|
||||||
|
|
||||||
# Install k3s, helm
|
Auxin (HTPC):
|
||||||
|
- OS: NixOS
|
||||||
|
- Service Runtume:Docker Compose
|
||||||
|
- Services:
|
||||||
|
- Syncthing
|
||||||
|
- Jellyfin
|
||||||
|
- Caddy (as reverse proxy only)
|
||||||
|
- Kodi
|
||||||
|
- Service Storage:
|
||||||
|
- Bind Mounts to NFS on NAS
|
||||||
|
Lipotropin (NAS):
|
||||||
|
- OS: Proxmox
|
||||||
|
- Services Runtime: K3S
|
||||||
|
- Services:
|
||||||
|
- adminer
|
||||||
|
- caddy
|
||||||
|
- copyparty
|
||||||
|
- forgejo
|
||||||
|
- jackett
|
||||||
|
- mariadb
|
||||||
|
- ntfy
|
||||||
|
- paperless+gotenberg+tika
|
||||||
|
- qbittorrent+gluetun
|
||||||
|
- radarr
|
||||||
|
- redis
|
||||||
|
- slskd
|
||||||
|
- Service Storage:
|
||||||
|
- NFS to spinning rust on same system
|
||||||
|
- Baremetal storage:
|
||||||
|
- 6 HDDs in BTRFS5 (50TB raw, 38TB usable)
|
||||||
|
Motilin (working hostname, Unused)
|
||||||
|
|
||||||
- run `curl -sfL https://get.k3s.io | sh - on first node
|
Other Client Devices:
|
||||||
- `curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash`
|
- Access files over NFS/SMB
|
||||||
|
- Access services via hostname (local), or URL (external)
|
||||||
|
|
||||||
`export KUBECONFIG=/etc/rancher/k3s/k3s.yaml`
|
----
|
||||||
|
|
||||||
```yaml
|
# Endn't Point
|
||||||
|
Auxin
|
||||||
|
- Exclusive Services:
|
||||||
|
- Kodi
|
||||||
|
- Distributed Services via K8S
|
||||||
|
- Service Storage: ????
|
||||||
|
- Baremetal storage:
|
||||||
|
- Various HDDs as available
|
||||||
|
Motilin + Lipotropin
|
||||||
|
- Distributed Services via K8S
|
||||||
|
Client Devices
|
||||||
|
- Still need to be able to access files over NFS/SMB
|
||||||
|
- Still need to access services via hostname (local), or URL (external)
|
||||||
---
|
---
|
||||||
apiVersion: apps/v1
|
# Still need to figure out:
|
||||||
kind: Deployment
|
- How to handle jellyfin requiring GPU access
|
||||||
metadata:
|
- nodes not guaranteed to have GPU, or may have heterogenous GPUs, need to lock to nodes with GPUs
|
||||||
labels:
|
- How do I handle failover
|
||||||
app: adminer
|
- current setup has SSH and HTTP traffic go to auxin, which proxies to lipotropin as needed
|
||||||
name: adminer
|
- how would I handle auxin going down
|
||||||
spec:
|
- ~~where the fuck would ssh go in general, it's not something reverse proxyable~~
|
||||||
replicas: 1
|
- Move SSH to router, use proxyjump from there
|
||||||
selector:
|
- see if Auto proxy and fallback are options
|
||||||
matchLabels:
|
- can we do crowdsec and fail2ban on openwrt
|
||||||
app: adminer
|
- if I fucked up a config, how could I recover without incurring downtime
|
||||||
template:
|
- How the *fuck* do I handle storage
|
||||||
metadata:
|
- how do I do concurrent access, which services even allow that
|
||||||
labels:
|
- how the ever loving fuck do I make syncthing work
|
||||||
app: adminer
|
- ~~the intent is graceful failover, but can I do load balancing?~~
|
||||||
spec:
|
- I do not have a good reason to have multiple instances of, cap replicas at 1
|
||||||
containers:
|
- at best, jellyfin might benefit from multiple GPUs but also nobody is using your instance
|
||||||
- image: adminer:latest
|
- some services use SQLite, is there a way to mitigate concurrency issues with that
|
||||||
name: adminer
|
- on that note SQLite shits itself when FS access is too slow (eg NFS or ISCSI), how deal with that
|
||||||
ports:
|
- How to gradually migrate to new setup from 6 BTRFS drives on one machine
|
||||||
- containerPort: 8080
|
- The end goal is at least 3 nodes, but at some point there's only going to be 1 or 2
|
||||||
---
|
- how would I minimize buying more storage/spending more money, while maintaining some redundancy
|
||||||
apiVersion: v1
|
- is the best option just `btrfs remove` -> move drive -> format drive -> copy files from btrfs to new drive?
|
||||||
kind: Service
|
- new storage setup should be easy to add to (at a minimum, no homogenous drives)
|
||||||
metadata:
|
- Is tiered storage something I can make use of, could I grab an SSD and use it as cache somehow
|
||||||
name: adminer-svc
|
- how to give client devices and services access to the same filesystems
|
||||||
spec:
|
- eg (accessing `/downloads` from `qbittorrent`, `sonarr` and my phone via NFS/SMB)
|
||||||
type: ClusterIP
|
|
||||||
selector:
|
|
||||||
app: adminer
|
|
||||||
ports:
|
|
||||||
- port: 8080
|
|
||||||
targetPort: 8080
|
|
||||||
---
|
|
||||||
apiVersion: networking.k8s.io/v1
|
|
||||||
kind: Ingress
|
|
||||||
metadata:
|
|
||||||
name: adminer-http
|
|
||||||
annotations:
|
|
||||||
traefik.ingress.kubernetes.io/router.entrypoints: web
|
|
||||||
spec:
|
|
||||||
rules:
|
|
||||||
- host: adminer.lipotropin.lan
|
|
||||||
http:
|
|
||||||
paths:
|
|
||||||
- path: /
|
|
||||||
pathType: Prefix
|
|
||||||
backend:
|
|
||||||
service:
|
|
||||||
name: adminer-svc
|
|
||||||
port:
|
|
||||||
number: 8080
|
|
||||||
```
|
|
||||||
|
|
||||||
- Use `kubectl apply -f <yaml>` to deploy a yaml file
|
|
||||||
|
|
||||||
The above two result in the following
|
|
||||||
|
|
||||||
```
|
|
||||||
$ kubectl describe svc
|
|
||||||
Name: adminer
|
|
||||||
Namespace: default
|
|
||||||
Labels: io.kompose.service=adminer
|
|
||||||
Annotations: <none>
|
|
||||||
Selector: io.kompose.service=adminer
|
|
||||||
Type: ClusterIP
|
|
||||||
IP Family Policy: SingleStack
|
|
||||||
IP Families: IPv4
|
|
||||||
IP: 10.43.229.81
|
|
||||||
IPs: 10.43.229.81
|
|
||||||
Port: 8090 8090/TCP
|
|
||||||
TargetPort: 8080/TCP
|
|
||||||
Endpoints: 10.42.0.10:8080
|
|
||||||
Session Affinity: None
|
|
||||||
Internal Traffic Policy: Cluster
|
|
||||||
Events: <none>
|
|
||||||
```
|
|
||||||
|
|
||||||
Adminer can be accesed at `10.42.0.10:8080`
|
|
||||||
|
|
||||||
> [!TODO] how tf do I access this from 127.0.0.1 or outside?
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
# Rook: does it solve my storage issues?
|
||||||
|
|
||||||
- Deployment: seems to translate to docker service
|
- Needs raw devices/partitions
|
||||||
- Service: seems to handle connecting to the deployment?
|
- requires migration
|
||||||
- NodePort: something to do with routing
|
# Longhorn: will it do shit?
|
||||||
- `kubectl expose deployment <deployment_name> --port=<port> --target-port=<target_port> --type=NodePort`
|
|
||||||
|
|
||||||
`kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.2.1/standard-install.yaml`
|
|
||||||
`export KUBECONFIG=/etc/rancher/k3s/k3s.yaml`
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# TODO:
|
|
||||||
|
|
||||||
- [x] cyberchef
|
|
||||||
- [x] adminer
|
|
||||||
- [x] soulseek
|
|
||||||
- [x] postgres
|
|
||||||
- [x] mariadb
|
|
||||||
- [x] Ntfy
|
|
||||||
- [x] gluetun?
|
|
||||||
- [x] Jackett
|
|
||||||
- [x] qbittorrent
|
|
||||||
- [x] radarr
|
|
||||||
- [ ] sonarr
|
|
||||||
- [ ] syncthing
|
|
||||||
- [ ] forgejo
|
|
||||||
- [ ] kuma
|
|
||||||
- [ ] paperless-ngx
|
|
||||||
- [ ] goternberg
|
|
||||||
- [ ] redis
|
|
||||||
- [ ] tika
|
|
||||||
- [ ] jellyfin
|
|
||||||
- [ ] Website
|
|
||||||
- [ ] crowdsec
|
|
||||||
- [ ] dufs
|
|
||||||
- [ ] minecraft
|
|
||||||
- [ ] flaresolverr?
|
|
||||||
|
|
@ -12,12 +12,12 @@ title: Links and Socials!
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>She/They</td>
|
<td>She/Her</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<br />
|
<br />
|
||||||
<span class="socials-text">I don't know who you are or how you found this, but while you're here, feel
|
<span class="socials-text">I don't know who you are or how you found this, but while you're here, feel free to add me
|
||||||
free to add me everywhere</span>
|
everywhere</span>
|
||||||
<div class="social-container">
|
<div class="social-container">
|
||||||
<table class="socials">
|
<table class="socials">
|
||||||
<tr>
|
<tr>
|
||||||
|
|
|
||||||
87
content/posts/fp.md
Executable file
87
content/posts/fp.md
Executable file
|
|
@ -0,0 +1,87 @@
|
||||||
|
---
|
||||||
|
title: Dysfunctional Programming
|
||||||
|
date: 2025-11-24
|
||||||
|
modified: 2025-11-24
|
||||||
|
draft: true
|
||||||
|
summary: Group Theory Adjacent Nonsense for people who slept through high school (me)
|
||||||
|
---
|
||||||
|
*Group Theory Adjacent Nonsense for people who slept through high school (me)*
|
||||||
|
> A Cringe set is Just a Co-Based set
|
||||||
|
>
|
||||||
|
> \- Unknown
|
||||||
|
|
||||||
|
So anyway, what the FUCK is a Monad
|
||||||
|
- A monoid in the category of endofunctors
|
||||||
|
- a burrito
|
||||||
|
- a co-comonad
|
||||||
|
|
||||||
|
Do any of these mean anything? No, so lets start at the beginning
|
||||||
|
|
||||||
|
# Numbers
|
||||||
|
- In the beginning, there was the empty set
|
||||||
|
- and then Zermelo and Fraenkel said "Let there be a power set of the empty set"
|
||||||
|
- ...which is a line of exploration that will get us nowhere productive for the scope of this work, and is probably something I'll talk about in the future.
|
||||||
|
|
||||||
|
# Magmas
|
||||||
|
- The easiest Algebraic Structure to explain is The **Magma**
|
||||||
|
- **Definition**: A magma is a set \(M\) with an operation \(\cdot\) that sends \(a,b\in M \to a\cdot b \in M\)
|
||||||
|
- the tl;dr is, you've got a set of stuff, and you can shove any two of those together to make a third thing, as long as it's still in the set, we call this property **closure**
|
||||||
|
- you're probably used to \(\cdot\) meaning multiplication, but that's a fake word that doesn't mean anything
|
||||||
|
- Aside: '\(\cdot\)' is hard to read on its own, hereafter it will be referred to as multiplication or as <strike>bottom surgery</strike> 'the operation')
|
||||||
|
- The main example of this is the Free Magma, which is basically just a binary tree
|
||||||
|
- In this case, 'multiplying' two binary trees just means concatenating them
|
||||||
|
- Why is this called the Free Magma? I honestly have no clue, Free means *something* here but I haven't figured out what yet. This will not be the last time it comes up.
|
||||||
|
|
||||||
|
# Monoids
|
||||||
|
- The next step we'll on the Algebraic Structure Skill Tree is the Semigroup, but that's less important to focus on here so I'll fold it into the Monoid Section
|
||||||
|
- When you add Associativity to a Magma, you get a **Semigroup**
|
||||||
|
- Associativity just means that \(a\cdot(b\cdot c) = (a\cdot b) \cdot c\)
|
||||||
|
- A more concrete example of this is natural number addition, \(2+(3+4) = (2+3)+4\)
|
||||||
|
- The proof of this is trivial and left as an exercise to the reader
|
||||||
|
- When you take a Semigroup and add an **Identity** to it, you get a **Monoid**
|
||||||
|
- An identity is just something that you can combine with something and get that same something back out
|
||||||
|
- The easiest way to think of this is that we need something that acts like '1' when you 'multiply' by it
|
||||||
|
- If we go back to the example of adding numbers together, '0' acts as the identity since \(0+x = x\)
|
||||||
|
- Yes, this means that the '1' element of \((\mathbb{N},+)\) is '0'
|
||||||
|
- No, I'm not sorry for coming up with that absolutely dumb ass example
|
||||||
|
- The Free Monoid is strings with concatenation as the operation
|
||||||
|
- Told you 'Free' would come up again
|
||||||
|
- the Identity element here is '', or the empty string
|
||||||
|
- This is closed since adding two strings together always results in a string
|
||||||
|
- This is also associative because Trust Me Bro
|
||||||
|
- Another example of a Monoid is RGBA colors
|
||||||
|
- The identity here is `rgba(0,0,0,0)` since adding clear to any color doesn't change it
|
||||||
|
- Colors are closed since you can add two of them and get a color back*
|
||||||
|
- *Actually I'm sure there's some sort of floating-point nonsense that makes this not true but IEEE 754 can go suck a log
|
||||||
|
- RGBA Colors are associative because I said so
|
||||||
|
- Absolutely unrelated, but I'm pretty sure OKLab isn't closed under the set of displayable colors, which feels cursed but is probably reasonable tbh
|
||||||
|
|
||||||
|
# Categories
|
||||||
|
- The Magma -> Monoid skill tree (and the several parts of it that I left out), are a scuffed refresher on Group Theory
|
||||||
|
- Up next is Category Theory, which they did not cover in high school; As such I will be spewing a significant amount of hot air out of my ass.
|
||||||
|
|
||||||
|
# Functors
|
||||||
|
> A category is a collection of "objects" that are linked by "arrows"
|
||||||
|
>
|
||||||
|
> \- [Wikipedia - Category](https://en.wikipedia.org/wiki/Category_(mathematics))
|
||||||
|
- ...FUCK, I was going to say that, unfortunately Wikipedia's definition is pretty spot on here.
|
||||||
|
- Okay but seriously
|
||||||
|
> In mathematics, abstract nonsense is a nonderogatory term used mainly to describe category theory and homological algebra
|
||||||
|
>
|
||||||
|
> \- Paraphrased from [Wikipedia - Abstract nonsense](https://en.wikipedia.org/wiki/Abstract_nonsense)
|
||||||
|
- Okay forget finding a way to explain it to an audience of (<small>uhhh whatever my audience is, I kinda try to write these at a level high school me could follow along with and not get bored, but I don't actually know what kind of masochist is reading this</small>), I need to figure out how to explain this to me first
|
||||||
|
- I'm back from Wikipedia, and I've returned neither smarter nor wiser, as such we proceed in our endeavors with the rallying cry: "Fuck it, we ball"
|
||||||
|
# Endofunctors
|
||||||
|
|
||||||
|
# Monads
|
||||||
|
- Examples include: `Future<T>`, `List<T>`, `Option<T>`, `Result<T,E>` also logging
|
||||||
|
- TODO: find someone who can explain how/why logging and file i/o are monadic
|
||||||
|
|
||||||
|
----
|
||||||
|
# Questions Mira hasn't answered yet and should really get around to before publishing this
|
||||||
|
- Does free just mean the operation is concatenation?
|
||||||
|
- https://en.wikipedia.org/wiki/Free_object
|
||||||
|
- it's supposed to be the 'most generic'
|
||||||
|
- How does using monads deal with side effects, eg Logging, File IO
|
||||||
|
- Do they encapsulate state somehow? how does that work exactly?
|
||||||
|
- what exactly does `Co-` entail
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
{{ $emojis := dict "caution" ":exclamation:" "important" ":information_source:"
|
{{ $emojis := dict "caution" ":exclamation:" "important" ":information_source:"
|
||||||
"note" ":information_source:" "tip" ":bulb:" "warning" ":information_source:"
|
"note" ":information_source:" "tip" ":bulb:" "warning" ":information_source:"
|
||||||
"todo" ":memo:" "quote" ":speech_balloon:" "default" ":information_source:" }}
|
"todo" ":memo:" "quote" ":speech_balloon:" "default" ":information_source:" }}
|
||||||
|
{{ if .AlertType }}
|
||||||
<blockquote class="alert alert-{{ .AlertType }}">
|
<blockquote class="alert alert-{{ .AlertType }}">
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
@ -12,3 +13,15 @@
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
|
{{ else }}
|
||||||
|
<blockquote class="alert alert-default">
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td class="width-min">Quote:</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="width-auto">{{ .Text }}</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</blockquote>
|
||||||
|
{{ end }}
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,14 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
margin: 1em 0 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
small {
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
a:link,
|
a:link,
|
||||||
a:visited {
|
a:visited {
|
||||||
color: var(--link-color);
|
color: var(--link-color);
|
||||||
|
|
@ -57,9 +65,21 @@ body {
|
||||||
color: var(--text-color);
|
color: var(--text-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.alert-default table {
|
||||||
|
border-left: 1em solid var(--base02);
|
||||||
|
background-color: var(--base01);
|
||||||
|
}
|
||||||
|
|
||||||
|
.alert-default td {
|
||||||
|
border: none;
|
||||||
|
padding: 0em;
|
||||||
|
padding-left: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
.alert-quote td {
|
.alert-quote td {
|
||||||
background-color: var(--base01);
|
background-color: var(--base01);
|
||||||
border-color: var(--base01);
|
border-color: var(--base01);
|
||||||
|
padding: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
p mjx-container {
|
p mjx-container {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue