mirror of
				https://github.com/optim-enterprises-bv/homelab.git
				synced 2025-10-31 09:57:59 +00:00 
			
		
		
		
	feat(config): Config changes after switching to Debian
This commit is contained in:
		| @@ -39,13 +39,7 @@ cilium install | ||||
| https://raw.githubusercontent.com/metallb/metallb/v0.13.5/config/manifests/metallb-native.yaml | ||||
|  | ||||
| ```shell | ||||
| kubectl apply -f infra/metallb/00-manifest.yml | ||||
| ``` | ||||
|  | ||||
| ## Configure MetalLB | ||||
|  | ||||
| ```shell | ||||
| kubectl apply -f infra/metallb/01-configuration.yml | ||||
| kubectl apply -k infra/metallb | ||||
| ``` | ||||
|  | ||||
| # Traefik | ||||
|   | ||||
| @@ -148,7 +148,7 @@ A test-application `whoami` should be available at `https://whoami.${DOMAIN}`. | ||||
| # Cleanup | ||||
|  | ||||
| ```shell | ||||
| kubectl drain ratatoskr --delete-emptydir-data --force --ignore-daemonsets | ||||
| kubectl drain gauss --delete-emptydir-data --force --ignore-daemonsets | ||||
| sudo kubeadm reset | ||||
| sudo iptables -F && sudo iptables -t nat -F && sudo iptables -t mangle -F && sudo iptables -X | ||||
| sudo ipvsadm -C | ||||
|   | ||||
| @@ -6,7 +6,7 @@ resources: | ||||
|   - namespace.yaml | ||||
|   - ingress.yaml | ||||
|   - traefik-forward-auth | ||||
|   - qbittorrent | ||||
|   - torrent | ||||
|   - prowlarr | ||||
|   - sonarr | ||||
|   - radarr | ||||
|   | ||||
| @@ -12,10 +12,10 @@ spec: | ||||
|       volumes: | ||||
|         - name: lidarr-config | ||||
|           hostPath: | ||||
|             path: "/mnt/sdb1/homelab/config/lidarr" | ||||
|             path: "/disk/etc/lidarr" | ||||
|         - name: media-data | ||||
|           hostPath: | ||||
|             path: "/mnt/sdb1/data" | ||||
|             path: "/disk/data" | ||||
|       containers: | ||||
|         - name: lidarr | ||||
|           image: lscr.io/linuxserver/lidarr | ||||
|   | ||||
| @@ -12,7 +12,7 @@ spec: | ||||
|       volumes: | ||||
|         - name: prowlarr-config | ||||
|           hostPath: | ||||
|             path: "/mnt/sdb1/homelab/config/prowlarr" | ||||
|             path: "/disk/etc/prowlarr" | ||||
|       containers: | ||||
|         - name: prowlarr | ||||
|           image: lscr.io/linuxserver/prowlarr:develop | ||||
|   | ||||
| @@ -12,10 +12,10 @@ spec: | ||||
|       volumes: | ||||
|         - name: radarr-config | ||||
|           hostPath: | ||||
|             path: "/mnt/sdb1/homelab/config/radarr" | ||||
|             path: "/disk/etc/radarr" | ||||
|         - name: media-data | ||||
|           hostPath: | ||||
|             path: "/mnt/sdb1/data" | ||||
|             path: "/disk/data" | ||||
|       containers: | ||||
|         - name: radarr | ||||
|           image: lscr.io/linuxserver/radarr | ||||
|   | ||||
| @@ -12,10 +12,10 @@ spec: | ||||
|       volumes: | ||||
|         - name: sonarr-config | ||||
|           hostPath: | ||||
|             path: "/mnt/sdb1/homelab/config/sonarr" | ||||
|             path: "/disk/etc/sonarr" | ||||
|         - name: media-data | ||||
|           hostPath: | ||||
|             path: "/mnt/sdb1/data" | ||||
|             path: "/disk/data" | ||||
|       containers: | ||||
|         - name: sonarr | ||||
|           image: lscr.io/linuxserver/sonarr | ||||
|   | ||||
| @@ -12,13 +12,13 @@ spec: | ||||
|       volumes: | ||||
|         - name: qbittorrent-config | ||||
|           hostPath: | ||||
|             path: "/mnt/sdb1/homelab/config/qbittorrent" | ||||
|             path: "/disk/etc/qbittorrent" | ||||
|         - name: media-data | ||||
|           hostPath: | ||||
|             path: "/mnt/sdb1/data" | ||||
|             path: "/disk/data" | ||||
|       containers: | ||||
|         - name: qbittorrent | ||||
|           image: lscr.io/linuxserver/qbittorrent:14.3.9.99202110311443-7435-01519b5e7ubuntu20.04.1-ls166 | ||||
|           image: cr.hotio.dev/hotio/qbittorrent:legacy | ||||
|           volumeMounts: | ||||
|             - mountPath: "/config" | ||||
|               name: qbittorrent-config | ||||
| @@ -29,13 +29,15 @@ spec: | ||||
|               value: "1000" | ||||
|             - name: PGID | ||||
|               value: "1000" | ||||
|             - name: UMASK | ||||
|               value: "002" | ||||
|             - name: TZ | ||||
|               value: Europe/Oslo | ||||
|             - name: WEBUI_PORT | ||||
|               value: "8112" | ||||
|               value: "8080" | ||||
|           ports: | ||||
|             - name: web | ||||
|               containerPort: 8112 | ||||
|               containerPort: 8080 | ||||
|             - containerPort: 11010 | ||||
|               protocol: TCP | ||||
|             - containerPort: 11011 | ||||
| @@ -7,6 +7,7 @@ spec: | ||||
|   ports: | ||||
|     - name: web | ||||
|       port: 8112 | ||||
|       targetPort: 8080 | ||||
|     - name: a | ||||
|       port: 11010 | ||||
|       protocol: TCP | ||||
| @@ -12,7 +12,7 @@ spec: | ||||
|       volumes: | ||||
|         - name: home-assistant-config | ||||
|           hostPath: | ||||
|             path: "/mnt/sdb1/config/home-assistant" | ||||
|             path: "/disk/etc/home-assistant" | ||||
|       containers: | ||||
|         - image: homeassistant/home-assistant | ||||
|           imagePullPolicy: Always | ||||
|   | ||||
| @@ -12,10 +12,10 @@ spec: | ||||
|       volumes: | ||||
|         - name: plex-config | ||||
|           hostPath: | ||||
|             path: "/mnt/sdb1/homelab/config/plex" | ||||
|             path: "/disk/etc/plex" | ||||
|         - name: media-data | ||||
|           hostPath: | ||||
|             path: "/mnt/sdb1/data" | ||||
|             path: "/disk/data" | ||||
|         #- name: plex-config-pv | ||||
|         #  persistentVolumeClaim: | ||||
|         #    claimName: plex-config | ||||
|   | ||||
| @@ -11,7 +11,7 @@ spec: | ||||
|   persistentVolumeReclaimPolicy: Retain | ||||
|   storageClassName: plex-config | ||||
|   local: | ||||
|     path: "/mnt/sdb1/homelab/config/plex" | ||||
|     path: "/disk/etc/plex" | ||||
|   nodeAffinity: | ||||
|     required: | ||||
|       nodeSelectorTerms: | ||||
| @@ -27,14 +27,14 @@ metadata: | ||||
|   name: media-data-pv | ||||
| spec: | ||||
|   capacity: | ||||
|     storage: 1.8Ti | ||||
|     storage: 11Ti | ||||
|   volumeMode: Filesystem | ||||
|   accessModes: | ||||
|     - ReadWriteOnce | ||||
|   persistentVolumeReclaimPolicy: Retain | ||||
|   storageClassName: media-data | ||||
|   local: | ||||
|     path: "/mnt/sdb1/data" | ||||
|     path: "/disk/data" | ||||
|   nodeAffinity: | ||||
|     required: | ||||
|       nodeSelectorTerms: | ||||
|   | ||||
							
								
								
									
										5
									
								
								infra/kustomization.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								infra/kustomization.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | ||||
| apiVersion: kustomize.config.k8s.io/v1beta1 | ||||
| kind: Kustomization | ||||
|  | ||||
| resources: | ||||
|   - metallb | ||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @@ -6,7 +6,7 @@ metadata: | ||||
|   namespace: metallb-system | ||||
| spec: | ||||
|   addresses: | ||||
|     - 192.168.1.240-192.168.1.250 | ||||
|     - 192.168.1.128/25 | ||||
| 
 | ||||
| --- | ||||
| # Advertise | ||||
							
								
								
									
										8
									
								
								infra/metallb/kustomization.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								infra/metallb/kustomization.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,8 @@ | ||||
| apiVersion: kustomize.config.k8s.io/v1beta1 | ||||
| kind: Kustomization | ||||
|  | ||||
| namespace: metallb-system | ||||
|  | ||||
| resources: | ||||
|   - github.com/metallb/metallb/config/native?ref=v0.13.7 | ||||
|   - configuration.yml | ||||
| @@ -1,29 +0,0 @@ | ||||
| apiVersion: storage.k8s.io/v1 | ||||
| kind: StorageClass | ||||
| metadata: | ||||
|   name: cert-storage | ||||
| provisioner: kubernetes.io/no-provisioner | ||||
| volumeBindingMode: WaitForFirstConsumer | ||||
| --- | ||||
| apiVersion: v1 | ||||
| kind: PersistentVolume | ||||
| metadata: | ||||
|   name: traefik-cert-pv | ||||
| spec: | ||||
|   capacity: | ||||
|     storage: 128Mi | ||||
|   volumeMode: Filesystem | ||||
|   accessModes: | ||||
|     - ReadWriteOnce | ||||
|   persistentVolumeReclaimPolicy: Retain | ||||
|   storageClassName: cert-storage | ||||
|   local: | ||||
|     path: "/mnt/sdb1/terrakube/certs" | ||||
|   nodeAffinity: | ||||
|     required: | ||||
|       nodeSelectorTerms: | ||||
|         - matchExpressions: | ||||
|             - key: kubernetes.io/hostname | ||||
|               operator: In | ||||
|               values: | ||||
|                 - ratatoskr | ||||
							
								
								
									
										70
									
								
								main.tf
									
									
									
									
									
								
							
							
						
						
									
										70
									
								
								main.tf
									
									
									
									
									
								
							| @@ -61,7 +61,7 @@ resource "kubernetes_persistent_volume" "traefik-cert-pv" { | ||||
|     storage_class_name               = "cert-storage" | ||||
|     persistent_volume_source { | ||||
|       local { | ||||
|         path = "/mnt/sdb1/terrakube/certs" | ||||
|         path = "/disk/etc/traefik/certs" | ||||
|       } | ||||
|     } | ||||
|     node_affinity { | ||||
| @@ -70,7 +70,7 @@ resource "kubernetes_persistent_volume" "traefik-cert-pv" { | ||||
|           match_expressions { | ||||
|             key      = "kubernetes.io/hostname" | ||||
|             operator = "In" | ||||
|             values   = ["ratatoskr"] | ||||
|             values   = ["gauss"] | ||||
|           } | ||||
|         } | ||||
|       } | ||||
| @@ -89,69 +89,3 @@ resource "helm_release" "traefik" { | ||||
|  | ||||
|   values = [file("helm/traefik-values.yaml")] | ||||
| } | ||||
|  | ||||
| resource "kubernetes_namespace" "test" { | ||||
|   metadata { | ||||
|     name = "test" | ||||
|   } | ||||
| } | ||||
|  | ||||
| resource "kubernetes_service" "test" { | ||||
|   metadata { | ||||
|     name = "test" | ||||
|     namespace = kubernetes_namespace.test.metadata.0.name | ||||
|   } | ||||
|   spec { | ||||
|     selector = { | ||||
|       app = kubernetes_deployment.test.spec.0.template.0.metadata.0.labels.app | ||||
|     } | ||||
|  | ||||
|     type = "LoadBalancer" | ||||
|     port { | ||||
|       protocol = "TCP" | ||||
|       name = "web" | ||||
|       port = 80 | ||||
|     } | ||||
|   } | ||||
| } | ||||
|  | ||||
| resource "kubernetes_deployment" "test" { | ||||
|   metadata { | ||||
|     name = "test" | ||||
|     namespace = kubernetes_namespace.test.metadata.0.name | ||||
|   } | ||||
|   spec { | ||||
|     replicas = "2" | ||||
|     selector { | ||||
|       match_labels = { | ||||
|         app = "test" | ||||
|       } | ||||
|     } | ||||
|     template { | ||||
|       metadata { | ||||
|         labels = { | ||||
|           app = "test" | ||||
|         } | ||||
|       } | ||||
|       spec { | ||||
|         container { | ||||
|           name = "test" | ||||
|           image = "traefik/whoami" | ||||
|           port { | ||||
|             name = "web" | ||||
|             container_port = 80 | ||||
|           } | ||||
|         } | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| } | ||||
|  | ||||
| #resource "helm_release" "whoami" { | ||||
| #  name       = "whoami" | ||||
| #  repository = "https://charts.itscontained.io" | ||||
| #  chart      = "raw" | ||||
| #  version    = "0.2.5" | ||||
| # | ||||
| #  values = [file("helm/whoami-values.yaml")] | ||||
| #} | ||||
		Reference in New Issue
	
	Block a user
	 Vegard Hagen
					Vegard Hagen