mirror of
				https://github.com/optim-enterprises-bv/homelab.git
				synced 2025-10-31 18:07:50 +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 | https://raw.githubusercontent.com/metallb/metallb/v0.13.5/config/manifests/metallb-native.yaml | ||||||
|  |  | ||||||
| ```shell | ```shell | ||||||
| kubectl apply -f infra/metallb/00-manifest.yml | kubectl apply -k infra/metallb | ||||||
| ``` |  | ||||||
|  |  | ||||||
| ## Configure MetalLB |  | ||||||
|  |  | ||||||
| ```shell |  | ||||||
| kubectl apply -f infra/metallb/01-configuration.yml |  | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| # Traefik | # Traefik | ||||||
|   | |||||||
| @@ -148,7 +148,7 @@ A test-application `whoami` should be available at `https://whoami.${DOMAIN}`. | |||||||
| # Cleanup | # Cleanup | ||||||
|  |  | ||||||
| ```shell | ```shell | ||||||
| kubectl drain ratatoskr --delete-emptydir-data --force --ignore-daemonsets | kubectl drain gauss --delete-emptydir-data --force --ignore-daemonsets | ||||||
| sudo kubeadm reset | sudo kubeadm reset | ||||||
| sudo iptables -F && sudo iptables -t nat -F && sudo iptables -t mangle -F && sudo iptables -X | sudo iptables -F && sudo iptables -t nat -F && sudo iptables -t mangle -F && sudo iptables -X | ||||||
| sudo ipvsadm -C | sudo ipvsadm -C | ||||||
|   | |||||||
| @@ -6,7 +6,7 @@ resources: | |||||||
|   - namespace.yaml |   - namespace.yaml | ||||||
|   - ingress.yaml |   - ingress.yaml | ||||||
|   - traefik-forward-auth |   - traefik-forward-auth | ||||||
|   - qbittorrent |   - torrent | ||||||
|   - prowlarr |   - prowlarr | ||||||
|   - sonarr |   - sonarr | ||||||
|   - radarr |   - radarr | ||||||
|   | |||||||
| @@ -12,10 +12,10 @@ spec: | |||||||
|       volumes: |       volumes: | ||||||
|         - name: lidarr-config |         - name: lidarr-config | ||||||
|           hostPath: |           hostPath: | ||||||
|             path: "/mnt/sdb1/homelab/config/lidarr" |             path: "/disk/etc/lidarr" | ||||||
|         - name: media-data |         - name: media-data | ||||||
|           hostPath: |           hostPath: | ||||||
|             path: "/mnt/sdb1/data" |             path: "/disk/data" | ||||||
|       containers: |       containers: | ||||||
|         - name: lidarr |         - name: lidarr | ||||||
|           image: lscr.io/linuxserver/lidarr |           image: lscr.io/linuxserver/lidarr | ||||||
|   | |||||||
| @@ -12,7 +12,7 @@ spec: | |||||||
|       volumes: |       volumes: | ||||||
|         - name: prowlarr-config |         - name: prowlarr-config | ||||||
|           hostPath: |           hostPath: | ||||||
|             path: "/mnt/sdb1/homelab/config/prowlarr" |             path: "/disk/etc/prowlarr" | ||||||
|       containers: |       containers: | ||||||
|         - name: prowlarr |         - name: prowlarr | ||||||
|           image: lscr.io/linuxserver/prowlarr:develop |           image: lscr.io/linuxserver/prowlarr:develop | ||||||
|   | |||||||
| @@ -12,10 +12,10 @@ spec: | |||||||
|       volumes: |       volumes: | ||||||
|         - name: radarr-config |         - name: radarr-config | ||||||
|           hostPath: |           hostPath: | ||||||
|             path: "/mnt/sdb1/homelab/config/radarr" |             path: "/disk/etc/radarr" | ||||||
|         - name: media-data |         - name: media-data | ||||||
|           hostPath: |           hostPath: | ||||||
|             path: "/mnt/sdb1/data" |             path: "/disk/data" | ||||||
|       containers: |       containers: | ||||||
|         - name: radarr |         - name: radarr | ||||||
|           image: lscr.io/linuxserver/radarr |           image: lscr.io/linuxserver/radarr | ||||||
|   | |||||||
| @@ -12,10 +12,10 @@ spec: | |||||||
|       volumes: |       volumes: | ||||||
|         - name: sonarr-config |         - name: sonarr-config | ||||||
|           hostPath: |           hostPath: | ||||||
|             path: "/mnt/sdb1/homelab/config/sonarr" |             path: "/disk/etc/sonarr" | ||||||
|         - name: media-data |         - name: media-data | ||||||
|           hostPath: |           hostPath: | ||||||
|             path: "/mnt/sdb1/data" |             path: "/disk/data" | ||||||
|       containers: |       containers: | ||||||
|         - name: sonarr |         - name: sonarr | ||||||
|           image: lscr.io/linuxserver/sonarr |           image: lscr.io/linuxserver/sonarr | ||||||
|   | |||||||
| @@ -12,13 +12,13 @@ spec: | |||||||
|       volumes: |       volumes: | ||||||
|         - name: qbittorrent-config |         - name: qbittorrent-config | ||||||
|           hostPath: |           hostPath: | ||||||
|             path: "/mnt/sdb1/homelab/config/qbittorrent" |             path: "/disk/etc/qbittorrent" | ||||||
|         - name: media-data |         - name: media-data | ||||||
|           hostPath: |           hostPath: | ||||||
|             path: "/mnt/sdb1/data" |             path: "/disk/data" | ||||||
|       containers: |       containers: | ||||||
|         - name: qbittorrent |         - name: qbittorrent | ||||||
|           image: lscr.io/linuxserver/qbittorrent:14.3.9.99202110311443-7435-01519b5e7ubuntu20.04.1-ls166 |           image: cr.hotio.dev/hotio/qbittorrent:legacy | ||||||
|           volumeMounts: |           volumeMounts: | ||||||
|             - mountPath: "/config" |             - mountPath: "/config" | ||||||
|               name: qbittorrent-config |               name: qbittorrent-config | ||||||
| @@ -29,13 +29,15 @@ spec: | |||||||
|               value: "1000" |               value: "1000" | ||||||
|             - name: PGID |             - name: PGID | ||||||
|               value: "1000" |               value: "1000" | ||||||
|  |             - name: UMASK | ||||||
|  |               value: "002" | ||||||
|             - name: TZ |             - name: TZ | ||||||
|               value: Europe/Oslo |               value: Europe/Oslo | ||||||
|             - name: WEBUI_PORT |             - name: WEBUI_PORT | ||||||
|               value: "8112" |               value: "8080" | ||||||
|           ports: |           ports: | ||||||
|             - name: web |             - name: web | ||||||
|               containerPort: 8112 |               containerPort: 8080 | ||||||
|             - containerPort: 11010 |             - containerPort: 11010 | ||||||
|               protocol: TCP |               protocol: TCP | ||||||
|             - containerPort: 11011 |             - containerPort: 11011 | ||||||
| @@ -7,6 +7,7 @@ spec: | |||||||
|   ports: |   ports: | ||||||
|     - name: web |     - name: web | ||||||
|       port: 8112 |       port: 8112 | ||||||
|  |       targetPort: 8080 | ||||||
|     - name: a |     - name: a | ||||||
|       port: 11010 |       port: 11010 | ||||||
|       protocol: TCP |       protocol: TCP | ||||||
| @@ -12,7 +12,7 @@ spec: | |||||||
|       volumes: |       volumes: | ||||||
|         - name: home-assistant-config |         - name: home-assistant-config | ||||||
|           hostPath: |           hostPath: | ||||||
|             path: "/mnt/sdb1/config/home-assistant" |             path: "/disk/etc/home-assistant" | ||||||
|       containers: |       containers: | ||||||
|         - image: homeassistant/home-assistant |         - image: homeassistant/home-assistant | ||||||
|           imagePullPolicy: Always |           imagePullPolicy: Always | ||||||
|   | |||||||
| @@ -12,10 +12,10 @@ spec: | |||||||
|       volumes: |       volumes: | ||||||
|         - name: plex-config |         - name: plex-config | ||||||
|           hostPath: |           hostPath: | ||||||
|             path: "/mnt/sdb1/homelab/config/plex" |             path: "/disk/etc/plex" | ||||||
|         - name: media-data |         - name: media-data | ||||||
|           hostPath: |           hostPath: | ||||||
|             path: "/mnt/sdb1/data" |             path: "/disk/data" | ||||||
|         #- name: plex-config-pv |         #- name: plex-config-pv | ||||||
|         #  persistentVolumeClaim: |         #  persistentVolumeClaim: | ||||||
|         #    claimName: plex-config |         #    claimName: plex-config | ||||||
|   | |||||||
| @@ -11,7 +11,7 @@ spec: | |||||||
|   persistentVolumeReclaimPolicy: Retain |   persistentVolumeReclaimPolicy: Retain | ||||||
|   storageClassName: plex-config |   storageClassName: plex-config | ||||||
|   local: |   local: | ||||||
|     path: "/mnt/sdb1/homelab/config/plex" |     path: "/disk/etc/plex" | ||||||
|   nodeAffinity: |   nodeAffinity: | ||||||
|     required: |     required: | ||||||
|       nodeSelectorTerms: |       nodeSelectorTerms: | ||||||
| @@ -27,14 +27,14 @@ metadata: | |||||||
|   name: media-data-pv |   name: media-data-pv | ||||||
| spec: | spec: | ||||||
|   capacity: |   capacity: | ||||||
|     storage: 1.8Ti |     storage: 11Ti | ||||||
|   volumeMode: Filesystem |   volumeMode: Filesystem | ||||||
|   accessModes: |   accessModes: | ||||||
|     - ReadWriteOnce |     - ReadWriteOnce | ||||||
|   persistentVolumeReclaimPolicy: Retain |   persistentVolumeReclaimPolicy: Retain | ||||||
|   storageClassName: media-data |   storageClassName: media-data | ||||||
|   local: |   local: | ||||||
|     path: "/mnt/sdb1/data" |     path: "/disk/data" | ||||||
|   nodeAffinity: |   nodeAffinity: | ||||||
|     required: |     required: | ||||||
|       nodeSelectorTerms: |       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 |   namespace: metallb-system | ||||||
| spec: | spec: | ||||||
|   addresses: |   addresses: | ||||||
|     - 192.168.1.240-192.168.1.250 |     - 192.168.1.128/25 | ||||||
| 
 | 
 | ||||||
| --- | --- | ||||||
| # Advertise | # 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" |     storage_class_name               = "cert-storage" | ||||||
|     persistent_volume_source { |     persistent_volume_source { | ||||||
|       local { |       local { | ||||||
|         path = "/mnt/sdb1/terrakube/certs" |         path = "/disk/etc/traefik/certs" | ||||||
|       } |       } | ||||||
|     } |     } | ||||||
|     node_affinity { |     node_affinity { | ||||||
| @@ -70,7 +70,7 @@ resource "kubernetes_persistent_volume" "traefik-cert-pv" { | |||||||
|           match_expressions { |           match_expressions { | ||||||
|             key      = "kubernetes.io/hostname" |             key      = "kubernetes.io/hostname" | ||||||
|             operator = "In" |             operator = "In" | ||||||
|             values   = ["ratatoskr"] |             values   = ["gauss"] | ||||||
|           } |           } | ||||||
|         } |         } | ||||||
|       } |       } | ||||||
| @@ -89,69 +89,3 @@ resource "helm_release" "traefik" { | |||||||
|  |  | ||||||
|   values = [file("helm/traefik-values.yaml")] |   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