fix: proxmox-csi-plugin configuration

Missing volumes attributes
This commit is contained in:
Vegard Hagen
2024-07-21 23:20:29 +02:00
parent f39dc98104
commit f65eb23cc5
14 changed files with 241 additions and 28 deletions
@@ -0,0 +1,12 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
configMapGenerator:
- name: common-env
namespace: arr
literals:
- TZ="Europe/Oslo"
resources:
- pvc.yaml
- deployment.yaml
@@ -0,0 +1,71 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: sonarr
namespace: arr
labels:
app: sonarr
spec:
replicas: 1
selector:
matchLabels:
app: sonarr
strategy:
type: Recreate
template:
metadata:
namespace: sonarr
labels:
app: sonarr
spec:
nodeSelector:
kubernetes.io/hostname: ctrl-02
#topology.kubernetes.io/zone: cantor
securityContext:
runAsNonRoot: true
runAsUser: 65534
runAsGroup: 65534
fsGroup: 65534
fsGroupChangePolicy: OnRootMismatch
seccompProfile:
type: RuntimeDefault
containers:
- name: sonarr
image: ghcr.io/onedr0p/sonarr:4.0.6
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop: [ "ALL" ]
ports:
- name: http
containerPort: 8989
envFrom:
- configMapRef:
name: common-env
volumeMounts:
- name: sonarr-config
mountPath: /config
- name: backup
mountPath: /backup
- name: data
mountPath: /app/data
resources:
requests:
cpu: 100m
memory: 384Mi
limits:
cpu: 1000m
memory: 512Mi
volumes:
- name: sonarr-config
persistentVolumeClaim:
claimName: sonarr-config
- name: data
nfs:
server: 192.168.1.55
path: /mnt/pool-0/data
- name: backup
nfs:
server: 192.168.1.55
path: /mnt/pool-0/backup
@@ -0,0 +1,13 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: sonarr-config
namespace: arr
spec:
storageClassName: proxmox-csi
volumeName: pv-sonarr-config
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 4G
@@ -3,7 +3,7 @@ kind: Kustomization
resources:
- ns.yaml
# - http-route.yaml
- http-route.yaml
helmCharts:
- name: argo-cd
@@ -0,0 +1,24 @@
tunnel: gauss-k8s
credentials-file: /etc/cloudflared/creds/credentials.json
metrics: 0.0.0.0:2000
no-autoupdate: true
warp-routing:
enabled: true
ingress:
- hostname: hello.euclid.stonegarden.dev
service: hello_world
- hostname: haos.stonegarden.dev
service: https://cilium-gateway-stonegarden.gateway.svc.cluster.local:443
originRequest:
originServerName: "*.stonegarden.dev"
- hostname: "*.euclid.stonegarden.dev"
service: https://cilium-gateway-euclid.gateway.svc.cluster.local:443
originRequest:
originServerName: "*.euclid.stonegarden.dev"
- hostname: "*.stonegarden.dev"
service: https://cilium-gateway-stonegarden.gateway.svc.cluster.local:443
originRequest:
originServerName: "*.stonegarden.dev"
- service: http_status:404
@@ -0,0 +1,55 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: cloudflared
name: cloudflared
namespace: cloudflared
spec:
replicas: 1
selector:
matchLabels:
app: cloudflared
template:
metadata:
labels:
app: cloudflared
spec:
containers:
- name: cloudflared
image: cloudflare/cloudflared:2024.2.1
imagePullPolicy: Always
args:
- tunnel
- --config
- /etc/cloudflared/config/config.yaml
- run
livenessProbe:
httpGet:
path: /ready
port: 2000
initialDelaySeconds: 60
failureThreshold: 5
periodSeconds: 10
resources:
limits:
cpu: 100m
memory: 64Mi
requests:
cpu: 20m
memory: 32Mi
volumeMounts:
- name: cloudflared-config
mountPath: /etc/cloudflared/config/config.yaml
subPath: cloudflared-config.yaml
- name: tunnel-credentials
mountPath: /etc/cloudflared/creds
readOnly: true
restartPolicy: Always
volumes:
- name: cloudflared-config
configMap:
name: cloudflared-config
- name: tunnel-credentials
secret:
secretName: tunnel-credentials
@@ -0,0 +1,13 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
configMapGenerator:
- name: cloudflared-config
namespace: cloudflared
files:
- cloudflared-config.yaml
resources:
- ns.yaml
- tunnel-credentials.yaml
- deployment.yaml
@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: cloudflared
@@ -0,0 +1,15 @@
---
apiVersion: bitnami.com/v1alpha1
kind: SealedSecret
metadata:
creationTimestamp: null
name: tunnel-credentials
namespace: cloudflared
spec:
encryptedData:
credentials.json: AgDa8Wgyu4nbMyc55U6kOOvDTpL6LT7wPM1T+JKgjBtO+IRplYpIW5wwaWGqQF8tj47CHLhDyEiNyk9Srk9IgDTNKOYOjyCUFj/vt/s5hiKFsFQdGiKrqXQB4WwH2P02pPUacJOzOhbtOltCRTYtUlmvikSM4XzeYOoS1i1ikb9TvFPeKQ6o8LqViDUv+s4xAr/TX6j+7DJge5/BgKNI6ntR93sN1aTerSUl1opNVhMOsfPz5WvAjuhNh1c4V1xTzk/xc9nq0uJ9MHD2O9o68vwBDwNystp4vOz4l/X1pi1ZsM4QQkmdX7LIH4fDdzPSf1f5SfDd5ssHmAGXkzGQtJfFCwAcFl0vm/0f2a3Ema6+jCibkuL0DKGh3ca+wjAJFxH7T1mqSP84djC54CqyR5cPXBzM29vWqSJG802YXf0J0pT78/3NW6chD9cQNiqQh4cslqc11Ye7VOkt4b5FWXLczcl9qqtpBmBIdmKmokO81vEGtt/P2rMeX02cQg500pW/WO+MrLq8LanKiJZuJfy1YSNO7hzeSLbN6O/Tkvl7GKV7h08sCDUJFwlFc8DrX8YfYdFSzL8rRzg5pMg434ECPxNnYN2EKAF0re4PeY3RvKiRkZxZ3KZMMX3EpiR+5joLBUeDGMbCfTFt8gVhaHZDBO69b+WrDtAYuIgM74qCPz3j30ToYAI1H0vprAI0NghnDb/IgF0m/ASlvQ0dqR/Y+OHZggLJI0hvu/MVYnwvJmUHK4NUl3V4BPg9SZp4bCZM0NF5QIZZBmG+DfSlrAMBWBbYZRfRSIoo/vfxblk8E9YKa2RMusiVep0Gs4FKDF4kG1YBK+u3XV/8ot7lih/EHKMk2DgczoQnqlCMbZzY4vKfaSVpmv66lbcVk7PXZIDrTdPef89C3VcJxA5kjmVW5w==
template:
metadata:
creationTimestamp: null
name: tunnel-credentials
namespace: cloudflared
@@ -1,10 +1,10 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
#resources:
resources:
# - ns.yaml
## - https://raw.githubusercontent.com/sergelogvinov/proxmox-csi-plugin/v0.7.0/docs/deploy/proxmox-csi-plugin-release.yml
# - storage-class.yaml
- https://raw.githubusercontent.com/sergelogvinov/proxmox-csi-plugin/v0.7.0/docs/deploy/proxmox-csi-plugin-release.yml
- storage-class.yaml
#images:
# - name: ghcr.io/sergelogvinov/proxmox-csi-node
@@ -12,14 +12,14 @@ kind: Kustomization
# - name: ghcr.io/sergelogvinov/proxmox-csi-controller
# newTag: edge
helmCharts:
- name: proxmox-csi-plugin
repo: oci://ghcr.io/sergelogvinov/charts
version: 0.2.5
releaseName: proxmox-csi-plugin
includeCRDs: true
namespace: csi-proxmox
valuesFile: values.yaml
#helmCharts:
# - name: proxmox-csi-plugin
# repo: oci://ghcr.io/sergelogvinov/charts
# version: 0.2.5
# releaseName: proxmox-csi-plugin
# includeCRDs: true
# namespace: csi-proxmox
# valuesFile: values.yaml
#helmCharts:
# - name: proxmox-csi-plugin
@@ -1,6 +1,6 @@
module "proxmox-volume" {
for_each = var.volumes
source = "./proxmox-volume"
source = "./proxmox-volume"
providers = {
restapi = restapi
@@ -8,15 +8,18 @@ module "proxmox-volume" {
proxmox_api = var.proxmox_api
volume = {
name = each.key
node = each.value.node
size = each.value.size
name = each.key
node = each.value.node
size = each.value.size
storage = each.value.storage
vmid = each.value.vmid
format = each.value.format
}
}
module "persistent-volume" {
for_each = var.volumes
source = "./persistent-volume"
source = "./persistent-volume"
providers = {
kubernetes = kubernetes
@@ -26,5 +29,6 @@ module "persistent-volume" {
name = each.key
capacity = each.value.size
volume_handle = "${var.proxmox_api.cluster_name}/${module.proxmox-volume[each.key].node}/${module.proxmox-volume[each.key].storage}/${module.proxmox-volume[each.key].filename}"
storage = each.value.storage
}
}
@@ -12,10 +12,14 @@ resource "kubernetes_persistent_volume" "pv" {
volume_mode = var.volume.volume_mode
persistent_volume_source {
csi {
driver = var.volume.driver
fs_type = var.volume.fs_type
volume_handle = var.volume.volume_handle
volume_attributes = var.volume.volume_attributes
driver = var.volume.driver
fs_type = var.volume.fs_type
volume_handle = var.volume.volume_handle
volume_attributes = {
cache = var.volume.cache
ssd = var.volume.ssd == true ? "true" : "false"
storage = var.volume.storage
}
}
}
}
@@ -5,15 +5,13 @@ variable "volume" {
capacity = string
volume_handle = string
access_modes = optional(list(string), ["ReadWriteOnce"])
storage_class_name = optional(string, "porxmox-csi")
storage_class_name = optional(string, "proxmox-csi")
fs_type = optional(string, "ext4")
driver = optional(string, "csi.proxmox.sinextra.dev")
volume_mode = optional(string, "Filesystem")
mount_options = optional(list(string), ["noatime"])
volume_attributes = optional(object({}), {
cache = "writethrough"
ssd = "true"
storage = "local-zfs"
})
cache = optional(string, "writethrough")
ssd = optional(bool, true)
storage = optional(string, "local-zfs")
})
}
@@ -9,8 +9,8 @@ variable "proxmox_api" {
variable "volume" {
type = object({
node = string
name = string
node = string
size = string
storage = optional(string, "local-zfs")
vmid = optional(number, 9999)