Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fcba03f3d0 | ||
|
|
8ba503ca5d | ||
|
|
3b78dfec41 | ||
|
|
8509fff746 |
@@ -65,6 +65,7 @@
|
||||
};
|
||||
}
|
||||
);
|
||||
lib' = import ./lib { inherit (top.nixunstable) lib; };
|
||||
in
|
||||
top.flake-parts.lib.mkFlake { inputs = top; } {
|
||||
inherit systems;
|
||||
@@ -76,6 +77,7 @@
|
||||
nixpkgs = imported_packages.x86_64-linux;
|
||||
specialArgs = {
|
||||
inherit
|
||||
lib'
|
||||
metadata
|
||||
self
|
||||
top
|
||||
@@ -112,7 +114,7 @@
|
||||
|
||||
nixosConfigurations = (
|
||||
import ./hosts {
|
||||
inherit top metadata;
|
||||
inherit top metadata lib';
|
||||
nixpkgs = imported_packages;
|
||||
}
|
||||
);
|
||||
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
{
|
||||
top,
|
||||
lib',
|
||||
metadata,
|
||||
nixpkgs,
|
||||
}:
|
||||
@@ -18,7 +19,7 @@ let
|
||||
channel.lib.nixosSystem {
|
||||
pkgs = nixpkgs.${system};
|
||||
specialArgs = {
|
||||
inherit metadata top;
|
||||
inherit metadata top lib';
|
||||
};
|
||||
modules = [
|
||||
{
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
lib',
|
||||
metadata,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
@@ -9,7 +11,6 @@ let
|
||||
lanIP = metadata.hosts.${config.networking.hostName}.ip;
|
||||
iot = "enp2s0";
|
||||
iotIP = "192.168.66.250";
|
||||
#routerIP = metadata.infra.gw;
|
||||
extraHosts = builtins.readFile ./net/hosts;
|
||||
|
||||
proxyPort = 3128;
|
||||
@@ -84,16 +85,41 @@ in
|
||||
#########
|
||||
# dnsmasq config
|
||||
########
|
||||
dnsmasq = {
|
||||
bind = {
|
||||
enable = true;
|
||||
settings = {
|
||||
domain = "thehellings.lan";
|
||||
expand-hosts = true;
|
||||
log-queries = true;
|
||||
no-hosts = true; # Do not read /etc/hosts, which makes genesis resolve to 127.0.0.2
|
||||
addn-hosts = "/etc/adblock_hosts";
|
||||
hostsdir = "/etc/hosts.d/";
|
||||
server = dnsServers;
|
||||
cacheNetworks = [
|
||||
metadata.infra.lan
|
||||
metadata.infra.tailscale
|
||||
metadata.infra.nebula
|
||||
];
|
||||
zones =
|
||||
let
|
||||
makeZoneFile =
|
||||
hosts: domain:
|
||||
let
|
||||
preamble = [
|
||||
"$ORIGIN\t${domain}."
|
||||
"$TTL\t1h"
|
||||
"@\tIN\tSOA\t${config.networking.hostName}\tgreg@thehellings.com (1 1m 1m 1m 1m)"
|
||||
"\tIN\tNS\t${config.networking.hostName}"
|
||||
];
|
||||
makeHost = host: "${host.name}\tIN\tA\t${host.address}";
|
||||
in
|
||||
pkgs.writeText "${domain}" (
|
||||
builtins.concatStringsSep "\n" (preamble ++ (lib.map makeHost hosts) ++ [ "" ])
|
||||
);
|
||||
in
|
||||
lib.mapAttrs
|
||||
(domain: net: {
|
||||
master = true;
|
||||
file = makeZoneFile (lib'.hostsByNet net metadata.hosts) domain;
|
||||
})
|
||||
{
|
||||
"shire-zebra.ts.net" = "tailscale";
|
||||
"nebula.thehellings.com" = "nebula";
|
||||
nebula = "nebula";
|
||||
"thehellings.lan" = "lan";
|
||||
lan = "lan";
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
{ lib, ... }:
|
||||
{
|
||||
hostsByNet =
|
||||
net: hosts:
|
||||
let
|
||||
netAttr =
|
||||
{
|
||||
lan = "ip";
|
||||
nebula = "nebulaIp";
|
||||
tailscale = "ts";
|
||||
}
|
||||
.${net};
|
||||
in
|
||||
lib.mapAttrsToList
|
||||
(name: value: {
|
||||
inherit name;
|
||||
address = builtins.getAttr netAttr value;
|
||||
})
|
||||
(
|
||||
lib.filterAttrs (
|
||||
_host: settings: (builtins.hasAttr netAttr settings) && (builtins.getAttr netAttr settings) != null
|
||||
) hosts
|
||||
);
|
||||
}
|
||||
BIN
Binary file not shown.
@@ -1,32 +1,21 @@
|
||||
apiVersion: source.toolkit.fluxcd.io/v1
|
||||
kind: HelmRepository
|
||||
metadata:
|
||||
name: kubernetes-dashboard
|
||||
name: headlamp
|
||||
spec:
|
||||
url: https://kubernetes.github.io/dashboard/
|
||||
url: "https://kubernetes-sigs.github.io/headlamp/"
|
||||
interval: "24h"
|
||||
---
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: kubernetes-dashboard
|
||||
name: headlamp
|
||||
spec:
|
||||
interval: "24h"
|
||||
chart:
|
||||
spec:
|
||||
chart: kubernetes-dashboard
|
||||
chart: headlamp
|
||||
sourceRef:
|
||||
kind: HelmRepository
|
||||
name: kubernetes-dashboard
|
||||
name: headlamp
|
||||
interval: "24h"
|
||||
values:
|
||||
app:
|
||||
settings:
|
||||
global:
|
||||
clusterName: Hellings Home
|
||||
itemsPerPage: 25
|
||||
ingress:
|
||||
enabled: true
|
||||
hosts:
|
||||
- dashboard.shire-zebra.ts.net
|
||||
ingressClassName: tailscale
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: dashboard-tailscale
|
||||
spec:
|
||||
ingressClassName: tailscale
|
||||
defaultBackend:
|
||||
service:
|
||||
name: headlamp
|
||||
port:
|
||||
number: 3001
|
||||
tls:
|
||||
- hosts:
|
||||
- headlamp
|
||||
@@ -4,3 +4,4 @@ resources:
|
||||
- namespace.yaml
|
||||
- chart.yaml
|
||||
- user.yaml
|
||||
- ingress.yaml
|
||||
|
||||
@@ -1,89 +0,0 @@
|
||||
apiVersion: postgresql.cnpg.io/v1
|
||||
kind: Cluster
|
||||
metadata:
|
||||
name: immich
|
||||
spec:
|
||||
imageName: "ghcr.io/corentingiraud/cnpg-pgvector-vectorchord:16-migration"
|
||||
#imageName: "ghcr.io/tensorchord/cloudnative-pgvecto.rs:16-v0.3.0"
|
||||
#postgresUID: 1
|
||||
instances: 1
|
||||
storage:
|
||||
size: 60Gi
|
||||
primaryUpdateStrategy: unsupervised
|
||||
postgresql:
|
||||
shared_preload_libraries:
|
||||
- vectors.so
|
||||
- vchord.so
|
||||
|
||||
bootstrap:
|
||||
recovery:
|
||||
source: origin
|
||||
# initdb:
|
||||
# database: immich
|
||||
# owner: immich
|
||||
# secret:
|
||||
# name: postgres-user-immich
|
||||
# dataChecksums: true
|
||||
# postInitApplicationSQL:
|
||||
# - ALTER SYSTEM SET search_path TO "$user", public, vectors;
|
||||
# - SET search_path TO "$user", public, vectors;
|
||||
# - CREATE EXTENSION IF NOT EXISTS "cube";
|
||||
# - CREATE EXTENSION IF NOT EXISTS "earthdistance";
|
||||
# - GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO "immich";
|
||||
|
||||
externalClusters:
|
||||
- name: origin
|
||||
plugin:
|
||||
name: barman-cloud.cloudnative-pg.io
|
||||
parameters:
|
||||
barmanObjectName: k3sbackup-objectstore
|
||||
serverName: pgvector
|
||||
|
||||
managed:
|
||||
roles:
|
||||
- name: immich
|
||||
ensure: present
|
||||
comment: Immich DB user
|
||||
login: true
|
||||
superuser: true
|
||||
passwordSecret:
|
||||
name: postgres-user-immich
|
||||
|
||||
plugins:
|
||||
- name: barman-cloud.cloudnative-pg.io
|
||||
isWALArchiver: true
|
||||
parameters:
|
||||
barmanObjectName: k3sbackup-objectstore
|
||||
---
|
||||
apiVersion: postgresql.cnpg.io/v1
|
||||
kind: Database
|
||||
metadata:
|
||||
name: database-immich
|
||||
spec:
|
||||
name: immich
|
||||
owner: immich
|
||||
cluster:
|
||||
name: immich
|
||||
extensions:
|
||||
- name: vectors
|
||||
ensure: present
|
||||
- name: vectorchord
|
||||
ensure: present
|
||||
- name: cube
|
||||
ensure: present
|
||||
- name: earthdistance
|
||||
ensure: present
|
||||
---
|
||||
apiVersion: postgresql.cnpg.io/v1
|
||||
kind: ScheduledBackup
|
||||
metadata:
|
||||
name: immich-backup
|
||||
spec:
|
||||
immediate: true # Create one when this is added to the cluster
|
||||
schedule: "0 2 0 * * *" # 1AM, nightly
|
||||
backupOwnerReference: self
|
||||
cluster:
|
||||
name: immich
|
||||
method: plugin
|
||||
pluginConfiguration:
|
||||
name: barman-cloud.cloudnative-pg.io
|
||||
@@ -7,5 +7,4 @@ resources:
|
||||
- postgres-gitlab.yaml
|
||||
- postgres-pgadmin.yaml
|
||||
- postgres-matrix.yaml
|
||||
- immich.yaml
|
||||
- ingress.yaml
|
||||
|
||||
@@ -133,37 +133,3 @@ spec:
|
||||
remoteRef:
|
||||
key: 685b29c6-9264-4e60-ba4a-b2ea005a5d7b
|
||||
property: password
|
||||
---
|
||||
apiVersion: external-secrets.io/v1
|
||||
kind: ExternalSecret
|
||||
metadata:
|
||||
name: postgres-user-immich
|
||||
namespace: db
|
||||
spec:
|
||||
target:
|
||||
name: postgres-user-immich
|
||||
deletionPolicy: Delete
|
||||
template:
|
||||
type: Opaque
|
||||
data:
|
||||
username: |-
|
||||
{{ .username }}
|
||||
password: |-
|
||||
{{ .password }}
|
||||
data:
|
||||
- secretKey: username
|
||||
sourceRef:
|
||||
storeRef:
|
||||
name: bitwarden-login
|
||||
kind: ClusterSecretStore
|
||||
remoteRef:
|
||||
key: 5ce63e26-dd7f-46d4-b7ed-b310002ef93f
|
||||
property: username
|
||||
- secretKey: password
|
||||
sourceRef:
|
||||
storeRef:
|
||||
name: bitwarden-login
|
||||
kind: ClusterSecretStore
|
||||
remoteRef:
|
||||
key: 5ce63e26-dd7f-46d4-b7ed-b310002ef93f
|
||||
property: password
|
||||
|
||||
@@ -15,7 +15,7 @@ spec:
|
||||
chart:
|
||||
spec:
|
||||
chart: gitea
|
||||
version: "12.5.0"
|
||||
version: "12.5.3"
|
||||
sourceRef:
|
||||
kind: HelmRepository
|
||||
name: gitea-repository
|
||||
@@ -35,7 +35,7 @@ spec:
|
||||
storageClass: longhorn-default
|
||||
|
||||
image:
|
||||
tag: "1.25.4"
|
||||
tag: "1.25.5"
|
||||
|
||||
replicaCount: 1
|
||||
|
||||
|
||||
@@ -13,10 +13,10 @@ spec:
|
||||
USER={{ .dbuser }}
|
||||
PASSWD="""{{ .dbpass }}"""
|
||||
storage: |-
|
||||
MINIO_ACCESS_KEY_ID={{ .minio_key }}
|
||||
MINIO_SECRET_ACCESS_KEY={{ .minio_secret }}
|
||||
minio_key: "{{ .minio_nas1_key }}"
|
||||
minio_secret: "{{ .minio_nas1_secret }}"
|
||||
MINIO_ACCESS_KEY_ID={{ .minio_nas1_key }}
|
||||
MINIO_SECRET_ACCESS_KEY={{ .minio_nas1_secret }}
|
||||
#minio_key: "{{ .minio_nas1_key }}"
|
||||
#minio_secret: "{{ .minio_nas1_secret }}"
|
||||
secretStoreRef:
|
||||
name: bitwarden-login
|
||||
kind: ClusterSecretStore
|
||||
|
||||
@@ -31,3 +31,6 @@ spec:
|
||||
crds:
|
||||
create: true
|
||||
includeCRDs: true
|
||||
webhook:
|
||||
certManager:
|
||||
enable: true
|
||||
|
||||
@@ -22,7 +22,7 @@ spec:
|
||||
chart:
|
||||
spec:
|
||||
chart: kyverno
|
||||
version: "1.17.1"
|
||||
version: "3.7.1"
|
||||
sourceRef:
|
||||
kind: HelmRepository
|
||||
name: kyverno
|
||||
|
||||
@@ -20,14 +20,14 @@ metadata:
|
||||
spec:
|
||||
interval: 10m
|
||||
dependsOn:
|
||||
- name: tailscale-operator
|
||||
- name: tailscale
|
||||
namespace: tailscale
|
||||
- name: kyverno
|
||||
namespace: kyverno
|
||||
namespace: kyverno-system
|
||||
chart:
|
||||
spec:
|
||||
chart: longhorn
|
||||
version: "1.10.2"
|
||||
version: "1.11.1"
|
||||
sourceRef:
|
||||
kind: HelmRepository
|
||||
name: longhorn
|
||||
|
||||
@@ -32,9 +32,9 @@ spec:
|
||||
containers:
|
||||
main:
|
||||
image:
|
||||
tag: v2.4.1
|
||||
tag: v2.7.5
|
||||
env:
|
||||
DB_HOSTNAME: immich-rw.db.svc.cluster.local
|
||||
DB_HOSTNAME: immich-rw
|
||||
DB_DATABASE_NAME: immich
|
||||
DB_USERNAME:
|
||||
valueFrom:
|
||||
|
||||
@@ -0,0 +1,161 @@
|
||||
apiVersion: postgresql.cnpg.io/v1
|
||||
kind: Cluster
|
||||
metadata:
|
||||
name: immich
|
||||
spec:
|
||||
imageName: "ghcr.io/tensorchord/cloudnative-vectorchord:18"
|
||||
#postgresUID: 1
|
||||
instances: 1
|
||||
storage:
|
||||
size: 60Gi
|
||||
primaryUpdateStrategy: unsupervised
|
||||
postgresql:
|
||||
shared_preload_libraries:
|
||||
- vchord.so
|
||||
|
||||
bootstrap:
|
||||
# Use these with the name "immich-1" to restore from the backups
|
||||
recovery:
|
||||
source: origin
|
||||
# Use these two lines in order to restore from the other database,
|
||||
# once it has restored from the WALs
|
||||
#pg_basebackup:
|
||||
# source: restore
|
||||
# Use this block to bootstrap the cluster, if you don't have backups.
|
||||
# What are you doing without backups, you chump?!
|
||||
# initdb:
|
||||
# database: immich
|
||||
# owner: immich
|
||||
# secret:
|
||||
# name: postgres-user-immich
|
||||
# dataChecksums: true
|
||||
# postInitApplicationSQL:
|
||||
# - ALTER SYSTEM SET search_path TO "$user", public, vectors;
|
||||
# - SET search_path TO "$user", public, vectors;
|
||||
# - CREATE EXTENSION IF NOT EXISTS "cube";
|
||||
# - CREATE EXTENSION IF NOT EXISTS "earthdistance";
|
||||
# - GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO "immich";
|
||||
|
||||
externalClusters:
|
||||
- name: origin
|
||||
plugin:
|
||||
name: barman-cloud.cloudnative-pg.io
|
||||
parameters:
|
||||
barmanObjectName: k3sbackup-objectstore
|
||||
serverName: immich
|
||||
- name: restore
|
||||
connectionParameters:
|
||||
host: immich-1-rw
|
||||
user: streaming_replica
|
||||
sslmode: verify-full
|
||||
sslCert:
|
||||
name: immich-1-replication
|
||||
key: tls.crt
|
||||
sslKey:
|
||||
name: immich-1-replication
|
||||
key: tls.key
|
||||
sslRootCert:
|
||||
name: immich-1-ca
|
||||
key: ca.crt
|
||||
|
||||
managed:
|
||||
roles:
|
||||
- name: immich
|
||||
ensure: present
|
||||
comment: Immich DB user
|
||||
login: true
|
||||
superuser: true
|
||||
passwordSecret:
|
||||
name: postgres-user-immich
|
||||
|
||||
plugins:
|
||||
- name: barman-cloud.cloudnative-pg.io
|
||||
isWALArchiver: true
|
||||
parameters:
|
||||
barmanObjectName: k3sbackup-objectstore
|
||||
---
|
||||
apiVersion: postgresql.cnpg.io/v1
|
||||
kind: Database
|
||||
metadata:
|
||||
name: database-immich
|
||||
spec:
|
||||
name: immich
|
||||
owner: immich
|
||||
cluster:
|
||||
name: immich
|
||||
extensions:
|
||||
- name: vectors
|
||||
ensure: present
|
||||
- name: vectorchord
|
||||
ensure: present
|
||||
- name: cube
|
||||
ensure: present
|
||||
- name: earthdistance
|
||||
ensure: present
|
||||
---
|
||||
apiVersion: external-secrets.io/v1
|
||||
kind: ExternalSecret
|
||||
metadata:
|
||||
name: k3sbackup-externalsecret
|
||||
spec:
|
||||
target:
|
||||
name: k3sbackup-secret
|
||||
deletionPolicy: Delete
|
||||
template:
|
||||
type: Opaque
|
||||
data:
|
||||
username: |-
|
||||
{{ .username }}
|
||||
password: |-
|
||||
{{ .password }}
|
||||
data:
|
||||
- secretKey: username
|
||||
sourceRef:
|
||||
storeRef:
|
||||
name: bitwarden-login
|
||||
kind: ClusterSecretStore
|
||||
remoteRef:
|
||||
key: 685b29c6-9264-4e60-ba4a-b2ea005a5d7b
|
||||
property: username
|
||||
- secretKey: password
|
||||
sourceRef:
|
||||
storeRef:
|
||||
name: bitwarden-login
|
||||
kind: ClusterSecretStore
|
||||
remoteRef:
|
||||
key: 685b29c6-9264-4e60-ba4a-b2ea005a5d7b
|
||||
property: password
|
||||
|
||||
---
|
||||
apiVersion: barmancloud.cnpg.io/v1
|
||||
kind: ObjectStore
|
||||
metadata:
|
||||
name: k3sbackup-objectstore
|
||||
spec:
|
||||
configuration:
|
||||
destinationPath: "s3://k3sbackup/postgres"
|
||||
endpointURL: "http://chronicles.thehellings.lan:9000/"
|
||||
s3Credentials:
|
||||
accessKeyId:
|
||||
name: k3sbackup-secret
|
||||
key: username
|
||||
secretAccessKey:
|
||||
name: k3sbackup-secret
|
||||
key: password
|
||||
wal:
|
||||
compression: gzip
|
||||
retentionPolicy: "30d"
|
||||
---
|
||||
apiVersion: postgresql.cnpg.io/v1
|
||||
kind: ScheduledBackup
|
||||
metadata:
|
||||
name: immich-backup
|
||||
spec:
|
||||
immediate: false # Create one when this is added to the cluster
|
||||
schedule: "0 2 0 * * *" # 1AM, nightly
|
||||
backupOwnerReference: self
|
||||
cluster:
|
||||
name: immich
|
||||
method: plugin
|
||||
pluginConfiguration:
|
||||
name: barman-cloud.cloudnative-pg.io
|
||||
@@ -2,8 +2,9 @@ namespace: immich
|
||||
|
||||
resources:
|
||||
- namespace.yaml
|
||||
- chart.yaml
|
||||
- postgres-user-secret.yaml
|
||||
- database.yaml
|
||||
- chart.yaml
|
||||
- pvc.yaml
|
||||
- ingress.yaml
|
||||
- backup.yaml
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
let
|
||||
cfg = config.greg.kubernetes;
|
||||
cert-manager = pkgs.fetchurl {
|
||||
url = "https://github.com/cert-manager/cert-manager/releases/download/v1.18.2/cert-manager.yaml";
|
||||
sha256 = "0vx1nfyhl0rzb6psfxplq8pfp18mrrdk83n8rj2ph8q6r15vcih5";
|
||||
url = "https://github.com/cert-manager/cert-manager/releases/download/v1.20.2/cert-manager.yaml";
|
||||
sha256 = "sha256-HOEcrpEq3sxp5rtiNDX6/J7SFQX57/+YvXHXuA8B2x8=";
|
||||
};
|
||||
flux = pkgs.fetchurl {
|
||||
url = "https://github.com/fluxcd/flux2/releases/download/v2.7.2/install.yaml";
|
||||
|
||||
+8
-1
@@ -2,8 +2,11 @@
|
||||
"infra": {
|
||||
"dns": "10.42.1.5",
|
||||
"gw": "10.42.1.1",
|
||||
"lan": "10.42.0.0/16",
|
||||
"netmask": "255.255.0.0",
|
||||
"prefix": "16"
|
||||
"nebula": "10.157.0.0/16",
|
||||
"prefix": "16",
|
||||
"tailscale": "100.64.0.0/10"
|
||||
},
|
||||
"hosts": {
|
||||
"chronicles": {
|
||||
@@ -110,6 +113,10 @@
|
||||
"external": true,
|
||||
"system": "x86_64-linux"
|
||||
},
|
||||
"printer": {
|
||||
"external": true,
|
||||
"ip": "10.42.1.3"
|
||||
},
|
||||
"proxmoxtemplate": {
|
||||
"external": true,
|
||||
"system": "x86_64-linux"
|
||||
|
||||
Reference in New Issue
Block a user