mirror of
https://gitea.fenix-dev.com/fenix-gitea-admin/iac-ansible-private.git
synced 2026-03-22 12:29:47 +00:00
Compare commits
38 Commits
32ef4ccb0d
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 9297ee3964 | |||
| 0a0e3982e8 | |||
| c0ac96265e | |||
| 71fe67c1e0 | |||
| 8a49477449 | |||
| 46505df323 | |||
| 0294601e2c | |||
| 1e827ede7b | |||
| d8e54b6af4 | |||
| 7f42b439c9 | |||
| 67dc792660 | |||
| 128823f456 | |||
| 9e703cf9fd | |||
| 8ccda6978e | |||
| f832f2ad37 | |||
| f7c345e505 | |||
| 5460418ecb | |||
| 696c542b6b | |||
| 0fda7f84ba | |||
| 82f9ab4ead | |||
| 51c4466103 | |||
| cb1bf070b0 | |||
| 8dec820f1d | |||
| 31f624c429 | |||
| 955d1ac2f2 | |||
| 4377f5917c | |||
| 4eb7726ed8 | |||
| 369b8dae80 | |||
| 1c24b3e030 | |||
| 607a6b82c3 | |||
| 3c4fab1534 | |||
| 4b1fa18f7f | |||
| 40b8d89ee7 | |||
| bdda2191c4 | |||
| 6c5290a118 | |||
| b857640bf6 | |||
| ff0f048859 | |||
| 78659b1c77 |
@ -13,3 +13,6 @@ flaresolverr comes from https://github.com/FlareSolverr/FlareSolverr
|
||||
jellyseer comes from https://hub.docker.com/r/fallenbagel/jellyseerr
|
||||
and https://docs.seerr.dev/extending-jellyseerr/database-config
|
||||
decluttarr comes from https://github.com/ManiMatter/decluttarr
|
||||
minecraft comes from https://www.civo.com/learn/deploying-minecraft-server-kubernetes
|
||||
|
||||

|
||||
BIN
fenix-iac.png
Normal file
BIN
fenix-iac.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.0 MiB |
14
playbook.yml
14
playbook.yml
@ -6,6 +6,7 @@
|
||||
- vaultwarden
|
||||
- kubernetes
|
||||
- kube-master
|
||||
- nvidia-base
|
||||
|
||||
- name: Configure Kubernetes Nodes
|
||||
hosts: workers
|
||||
@ -15,17 +16,30 @@
|
||||
- vaultwarden
|
||||
- kubernetes
|
||||
- kube-node
|
||||
- nvidia-base
|
||||
|
||||
- name: Configure Kubernetes Data
|
||||
hosts: master
|
||||
become: yes
|
||||
roles:
|
||||
- nvidia
|
||||
- stolon
|
||||
- cloudflared
|
||||
- qbittorrent
|
||||
- prowlarr
|
||||
- sonarr
|
||||
- radarr
|
||||
- jellyfin
|
||||
- flaresolverr
|
||||
- jellyseerr
|
||||
- decluttarr
|
||||
- bazarr
|
||||
- libreTranslate
|
||||
- lingarr
|
||||
- cripto
|
||||
- anchorr
|
||||
- lazylibrarian
|
||||
- mangareader
|
||||
- bookshelf
|
||||
- shelfarr
|
||||
- minecraft
|
||||
46
roles/anchorr/files/anchorr-deployment.yaml
Normal file
46
roles/anchorr/files/anchorr-deployment.yaml
Normal file
@ -0,0 +1,46 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: anchorr
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: anchorr
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: anchorr
|
||||
spec:
|
||||
imagePullSecrets:
|
||||
- name: regcred
|
||||
containers:
|
||||
- name: anchorr
|
||||
image: nairdah/anchorr:latest
|
||||
securityContext:
|
||||
capabilities:
|
||||
add:
|
||||
- NET_ADMIN
|
||||
ports:
|
||||
- containerPort: 8282
|
||||
name: webhook
|
||||
env:
|
||||
- name: PUID
|
||||
value: "1013"
|
||||
- name: PGID
|
||||
value: "1013"
|
||||
- name: TZ
|
||||
value: 'Etc/UTC'
|
||||
- name: NODE_ENV
|
||||
value: 'production'
|
||||
- name: WEBHOOK_PORT
|
||||
value: '8282'
|
||||
volumeMounts:
|
||||
- name: config
|
||||
mountPath: /usr/src/app/config
|
||||
volumes:
|
||||
- name: config
|
||||
persistentVolumeClaim:
|
||||
claimName: anchorr-config-pvc
|
||||
|
||||
11
roles/anchorr/files/anchorr-nfs-csi.yaml
Normal file
11
roles/anchorr/files/anchorr-nfs-csi.yaml
Normal file
@ -0,0 +1,11 @@
|
||||
apiVersion: storage.k8s.io/v1
|
||||
kind: StorageClass
|
||||
metadata:
|
||||
name: anchorr-nfs-csi
|
||||
namespace: stack-arr
|
||||
provisioner: nfs.csi.k8s.io
|
||||
parameters:
|
||||
server: 192.168.1.22
|
||||
share: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/stack-arr/anchorr
|
||||
allowVolumeExpansion: true
|
||||
reclaimPolicy: Retain
|
||||
29
roles/anchorr/files/anchorr-pvcs.yaml
Normal file
29
roles/anchorr/files/anchorr-pvcs.yaml
Normal file
@ -0,0 +1,29 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: anchorr-config-pv
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
capacity:
|
||||
storage: 2Gi
|
||||
storageClassName: anchorr-nfs-csi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
persistentVolumeReclaimPolicy: Retain
|
||||
nfs:
|
||||
server: 192.168.1.22
|
||||
path: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/stack-arr/anchorr/config
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: anchorr-config-pvc
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
storageClassName: anchorr-nfs-csi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
volumeName: anchorr-config-pv
|
||||
resources:
|
||||
requests:
|
||||
storage: 2Gi
|
||||
12
roles/anchorr/files/anchorr-service.yaml
Normal file
12
roles/anchorr/files/anchorr-service.yaml
Normal file
@ -0,0 +1,12 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: anchorr-service
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
ports:
|
||||
- port: 8282
|
||||
targetPort: 8282
|
||||
selector:
|
||||
app: anchorr
|
||||
type: ClusterIP
|
||||
51
roles/anchorr/tasks/main.yml
Normal file
51
roles/anchorr/tasks/main.yml
Normal file
@ -0,0 +1,51 @@
|
||||
- name: Remover o diretório /tmp/stack-arr/anchorr/kubernetes-files
|
||||
ansible.builtin.file:
|
||||
path: /tmp/stack-arr/anchorr/kubernetes-files
|
||||
state: absent
|
||||
|
||||
- name: Criar diretório temporário no remoto
|
||||
file:
|
||||
path: /tmp/stack-arr/anchorr/kubernetes-files
|
||||
state: directory
|
||||
mode: '0755'
|
||||
|
||||
- name: Copy file with owner and permissions
|
||||
ansible.builtin.copy:
|
||||
src: ../files
|
||||
dest: /tmp/stack-arr/anchorr/kubernetes-files
|
||||
owner: fenix
|
||||
group: root
|
||||
mode: '0644'
|
||||
|
||||
|
||||
#- name: Obter várias notas do Bitwarden
|
||||
# shell: |
|
||||
# echo "unlock"
|
||||
# BW_SESSION=$(bw unlock {{ bw_password }} --raw)
|
||||
# echo "get item"
|
||||
# bw get item "{{ item.id }}" --session $BW_SESSION | jq -r '.notes' > {{ item.dest }}
|
||||
# loop:
|
||||
# - { id: "iac.ansible.stackarr.anchorr.secret", dest: "/tmp/stack-arr/anchorr/kubernetes-files/files/anchorr-secret.yaml" }
|
||||
# args:
|
||||
# executable: /bin/bash
|
||||
# environment:
|
||||
# BW_PASSWORD: "{{ BW_PASSWORD }}"
|
||||
|
||||
|
||||
- name: Listar conteúdo do diretório remoto
|
||||
shell: ls -l /tmp/stack-arr/anchorr/kubernetes-files/files
|
||||
register: resultado_ls
|
||||
|
||||
|
||||
- name: Mostrar resultado do ls
|
||||
debug:
|
||||
var: resultado_ls.stdout_lines
|
||||
|
||||
|
||||
- name: Aplicar o stolon
|
||||
become: yes
|
||||
become_user: fenix
|
||||
shell: |
|
||||
kubectl apply -f /tmp/stack-arr/anchorr/kubernetes-files/files/
|
||||
environment:
|
||||
KUBECONFIG: /home/fenix/.kube/config
|
||||
4
roles/anchorr/vars/main.yml
Normal file
4
roles/anchorr/vars/main.yml
Normal file
@ -0,0 +1,4 @@
|
||||
bw_password: "{{ lookup('env', 'BW_PASSWORD') }}"
|
||||
VAULTWARDEN_LINK: "{{ lookup('env', 'VAULTWARDEN_LINK') }}"
|
||||
BW_CLIENTID: "{{ lookup('env', 'BW_CLIENTID') }}"
|
||||
BW_CLIENTSECRET : "{{ lookup('env', 'BW_CLIENTSECRET') }}"
|
||||
70
roles/bazarr/files/bazarr-deployment.yaml
Normal file
70
roles/bazarr/files/bazarr-deployment.yaml
Normal file
@ -0,0 +1,70 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: bazarr
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: bazarr
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: bazarr
|
||||
spec:
|
||||
imagePullSecrets:
|
||||
- name: regcred
|
||||
containers:
|
||||
- name: bazarr
|
||||
image: lscr.io/linuxserver/bazarr:1.5.3
|
||||
securityContext:
|
||||
capabilities:
|
||||
add:
|
||||
- NET_ADMIN
|
||||
ports:
|
||||
- containerPort: 6767
|
||||
name: webui
|
||||
env:
|
||||
- name: PUID
|
||||
value: "1013"
|
||||
- name: PGID
|
||||
value: "1013"
|
||||
- name: TZ
|
||||
value: 'Etc/UTC'
|
||||
- name: POSTGRES_ENABLED
|
||||
value: 'true'
|
||||
- name: POSTGRES_HOST
|
||||
value: 'stolon-proxy-service.postgresql.svc.cluster.local'
|
||||
- name: POSTGRES_PORT
|
||||
value: '5432'
|
||||
- name: POSTGRES_USERNAME
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: bazarr-secret
|
||||
key: username
|
||||
- name: POSTGRES_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: bazarr-secret
|
||||
key: password
|
||||
- name: POSTGRES_DATABASE
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: bazarr-secret
|
||||
key: maindb
|
||||
volumeMounts:
|
||||
- name: config
|
||||
mountPath: /config
|
||||
- name: media
|
||||
mountPath: /media
|
||||
volumes:
|
||||
- name: config
|
||||
persistentVolumeClaim:
|
||||
claimName: bazarr-config-pvc
|
||||
- name: media
|
||||
persistentVolumeClaim:
|
||||
claimName: bazarr-media-pvc
|
||||
|
||||
|
||||
|
||||
11
roles/bazarr/files/bazarr-nfs-csi.yaml
Normal file
11
roles/bazarr/files/bazarr-nfs-csi.yaml
Normal file
@ -0,0 +1,11 @@
|
||||
apiVersion: storage.k8s.io/v1
|
||||
kind: StorageClass
|
||||
metadata:
|
||||
name: bazarr-nfs-csi
|
||||
namespace: stack-arr
|
||||
provisioner: nfs.csi.k8s.io
|
||||
parameters:
|
||||
server: 192.168.1.22
|
||||
share: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/stack-arr/bazarr
|
||||
allowVolumeExpansion: true
|
||||
reclaimPolicy: Retain
|
||||
60
roles/bazarr/files/bazarr-pvcs.yaml
Normal file
60
roles/bazarr/files/bazarr-pvcs.yaml
Normal file
@ -0,0 +1,60 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: bazarr-config-pv
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
capacity:
|
||||
storage: 2Gi
|
||||
storageClassName: bazarr-nfs-csi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
persistentVolumeReclaimPolicy: Retain
|
||||
nfs:
|
||||
server: 192.168.1.22
|
||||
path: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/stack-arr/bazarr/config
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: bazarr-config-pvc
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
storageClassName: bazarr-nfs-csi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
volumeName: bazarr-config-pv
|
||||
resources:
|
||||
requests:
|
||||
storage: 2Gi
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: bazarr-media-pv
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
capacity:
|
||||
storage: 150Gi
|
||||
storageClassName: jellyfin-videos-nfs-csi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
persistentVolumeReclaimPolicy: Retain
|
||||
nfs:
|
||||
server: 192.168.1.22
|
||||
path: /mnt/fenix-main-nas-pool-0/data/Filmes_e_Series
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: bazarr-media-pvc
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
storageClassName: jellyfin-videos-nfs-csi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
volumeName: bazarr-media-pv
|
||||
resources:
|
||||
requests:
|
||||
storage: 150Gi
|
||||
---
|
||||
11
roles/bazarr/files/bazarr-secret.yaml
Normal file
11
roles/bazarr/files/bazarr-secret.yaml
Normal file
@ -0,0 +1,11 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: bazarr-secret
|
||||
namespace: stack-arr
|
||||
type: Opaque
|
||||
data:
|
||||
username: dXNlcm5hbWU=
|
||||
password: cGFzc3dvcmQ=
|
||||
maindb: bWFpbmRiLXByb3dsYXJy
|
||||
logsdb: bG9nZGItcHJvd2xhcnI=
|
||||
12
roles/bazarr/files/bazarr-service.yaml
Normal file
12
roles/bazarr/files/bazarr-service.yaml
Normal file
@ -0,0 +1,12 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: bazarr-service
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
ports:
|
||||
- port: 6767
|
||||
targetPort: 6767
|
||||
selector:
|
||||
app: bazarr
|
||||
type: ClusterIP
|
||||
51
roles/bazarr/tasks/main.yml
Normal file
51
roles/bazarr/tasks/main.yml
Normal file
@ -0,0 +1,51 @@
|
||||
- name: Remover o diretório /tmp/stack-arr/bazarr/kubernetes-files
|
||||
ansible.builtin.file:
|
||||
path: /tmp/stack-arr/bazarr/kubernetes-files
|
||||
state: absent
|
||||
|
||||
- name: Criar diretório temporário no remoto
|
||||
file:
|
||||
path: /tmp/stack-arr/bazarr/kubernetes-files
|
||||
state: directory
|
||||
mode: '0755'
|
||||
|
||||
- name: Copy file with owner and permissions
|
||||
ansible.builtin.copy:
|
||||
src: ../files
|
||||
dest: /tmp/stack-arr/bazarr/kubernetes-files
|
||||
owner: fenix
|
||||
group: root
|
||||
mode: '0644'
|
||||
|
||||
|
||||
- name: Obter várias notas do Bitwarden
|
||||
shell: |
|
||||
echo "unlock"
|
||||
BW_SESSION=$(bw unlock {{ bw_password }} --raw)
|
||||
echo "get item"
|
||||
bw get item "{{ item.id }}" --session $BW_SESSION | jq -r '.notes' > {{ item.dest }}
|
||||
loop:
|
||||
- { id: "iac.ansible.stackarr.bazarr.secret", dest: "/tmp/stack-arr/bazarr/kubernetes-files/files/bazarr-secret.yaml" }
|
||||
args:
|
||||
executable: /bin/bash
|
||||
environment:
|
||||
BW_PASSWORD: "{{ BW_PASSWORD }}"
|
||||
|
||||
|
||||
- name: Listar conteúdo do diretório remoto
|
||||
shell: ls -l /tmp/stack-arr/bazarr/kubernetes-files/files
|
||||
register: resultado_ls
|
||||
|
||||
|
||||
- name: Mostrar resultado do ls
|
||||
debug:
|
||||
var: resultado_ls.stdout_lines
|
||||
|
||||
|
||||
- name: Aplicar o stolon
|
||||
become: yes
|
||||
become_user: fenix
|
||||
shell: |
|
||||
kubectl apply -f /tmp/stack-arr/bazarr/kubernetes-files/files/
|
||||
environment:
|
||||
KUBECONFIG: /home/fenix/.kube/config
|
||||
4
roles/bazarr/vars/main.yml
Normal file
4
roles/bazarr/vars/main.yml
Normal file
@ -0,0 +1,4 @@
|
||||
bw_password: "{{ lookup('env', 'BW_PASSWORD') }}"
|
||||
VAULTWARDEN_LINK: "{{ lookup('env', 'VAULTWARDEN_LINK') }}"
|
||||
BW_CLIENTID: "{{ lookup('env', 'BW_CLIENTID') }}"
|
||||
BW_CLIENTSECRET : "{{ lookup('env', 'BW_CLIENTSECRET') }}"
|
||||
54
roles/bookshelf/files/bookshelf-deployment.yaml
Normal file
54
roles/bookshelf/files/bookshelf-deployment.yaml
Normal file
@ -0,0 +1,54 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: bookshelf
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: bookshelf
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: bookshelf
|
||||
spec:
|
||||
imagePullSecrets:
|
||||
- name: regcred
|
||||
containers:
|
||||
- name: bookshelf
|
||||
image: ghcr.io/pennydreadful/bookshelf:softcover-v0.4.20.91
|
||||
securityContext:
|
||||
capabilities:
|
||||
add:
|
||||
- NET_ADMIN
|
||||
ports:
|
||||
- containerPort: 8787
|
||||
name: webui
|
||||
env:
|
||||
- name: PUID
|
||||
value: "1013"
|
||||
- name: PGID
|
||||
value: "1013"
|
||||
- name: TZ
|
||||
value: 'Etc/UTC'
|
||||
volumeMounts:
|
||||
- name: config
|
||||
mountPath: /config
|
||||
- name: books
|
||||
mountPath: /books
|
||||
- name: downloads
|
||||
mountPath: /downloads
|
||||
volumes:
|
||||
- name: config
|
||||
persistentVolumeClaim:
|
||||
claimName: bookshelf-config-pvc
|
||||
- name: books
|
||||
persistentVolumeClaim:
|
||||
claimName: bookshelf-books-pvc
|
||||
- name: downloads
|
||||
persistentVolumeClaim:
|
||||
claimName: qbittorrent-downloads-pvc
|
||||
|
||||
|
||||
|
||||
11
roles/bookshelf/files/bookshelf-nfs-csi.yaml
Normal file
11
roles/bookshelf/files/bookshelf-nfs-csi.yaml
Normal file
@ -0,0 +1,11 @@
|
||||
apiVersion: storage.k8s.io/v1
|
||||
kind: StorageClass
|
||||
metadata:
|
||||
name: bookshelf-nfs-csi
|
||||
namespace: stack-arr
|
||||
provisioner: nfs.csi.k8s.io
|
||||
parameters:
|
||||
server: 192.168.1.22
|
||||
share: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/stack-arr/bookshelf
|
||||
allowVolumeExpansion: true
|
||||
reclaimPolicy: Retain
|
||||
60
roles/bookshelf/files/bookshelf-pvcs.yaml
Normal file
60
roles/bookshelf/files/bookshelf-pvcs.yaml
Normal file
@ -0,0 +1,60 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: bookshelf-config-pv
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
capacity:
|
||||
storage: 20Gi
|
||||
storageClassName: bookshelf-nfs-csi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
persistentVolumeReclaimPolicy: Retain
|
||||
nfs:
|
||||
server: 192.168.1.22
|
||||
path: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/stack-arr/bookshelf/config
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: bookshelf-config-pvc
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
storageClassName: bookshelf-nfs-csi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
volumeName: bookshelf-config-pv
|
||||
resources:
|
||||
requests:
|
||||
storage: 20Gi
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: bookshelf-media-pv
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
capacity:
|
||||
storage: 150Gi
|
||||
storageClassName: jellyfin-videos-nfs-csi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
persistentVolumeReclaimPolicy: Retain
|
||||
nfs:
|
||||
server: 192.168.1.22
|
||||
path: /mnt/fenix-main-nas-pool-0/data/Filmes_e_Series/Livros
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: bookshelf-books-pvc
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
storageClassName: jellyfin-videos-nfs-csi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
volumeName: bookshelf-media-pv
|
||||
resources:
|
||||
requests:
|
||||
storage: 150Gi
|
||||
---
|
||||
12
roles/bookshelf/files/bookshelf-service.yaml
Normal file
12
roles/bookshelf/files/bookshelf-service.yaml
Normal file
@ -0,0 +1,12 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: bookshelf-service
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
ports:
|
||||
- port: 8787
|
||||
targetPort: 8787
|
||||
selector:
|
||||
app: bookshelf
|
||||
type: ClusterIP
|
||||
51
roles/bookshelf/tasks/main.yml
Normal file
51
roles/bookshelf/tasks/main.yml
Normal file
@ -0,0 +1,51 @@
|
||||
- name: Remover o diretório /tmp/stack-arr/bookshelf/kubernetes-files
|
||||
ansible.builtin.file:
|
||||
path: /tmp/stack-arr/bookshelf/kubernetes-files
|
||||
state: absent
|
||||
|
||||
- name: Criar diretório temporário no remoto
|
||||
file:
|
||||
path: /tmp/stack-arr/bookshelf/kubernetes-files
|
||||
state: directory
|
||||
mode: '0755'
|
||||
|
||||
- name: Copy file with owner and permissions
|
||||
ansible.builtin.copy:
|
||||
src: ../files
|
||||
dest: /tmp/stack-arr/bookshelf/kubernetes-files
|
||||
owner: fenix
|
||||
group: root
|
||||
mode: '0644'
|
||||
|
||||
|
||||
#- name: Obter várias notas do Bitwarden
|
||||
# shell: |
|
||||
# echo "unlock"
|
||||
# BW_SESSION=$(bw unlock {{ bw_password }} --raw)
|
||||
# echo "get item"
|
||||
# bw get item "{{ item.id }}" --session $BW_SESSION | jq -r '.notes' > {{ item.dest }}
|
||||
# loop:
|
||||
# - { id: "iac.ansible.stackarr.bookshelf.secret", dest: "/tmp/stack-arr/bookshelf/kubernetes-files/files/bookshelf-secret.yaml" }
|
||||
# args:
|
||||
# executable: /bin/bash
|
||||
# environment:
|
||||
# BW_PASSWORD: "{{ BW_PASSWORD }}"
|
||||
|
||||
|
||||
- name: Listar conteúdo do diretório remoto
|
||||
shell: ls -l /tmp/stack-arr/bookshelf/kubernetes-files/files
|
||||
register: resultado_ls
|
||||
|
||||
|
||||
- name: Mostrar resultado do ls
|
||||
debug:
|
||||
var: resultado_ls.stdout_lines
|
||||
|
||||
|
||||
- name: Aplicar o stolon
|
||||
become: yes
|
||||
become_user: fenix
|
||||
shell: |
|
||||
kubectl apply -f /tmp/stack-arr/bookshelf/kubernetes-files/files/
|
||||
environment:
|
||||
KUBECONFIG: /home/fenix/.kube/config
|
||||
4
roles/bookshelf/vars/main.yml
Normal file
4
roles/bookshelf/vars/main.yml
Normal file
@ -0,0 +1,4 @@
|
||||
bw_password: "{{ lookup('env', 'BW_PASSWORD') }}"
|
||||
VAULTWARDEN_LINK: "{{ lookup('env', 'VAULTWARDEN_LINK') }}"
|
||||
BW_CLIENTID: "{{ lookup('env', 'BW_CLIENTID') }}"
|
||||
BW_CLIENTSECRET : "{{ lookup('env', 'BW_CLIENTSECRET') }}"
|
||||
94
roles/cripto/files/ai-deployment.yaml
Normal file
94
roles/cripto/files/ai-deployment.yaml
Normal file
@ -0,0 +1,94 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: fenix-ai
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: crypto-forecast-api-deployment
|
||||
namespace: fenix-ai
|
||||
spec:
|
||||
replicas: 0
|
||||
selector:
|
||||
matchLabels:
|
||||
app: crypto-forecast-api
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: crypto-forecast-api
|
||||
spec:
|
||||
containers:
|
||||
- name: crypto-forecast-api
|
||||
image: gitea.fenix-dev.com/fenix-gitea-admin/fenix-cripto-api:0.0.19
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
resources:
|
||||
limits:
|
||||
nvidia.com/gpu: 1 # garante uso da tua RTX 4060 Ti
|
||||
env:
|
||||
- name: ASPNETCORE_ENVIRONMENT
|
||||
value: Development
|
||||
volumeMounts:
|
||||
- name: model
|
||||
mountPath: /models
|
||||
volumes:
|
||||
- name: model
|
||||
persistentVolumeClaim:
|
||||
claimName: crypto-forecast-api-model-pvc
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: crypto-forecast-api-svc
|
||||
namespace: fenix-ai
|
||||
spec:
|
||||
selector:
|
||||
app: crypto-forecast-api
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 8080
|
||||
targetPort: 8080
|
||||
type: NodePort # ou LoadBalancer se tiveres suporte
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: crypto-forecast-api-model-pv
|
||||
namespace: fenix-ai
|
||||
spec:
|
||||
capacity:
|
||||
storage: 20Gi
|
||||
storageClassName: fenix-ai-nfs-csi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
persistentVolumeReclaimPolicy: Retain
|
||||
nfs:
|
||||
server: 192.168.1.22
|
||||
path: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/fenix/ai/api/model
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: crypto-forecast-api-model-pvc
|
||||
namespace: fenix-ai
|
||||
spec:
|
||||
storageClassName: fenix-ai-nfs-csi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
volumeName: crypto-forecast-api-model-pv
|
||||
resources:
|
||||
requests:
|
||||
storage: 20Gi
|
||||
---
|
||||
apiVersion: storage.k8s.io/v1
|
||||
kind: StorageClass
|
||||
metadata:
|
||||
name: fenix-ai-nfs-csi
|
||||
namespace: fenix-ai
|
||||
provisioner: nfs.csi.k8s.io
|
||||
parameters:
|
||||
server: 192.168.1.22
|
||||
share: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/
|
||||
allowVolumeExpansion: true
|
||||
reclaimPolicy: Retain
|
||||
4
roles/cripto/files/ai-namespace.yaml
Normal file
4
roles/cripto/files/ai-namespace.yaml
Normal file
@ -0,0 +1,4 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: fenix-ai
|
||||
97
roles/cripto/files/ai-ollama-deployment.yaml
Normal file
97
roles/cripto/files/ai-ollama-deployment.yaml
Normal file
@ -0,0 +1,97 @@
|
||||
apiVersion: metallb.io/v1beta1
|
||||
kind: IPAddressPool
|
||||
metadata:
|
||||
name: local-pool-2
|
||||
namespace: metallb-system
|
||||
spec:
|
||||
addresses:
|
||||
- 192.168.1.100-192.168.1.200
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: ollama-deployment
|
||||
namespace: fenix-ai
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: ollama
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: ollama
|
||||
spec:
|
||||
containers:
|
||||
- name: ollama
|
||||
image: ollama/ollama:latest
|
||||
ports:
|
||||
- containerPort: 11434
|
||||
resources:
|
||||
limits:
|
||||
nvidia.com/gpu: 1 # garante uso da tua RTX 4060 Ti
|
||||
env:
|
||||
- name: OLLAMA_HOST
|
||||
value: "0.0.0.0"
|
||||
volumeMounts:
|
||||
- name: ollama-data
|
||||
mountPath: /root/.ollama
|
||||
volumes:
|
||||
- name: ollama-data
|
||||
persistentVolumeClaim:
|
||||
claimName: ollama-data-pvc
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: ollama-api-svc
|
||||
namespace: fenix-ai
|
||||
spec:
|
||||
selector:
|
||||
app: ollama
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 11434
|
||||
targetPort: 11434
|
||||
type: NodePort # ou LoadBalancer se tiveres suporte
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: ollama-data-pv
|
||||
namespace: fenix-ai
|
||||
spec:
|
||||
capacity:
|
||||
storage: 20Gi
|
||||
storageClassName: ollama-ai-nfs-csi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
persistentVolumeReclaimPolicy: Retain
|
||||
nfs:
|
||||
server: 192.168.1.22
|
||||
path: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/ollama
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: ollama-data-pvc
|
||||
namespace: fenix-ai
|
||||
spec:
|
||||
storageClassName: ollama-ai-nfs-csi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 20Gi
|
||||
---
|
||||
apiVersion: storage.k8s.io/v1
|
||||
kind: StorageClass
|
||||
metadata:
|
||||
name: ollama-ai-nfs-csi
|
||||
namespace: fenix-ai
|
||||
provisioner: nfs.csi.k8s.io
|
||||
parameters:
|
||||
server: 192.168.1.22
|
||||
share: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/ollama
|
||||
allowVolumeExpansion: true
|
||||
reclaimPolicy: Retain
|
||||
51
roles/cripto/tasks/main.yml
Normal file
51
roles/cripto/tasks/main.yml
Normal file
@ -0,0 +1,51 @@
|
||||
- name: Remover o diretório /tmp/fenix-ai/kubernetes-files
|
||||
ansible.builtin.file:
|
||||
path: /tmp/fenix-ai/kubernetes-files
|
||||
state: absent
|
||||
|
||||
- name: Criar diretório temporário no remoto
|
||||
file:
|
||||
path: /tmp/fenix-ai/kubernetes-files
|
||||
state: directory
|
||||
mode: '0755'
|
||||
|
||||
- name: Copy file with owner and permissions
|
||||
ansible.builtin.copy:
|
||||
src: ../files
|
||||
dest: /tmp/fenix-ai/kubernetes-files
|
||||
owner: fenix
|
||||
group: root
|
||||
mode: '0644'
|
||||
|
||||
|
||||
#- name: Obter várias notas do Bitwarden
|
||||
# shell: |
|
||||
# echo "unlock"
|
||||
# BW_SESSION=$(bw unlock {{ bw_password }} --raw)
|
||||
# echo "get item"
|
||||
# bw get item "{{ item.id }}" --session $BW_SESSION | jq -r '.notes' > {{ item.dest }}
|
||||
# loop:
|
||||
# - { id: "iac.ansible.stackarr.decluttarr.secret", dest: "/tmp/stack-arr/decluttarr/kubernetes-files/files/decluttarr-secret.yaml" }
|
||||
# args:
|
||||
# executable: /bin/bash
|
||||
# environment:
|
||||
# BW_PASSWORD: "{{ BW_PASSWORD }}"
|
||||
|
||||
|
||||
- name: Listar conteúdo do diretório remoto
|
||||
shell: ls -l /tmp/fenix-ai/kubernetes-files/files
|
||||
register: resultado_ls
|
||||
|
||||
|
||||
- name: Mostrar resultado do ls
|
||||
debug:
|
||||
var: resultado_ls.stdout_lines
|
||||
|
||||
|
||||
- name: Aplicar o stolon
|
||||
become: yes
|
||||
become_user: fenix
|
||||
shell: |
|
||||
kubectl apply -f /tmp/fenix-ai/kubernetes-files/files/
|
||||
environment:
|
||||
KUBECONFIG: /home/fenix/.kube/config
|
||||
4
roles/cripto/vars/main.yml
Normal file
4
roles/cripto/vars/main.yml
Normal file
@ -0,0 +1,4 @@
|
||||
bw_password: "{{ lookup('env', 'BW_PASSWORD') }}"
|
||||
VAULTWARDEN_LINK: "{{ lookup('env', 'VAULTWARDEN_LINK') }}"
|
||||
BW_CLIENTID: "{{ lookup('env', 'BW_CLIENTID') }}"
|
||||
BW_CLIENTSECRET : "{{ lookup('env', 'BW_CLIENTSECRET') }}"
|
||||
@ -17,20 +17,16 @@ spec:
|
||||
- name: regcred
|
||||
containers:
|
||||
- name: decluttarr
|
||||
image: ghcr.io/manimatter/decluttarr:latest
|
||||
image: ghcr.io/manimatter/decluttarr:v1.50.2
|
||||
env:
|
||||
- name: PUID
|
||||
value: "1013"
|
||||
- name: PGID
|
||||
value: "1013"
|
||||
- name: TZ
|
||||
value: 'Etc/UTC'
|
||||
- name: LOG_LEVEL
|
||||
value: VERBOSE
|
||||
- name: REMOVE_TIMER
|
||||
value: '1'
|
||||
value: '3'
|
||||
- name: REMOVE_FAILED
|
||||
value: 'True'
|
||||
- name: REMOVE_FAILED_IMPORTS
|
||||
value: 'True'
|
||||
value: 'False'
|
||||
- name: REMOVE_METADATA_MISSING
|
||||
value: 'True'
|
||||
- name: REMOVE_MISSING_FILES
|
||||
@ -46,17 +42,26 @@ spec:
|
||||
- name: MIN_DOWNLOAD_SPEED
|
||||
value: '100'
|
||||
- name: PERMITTED_ATTEMPTS
|
||||
value: '2'
|
||||
- name: SONARR
|
||||
value: '3'
|
||||
- name: SONARR_URL
|
||||
value: http://sonarr-service.stack-arr.svc.cluster.local:8989
|
||||
- name: SONARR_KEY
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: decluttarr-secret
|
||||
key: sonarr
|
||||
- name: QBITTORRENT
|
||||
key: sonarrkey
|
||||
- name: QBITTORRENT_URL
|
||||
value: http://qbittorrent-service.stack-arr.svc.cluster.local:8080
|
||||
- name: QBITTORRENT_USERNAME
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: decluttarr-secret
|
||||
key: bittorrent
|
||||
key: qbittorrentuser
|
||||
- name: QBITTORRENT_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: decluttarr-secret
|
||||
key: qbittorrentpass
|
||||
volumeMounts:
|
||||
- name: config
|
||||
mountPath: /config
|
||||
|
||||
@ -5,6 +5,6 @@ metadata:
|
||||
namespace: stack-arr
|
||||
type: Opaque
|
||||
data:
|
||||
radarr: IC0gYmFzZV91cmw6ICJodHRwOi8vcmFkYXJyOjc4NzgiCiAgIGFwaV9rZXk6ICJSQURBUlJfQVBJX0tFWSI=
|
||||
sonarr: IC0gYmFzZV91cmw6ICJodHRwOi8vc29uYXJyMTo4OTg5IgogICBhcGlfa2V5OiAiU09OQVJSX0FQSV9LRVki
|
||||
bittorrent: LSBiYXNlX3VybDogImh0dHA6Ly9xYml0dG9ycmVudC1zZXJ2aWNlLnN0YWNrLWFyci5zdmMuY2x1c3Rlci5sb2NhbDo4MDgwIgogIHVzZXJuYW1lOiAidXNlciIgCiAgcGFzc3dvcmQ6ICJwYXNzIgogIG5hbWU6ICJxQml0dG9ycmVudCIKICAgICAgICA=
|
||||
sonarrkey: M2tkMDRscjk1bGY5M29lMDNsZTAzbGU=
|
||||
qbittorrentuser: dXNlcg==
|
||||
qbittorrentpass: cGFzcw==
|
||||
@ -17,7 +17,11 @@ spec:
|
||||
- name: regcred
|
||||
containers:
|
||||
- name: jellyfin
|
||||
image: lscr.io/linuxserver/jellyfin:10.11.2
|
||||
image: lscr.io/linuxserver/jellyfin:10.11.5
|
||||
resources:
|
||||
limits:
|
||||
memory: "9G" # Maximum memory allowed
|
||||
cpu: "4" # Maximum CPU allowed
|
||||
securityContext:
|
||||
capabilities:
|
||||
add:
|
||||
@ -43,6 +47,8 @@ spec:
|
||||
mountPath: /config
|
||||
- name: videos
|
||||
mountPath: /videos
|
||||
- name: books
|
||||
mountPath: /books
|
||||
volumes:
|
||||
- name: config
|
||||
persistentVolumeClaim:
|
||||
@ -50,6 +56,9 @@ spec:
|
||||
- name: videos
|
||||
persistentVolumeClaim:
|
||||
claimName: jellyfin-videos-pvc
|
||||
- name: books
|
||||
persistentVolumeClaim:
|
||||
claimName: jellyfin-books-pvc
|
||||
|
||||
|
||||
|
||||
|
||||
@ -13,6 +13,9 @@ spec:
|
||||
nfs:
|
||||
server: 192.168.1.22
|
||||
path: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/stack-arr/jellyfin/config
|
||||
mountOptions:
|
||||
- nolock
|
||||
- nfsvers=3
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
@ -58,3 +61,33 @@ spec:
|
||||
requests:
|
||||
storage: 150Gi
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: jellyfin-books-pv
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
capacity:
|
||||
storage: 150Gi
|
||||
storageClassName: jellyfin-videos-nfs-csi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
persistentVolumeReclaimPolicy: Retain
|
||||
nfs:
|
||||
server: 192.168.1.22
|
||||
path: /mnt/fenix-main-nas-pool-0/data/Filmes_e_Series/Livros
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: jellyfin-books-pvc
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
storageClassName: jellyfin-videos-nfs-csi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
volumeName: jellyfin-books-pv
|
||||
resources:
|
||||
requests:
|
||||
storage: 150Gi
|
||||
---
|
||||
54
roles/lazylibrarian/files/lazylibrarian-deployment.yaml
Normal file
54
roles/lazylibrarian/files/lazylibrarian-deployment.yaml
Normal file
@ -0,0 +1,54 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: lazylibrarian
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: lazylibrarian
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: lazylibrarian
|
||||
spec:
|
||||
imagePullSecrets:
|
||||
- name: regcred
|
||||
containers:
|
||||
- name: lazylibrarian
|
||||
image: lscr.io/linuxserver/lazylibrarian:latest
|
||||
securityContext:
|
||||
capabilities:
|
||||
add:
|
||||
- NET_ADMIN
|
||||
ports:
|
||||
- containerPort: 5299
|
||||
name: webui
|
||||
env:
|
||||
- name: PUID
|
||||
value: "1013"
|
||||
- name: PGID
|
||||
value: "1013"
|
||||
- name: TZ
|
||||
value: 'Etc/UTC'
|
||||
volumeMounts:
|
||||
- name: config
|
||||
mountPath: /config
|
||||
- name: books
|
||||
mountPath: /books
|
||||
- name: downloads
|
||||
mountPath: /downloads
|
||||
volumes:
|
||||
- name: config
|
||||
persistentVolumeClaim:
|
||||
claimName: lazylibrarian-config-pvc
|
||||
- name: books
|
||||
persistentVolumeClaim:
|
||||
claimName: lazylibrarian-books-pvc
|
||||
- name: downloads
|
||||
persistentVolumeClaim:
|
||||
claimName: qbittorrent-downloads-pvc
|
||||
|
||||
|
||||
|
||||
11
roles/lazylibrarian/files/lazylibrarian-nfs-csi.yaml
Normal file
11
roles/lazylibrarian/files/lazylibrarian-nfs-csi.yaml
Normal file
@ -0,0 +1,11 @@
|
||||
apiVersion: storage.k8s.io/v1
|
||||
kind: StorageClass
|
||||
metadata:
|
||||
name: lazylibrarian-nfs-csi
|
||||
namespace: stack-arr
|
||||
provisioner: nfs.csi.k8s.io
|
||||
parameters:
|
||||
server: 192.168.1.22
|
||||
share: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/stack-arr/lazylibrarian
|
||||
allowVolumeExpansion: true
|
||||
reclaimPolicy: Retain
|
||||
60
roles/lazylibrarian/files/lazylibrarian-pvcs.yaml
Normal file
60
roles/lazylibrarian/files/lazylibrarian-pvcs.yaml
Normal file
@ -0,0 +1,60 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: lazylibrarian-config-pv
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
capacity:
|
||||
storage: 20Gi
|
||||
storageClassName: lazylibrarian-nfs-csi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
persistentVolumeReclaimPolicy: Retain
|
||||
nfs:
|
||||
server: 192.168.1.22
|
||||
path: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/stack-arr/lazylibrarian/config
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: lazylibrarian-config-pvc
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
storageClassName: lazylibrarian-nfs-csi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
volumeName: lazylibrarian-config-pv
|
||||
resources:
|
||||
requests:
|
||||
storage: 20Gi
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: lazylibrarian-media-pv
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
capacity:
|
||||
storage: 150Gi
|
||||
storageClassName: jellyfin-videos-nfs-csi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
persistentVolumeReclaimPolicy: Retain
|
||||
nfs:
|
||||
server: 192.168.1.22
|
||||
path: /mnt/fenix-main-nas-pool-0/data/Filmes_e_Series/Livros
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: lazylibrarian-books-pvc
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
storageClassName: jellyfin-videos-nfs-csi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
volumeName: lazylibrarian-media-pv
|
||||
resources:
|
||||
requests:
|
||||
storage: 150Gi
|
||||
---
|
||||
12
roles/lazylibrarian/files/lazylibrarian-service.yaml
Normal file
12
roles/lazylibrarian/files/lazylibrarian-service.yaml
Normal file
@ -0,0 +1,12 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: lazylibrarian-service
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
ports:
|
||||
- port: 5299
|
||||
targetPort: 5299
|
||||
selector:
|
||||
app: lazylibrarian
|
||||
type: ClusterIP
|
||||
51
roles/lazylibrarian/tasks/main.yml
Normal file
51
roles/lazylibrarian/tasks/main.yml
Normal file
@ -0,0 +1,51 @@
|
||||
- name: Remover o diretório /tmp/stack-arr/lazylibrarian/kubernetes-files
|
||||
ansible.builtin.file:
|
||||
path: /tmp/stack-arr/lazylibrarian/kubernetes-files
|
||||
state: absent
|
||||
|
||||
- name: Criar diretório temporário no remoto
|
||||
file:
|
||||
path: /tmp/stack-arr/lazylibrarian/kubernetes-files
|
||||
state: directory
|
||||
mode: '0755'
|
||||
|
||||
- name: Copy file with owner and permissions
|
||||
ansible.builtin.copy:
|
||||
src: ../files
|
||||
dest: /tmp/stack-arr/lazylibrarian/kubernetes-files
|
||||
owner: fenix
|
||||
group: root
|
||||
mode: '0644'
|
||||
|
||||
|
||||
#- name: Obter várias notas do Bitwarden
|
||||
# shell: |
|
||||
# echo "unlock"
|
||||
# BW_SESSION=$(bw unlock {{ bw_password }} --raw)
|
||||
# echo "get item"
|
||||
# bw get item "{{ item.id }}" --session $BW_SESSION | jq -r '.notes' > {{ item.dest }}
|
||||
# loop:
|
||||
# - { id: "iac.ansible.stackarr.lazylibrarian.secret", dest: "/tmp/stack-arr/lazylibrarian/kubernetes-files/files/lazylibrarian-secret.yaml" }
|
||||
# args:
|
||||
# executable: /bin/bash
|
||||
# environment:
|
||||
# BW_PASSWORD: "{{ BW_PASSWORD }}"
|
||||
|
||||
|
||||
- name: Listar conteúdo do diretório remoto
|
||||
shell: ls -l /tmp/stack-arr/lazylibrarian/kubernetes-files/files
|
||||
register: resultado_ls
|
||||
|
||||
|
||||
- name: Mostrar resultado do ls
|
||||
debug:
|
||||
var: resultado_ls.stdout_lines
|
||||
|
||||
|
||||
- name: Aplicar o stolon
|
||||
become: yes
|
||||
become_user: fenix
|
||||
shell: |
|
||||
kubectl apply -f /tmp/stack-arr/lazylibrarian/kubernetes-files/files/
|
||||
environment:
|
||||
KUBECONFIG: /home/fenix/.kube/config
|
||||
4
roles/lazylibrarian/vars/main.yml
Normal file
4
roles/lazylibrarian/vars/main.yml
Normal file
@ -0,0 +1,4 @@
|
||||
bw_password: "{{ lookup('env', 'BW_PASSWORD') }}"
|
||||
VAULTWARDEN_LINK: "{{ lookup('env', 'VAULTWARDEN_LINK') }}"
|
||||
BW_CLIENTID: "{{ lookup('env', 'BW_CLIENTID') }}"
|
||||
BW_CLIENTSECRET : "{{ lookup('env', 'BW_CLIENTSECRET') }}"
|
||||
26
roles/libreTranslate/files/libretranslate-deployment.yaml
Normal file
26
roles/libreTranslate/files/libretranslate-deployment.yaml
Normal file
@ -0,0 +1,26 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: libretranslate
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: libretranslate
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: libretranslate
|
||||
spec:
|
||||
containers:
|
||||
- name: libretranslate
|
||||
image: libretranslate/libretranslate:latest
|
||||
ports:
|
||||
- containerPort: 5000
|
||||
env:
|
||||
- name: LT_HTTP_HOST
|
||||
value: "0.0.0.0"
|
||||
- name: LT_HTTP_PORT
|
||||
value: "5000"
|
||||
|
||||
12
roles/libreTranslate/files/libretranslate-service.yaml
Normal file
12
roles/libreTranslate/files/libretranslate-service.yaml
Normal file
@ -0,0 +1,12 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: libretranslate-service
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
ports:
|
||||
- port: 5000
|
||||
targetPort: 5000
|
||||
selector:
|
||||
app: libretranslate
|
||||
type: ClusterIP
|
||||
51
roles/libreTranslate/tasks/main.yml
Normal file
51
roles/libreTranslate/tasks/main.yml
Normal file
@ -0,0 +1,51 @@
|
||||
- name: Remover o diretório /tmp/stack-arr/libreTranslate/kubernetes-files
|
||||
ansible.builtin.file:
|
||||
path: /tmp/stack-arr/libreTranslate/kubernetes-files
|
||||
state: absent
|
||||
|
||||
- name: Criar diretório temporário no remoto
|
||||
file:
|
||||
path: /tmp/stack-arr/libreTranslate/kubernetes-files
|
||||
state: directory
|
||||
mode: '0755'
|
||||
|
||||
- name: Copy file with owner and permissions
|
||||
ansible.builtin.copy:
|
||||
src: ../files
|
||||
dest: /tmp/stack-arr/libreTranslate/kubernetes-files
|
||||
owner: fenix
|
||||
group: root
|
||||
mode: '0644'
|
||||
|
||||
|
||||
#- name: Obter várias notas do Bitwarden
|
||||
# shell: |
|
||||
# echo "unlock"
|
||||
# BW_SESSION=$(bw unlock {{ bw_password }} --raw)
|
||||
# echo "get item"
|
||||
# bw get item "{{ item.id }}" --session $BW_SESSION | jq -r '.notes' > {{ item.dest }}
|
||||
# loop:
|
||||
# - { id: "iac.ansible.stackarr.radarr.secret", dest: "/tmp/stack-arr/radarr/kubernetes-files/files/radarr-secret.yaml" }
|
||||
# args:
|
||||
# executable: /bin/bash
|
||||
# environment:
|
||||
# BW_PASSWORD: "{{ BW_PASSWORD }}"
|
||||
|
||||
|
||||
- name: Listar conteúdo do diretório remoto
|
||||
shell: ls -l /tmp/stack-arr/libreTranslate/kubernetes-files/files
|
||||
register: resultado_ls
|
||||
|
||||
|
||||
- name: Mostrar resultado do ls
|
||||
debug:
|
||||
var: resultado_ls.stdout_lines
|
||||
|
||||
|
||||
- name: Aplicar o stolon
|
||||
become: yes
|
||||
become_user: fenix
|
||||
shell: |
|
||||
kubectl apply -f /tmp/stack-arr/libreTranslate/kubernetes-files/files/
|
||||
environment:
|
||||
KUBECONFIG: /home/fenix/.kube/config
|
||||
4
roles/libreTranslate/vars/main.yml
Normal file
4
roles/libreTranslate/vars/main.yml
Normal file
@ -0,0 +1,4 @@
|
||||
bw_password: "{{ lookup('env', 'BW_PASSWORD') }}"
|
||||
VAULTWARDEN_LINK: "{{ lookup('env', 'VAULTWARDEN_LINK') }}"
|
||||
BW_CLIENTID: "{{ lookup('env', 'BW_CLIENTID') }}"
|
||||
BW_CLIENTSECRET : "{{ lookup('env', 'BW_CLIENTSECRET') }}"
|
||||
36
roles/lingarr/files/lingarr-deployment.yaml
Normal file
36
roles/lingarr/files/lingarr-deployment.yaml
Normal file
@ -0,0 +1,36 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: lingarr
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: lingarr
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: lingarr
|
||||
spec:
|
||||
containers:
|
||||
- name: lingarr
|
||||
image: lingarr/lingarr:latest
|
||||
ports:
|
||||
- containerPort: 9876
|
||||
env:
|
||||
- name: ASPNETCORE_URLS
|
||||
value: "http://+:9876"
|
||||
- name: WHISPER_BASE_URL
|
||||
value: "http://whisperasr-service.stack-arr.svc.cluster.local:9000"
|
||||
- name: SOURCE_LANGUAGE
|
||||
value: "auto"
|
||||
- name: TARGET_LANGUAGE
|
||||
value: "pt"
|
||||
volumeMounts:
|
||||
- name: config
|
||||
mountPath: /app/config
|
||||
volumes:
|
||||
- name: config
|
||||
persistentVolumeClaim:
|
||||
claimName: lingarr-config-pvc
|
||||
11
roles/lingarr/files/lingarr-nfs-csi.yaml
Normal file
11
roles/lingarr/files/lingarr-nfs-csi.yaml
Normal file
@ -0,0 +1,11 @@
|
||||
apiVersion: storage.k8s.io/v1
|
||||
kind: StorageClass
|
||||
metadata:
|
||||
name: lingarr-nfs-csi
|
||||
namespace: stack-arr
|
||||
provisioner: nfs.csi.k8s.io
|
||||
parameters:
|
||||
server: 192.168.1.22
|
||||
share: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/stack-arr/lingarr
|
||||
allowVolumeExpansion: true
|
||||
reclaimPolicy: Retain
|
||||
29
roles/lingarr/files/lingarr-pvcs.yaml
Normal file
29
roles/lingarr/files/lingarr-pvcs.yaml
Normal file
@ -0,0 +1,29 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: lingarr-config-pv
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
capacity:
|
||||
storage: 10Gi
|
||||
storageClassName: lingarr-nfs-csi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
persistentVolumeReclaimPolicy: Retain
|
||||
nfs:
|
||||
server: 192.168.1.22
|
||||
path: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/stack-arr/lingarr/config
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: lingarr-config-pvc
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
storageClassName: lingarr-nfs-csi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
volumeName: lingarr-config-pv
|
||||
resources:
|
||||
requests:
|
||||
storage: 10Gi
|
||||
12
roles/lingarr/files/lingarr-service.yaml
Normal file
12
roles/lingarr/files/lingarr-service.yaml
Normal file
@ -0,0 +1,12 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: lingarr-service
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
ports:
|
||||
- port: 9876
|
||||
targetPort: 9876
|
||||
selector:
|
||||
app: lingarr
|
||||
type: ClusterIP
|
||||
51
roles/lingarr/tasks/main.yml
Normal file
51
roles/lingarr/tasks/main.yml
Normal file
@ -0,0 +1,51 @@
|
||||
- name: Remover o diretório /tmp/stack-arr/lingarr/kubernetes-files
|
||||
ansible.builtin.file:
|
||||
path: /tmp/stack-arr/lingarr/kubernetes-files
|
||||
state: absent
|
||||
|
||||
- name: Criar diretório temporário no remoto
|
||||
file:
|
||||
path: /tmp/stack-arr/lingarr/kubernetes-files
|
||||
state: directory
|
||||
mode: '0755'
|
||||
|
||||
- name: Copy file with owner and permissions
|
||||
ansible.builtin.copy:
|
||||
src: ../files
|
||||
dest: /tmp/stack-arr/lingarr/kubernetes-files
|
||||
owner: fenix
|
||||
group: root
|
||||
mode: '0644'
|
||||
|
||||
|
||||
#- name: Obter várias notas do Bitwarden
|
||||
# shell: |
|
||||
# echo "unlock"
|
||||
# BW_SESSION=$(bw unlock {{ bw_password }} --raw)
|
||||
# echo "get item"
|
||||
# bw get item "{{ item.id }}" --session $BW_SESSION | jq -r '.notes' > {{ item.dest }}
|
||||
# loop:
|
||||
# - { id: "iac.ansible.stackarr.radarr.secret", dest: "/tmp/stack-arr/radarr/kubernetes-files/files/radarr-secret.yaml" }
|
||||
# args:
|
||||
# executable: /bin/bash
|
||||
# environment:
|
||||
# BW_PASSWORD: "{{ BW_PASSWORD }}"
|
||||
|
||||
|
||||
- name: Listar conteúdo do diretório remoto
|
||||
shell: ls -l /tmp/stack-arr/lingarr/kubernetes-files/files
|
||||
register: resultado_ls
|
||||
|
||||
|
||||
- name: Mostrar resultado do ls
|
||||
debug:
|
||||
var: resultado_ls.stdout_lines
|
||||
|
||||
|
||||
- name: Aplicar o stolon
|
||||
become: yes
|
||||
become_user: fenix
|
||||
shell: |
|
||||
kubectl apply -f /tmp/stack-arr/lingarr/kubernetes-files/files/
|
||||
environment:
|
||||
KUBECONFIG: /home/fenix/.kube/config
|
||||
4
roles/lingarr/vars/main.yml
Normal file
4
roles/lingarr/vars/main.yml
Normal file
@ -0,0 +1,4 @@
|
||||
bw_password: "{{ lookup('env', 'BW_PASSWORD') }}"
|
||||
VAULTWARDEN_LINK: "{{ lookup('env', 'VAULTWARDEN_LINK') }}"
|
||||
BW_CLIENTID: "{{ lookup('env', 'BW_CLIENTID') }}"
|
||||
BW_CLIENTSECRET : "{{ lookup('env', 'BW_CLIENTSECRET') }}"
|
||||
90
roles/mangareader/files/mangareader-deployment.yaml
Normal file
90
roles/mangareader/files/mangareader-deployment.yaml
Normal file
@ -0,0 +1,90 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: mangareader
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: mangareader
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: mangareader
|
||||
spec:
|
||||
securityContext:
|
||||
fsGroup: 1013
|
||||
imagePullSecrets:
|
||||
- name: regcred
|
||||
containers:
|
||||
- name: mangareader
|
||||
image: ghcr.io/suwayomi/tachidesk:v2.1.2061
|
||||
securityContext:
|
||||
capabilities:
|
||||
add:
|
||||
- NET_ADMIN
|
||||
ports:
|
||||
- containerPort: 4567
|
||||
name: webui
|
||||
env:
|
||||
- name: PUID
|
||||
value: "1013"
|
||||
- name: PGID
|
||||
value: "1013"
|
||||
- name: TZ
|
||||
value: 'Etc/UTC'
|
||||
- name: AUTO_DOWNLOAD_CHAPTERS
|
||||
value: 'true'
|
||||
- name: AUTO_BACKUP_INCLUDE_MANGA
|
||||
value: 'false'
|
||||
- name: AUTO_BACKUP_INCLUDE_CATEGORIES
|
||||
value: 'false'
|
||||
- name: AUTO_BACKUP_INCLUDE_CHAPTERS
|
||||
value: 'false'
|
||||
- name: AUTO_BACKUP_INCLUDE_TRACKING
|
||||
value: 'false'
|
||||
- name: AUTO_BACKUP_INCLUDE_HISTORY
|
||||
value: 'false'
|
||||
- name: AUTO_BACKUP_INCLUDE_CLIENT_DATA
|
||||
value: 'false'
|
||||
- name: AUTO_BACKUP_INCLUDE_SERVER_SETTINGS
|
||||
value: 'false'
|
||||
- name: FLARESOLVERR_ENABLED
|
||||
value: 'true'
|
||||
- name: FLARESOLVERR_URL
|
||||
value: 'http://flaresolverr-service.stack-arr.svc.cluster.local:8191'
|
||||
- name: DATABASE_TYPE
|
||||
value: 'POSTGRESQL'
|
||||
- name: DATABASE_URL
|
||||
value: 'postgresql://stolon-proxy-service.postgresql.svc.cluster.local:5432/mangareader'
|
||||
- name: DATABASE_USERNAME
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: mangareader-secret
|
||||
key: username
|
||||
- name: DATABASE_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: mangareader-secret
|
||||
key: password
|
||||
volumeMounts:
|
||||
- name: config
|
||||
mountPath: /home/suwayomi/.local/share/Tachidesk
|
||||
- name: books
|
||||
mountPath: /books
|
||||
- name: downloads
|
||||
mountPath: /downloads
|
||||
volumes:
|
||||
- name: config
|
||||
persistentVolumeClaim:
|
||||
claimName: mangareader-config-pvc
|
||||
- name: books
|
||||
persistentVolumeClaim:
|
||||
claimName: mangareader-books-pvc
|
||||
- name: downloads
|
||||
persistentVolumeClaim:
|
||||
claimName: qbittorrent-downloads-pvc
|
||||
|
||||
|
||||
|
||||
11
roles/mangareader/files/mangareader-nfs-csi.yaml
Normal file
11
roles/mangareader/files/mangareader-nfs-csi.yaml
Normal file
@ -0,0 +1,11 @@
|
||||
apiVersion: storage.k8s.io/v1
|
||||
kind: StorageClass
|
||||
metadata:
|
||||
name: mangareader-nfs-csi
|
||||
namespace: stack-arr
|
||||
provisioner: nfs.csi.k8s.io
|
||||
parameters:
|
||||
server: 192.168.1.22
|
||||
share: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/stack-arr/mangareader
|
||||
allowVolumeExpansion: true
|
||||
reclaimPolicy: Retain
|
||||
60
roles/mangareader/files/mangareader-pvcs.yaml
Normal file
60
roles/mangareader/files/mangareader-pvcs.yaml
Normal file
@ -0,0 +1,60 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: mangareader-config-pv
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
capacity:
|
||||
storage: 20Gi
|
||||
storageClassName: mangareader-nfs-csi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
persistentVolumeReclaimPolicy: Retain
|
||||
nfs:
|
||||
server: 192.168.1.22
|
||||
path: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/stack-arr/mangareader/config
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: mangareader-config-pvc
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
storageClassName: mangareader-nfs-csi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
volumeName: mangareader-config-pv
|
||||
resources:
|
||||
requests:
|
||||
storage: 20Gi
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: mangareader-media-pv
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
capacity:
|
||||
storage: 150Gi
|
||||
storageClassName: jellyfin-videos-nfs-csi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
persistentVolumeReclaimPolicy: Retain
|
||||
nfs:
|
||||
server: 192.168.1.22
|
||||
path: /mnt/fenix-main-nas-pool-0/data/Filmes_e_Series/Livros
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: mangareader-books-pvc
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
storageClassName: jellyfin-videos-nfs-csi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
volumeName: mangareader-media-pv
|
||||
resources:
|
||||
requests:
|
||||
storage: 150Gi
|
||||
---
|
||||
9
roles/mangareader/files/mangareader-secret.yaml
Normal file
9
roles/mangareader/files/mangareader-secret.yaml
Normal file
@ -0,0 +1,9 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: mangareader-secret
|
||||
namespace: stack-arr
|
||||
type: Opaque
|
||||
data:
|
||||
username: dXNlcm5hbWU=
|
||||
password: cGFzc3dvcmQ=
|
||||
12
roles/mangareader/files/mangareader-service.yaml
Normal file
12
roles/mangareader/files/mangareader-service.yaml
Normal file
@ -0,0 +1,12 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: mangareader-service
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
ports:
|
||||
- port: 4567
|
||||
targetPort: 4567
|
||||
selector:
|
||||
app: mangareader
|
||||
type: ClusterIP
|
||||
51
roles/mangareader/tasks/main.yml
Normal file
51
roles/mangareader/tasks/main.yml
Normal file
@ -0,0 +1,51 @@
|
||||
- name: Remover o diretório /tmp/stack-arr/mangareader/kubernetes-files
|
||||
ansible.builtin.file:
|
||||
path: /tmp/stack-arr/mangareader/kubernetes-files
|
||||
state: absent
|
||||
|
||||
- name: Criar diretório temporário no remoto
|
||||
file:
|
||||
path: /tmp/stack-arr/mangareader/kubernetes-files
|
||||
state: directory
|
||||
mode: '0755'
|
||||
|
||||
- name: Copy file with owner and permissions
|
||||
ansible.builtin.copy:
|
||||
src: ../files
|
||||
dest: /tmp/stack-arr/mangareader/kubernetes-files
|
||||
owner: fenix
|
||||
group: root
|
||||
mode: '0644'
|
||||
|
||||
|
||||
- name: Obter várias notas do Bitwarden
|
||||
shell: |
|
||||
echo "unlock"
|
||||
BW_SESSION=$(bw unlock {{ bw_password }} --raw)
|
||||
echo "get item"
|
||||
bw get item "{{ item.id }}" --session $BW_SESSION | jq -r '.notes' > {{ item.dest }}
|
||||
loop:
|
||||
- { id: "iac.ansible.stackarr.mangareader.secret", dest: "/tmp/stack-arr/mangareader/kubernetes-files/files/mangareader-secret.yaml" }
|
||||
args:
|
||||
executable: /bin/bash
|
||||
environment:
|
||||
BW_PASSWORD: "{{ BW_PASSWORD }}"
|
||||
|
||||
|
||||
- name: Listar conteúdo do diretório remoto
|
||||
shell: ls -l /tmp/stack-arr/mangareader/kubernetes-files/files
|
||||
register: resultado_ls
|
||||
|
||||
|
||||
- name: Mostrar resultado do ls
|
||||
debug:
|
||||
var: resultado_ls.stdout_lines
|
||||
|
||||
|
||||
- name: Aplicar o stolon
|
||||
become: yes
|
||||
become_user: fenix
|
||||
shell: |
|
||||
kubectl apply -f /tmp/stack-arr/mangareader/kubernetes-files/files/
|
||||
environment:
|
||||
KUBECONFIG: /home/fenix/.kube/config
|
||||
4
roles/mangareader/vars/main.yml
Normal file
4
roles/mangareader/vars/main.yml
Normal file
@ -0,0 +1,4 @@
|
||||
bw_password: "{{ lookup('env', 'BW_PASSWORD') }}"
|
||||
VAULTWARDEN_LINK: "{{ lookup('env', 'VAULTWARDEN_LINK') }}"
|
||||
BW_CLIENTID: "{{ lookup('env', 'BW_CLIENTID') }}"
|
||||
BW_CLIENTSECRET : "{{ lookup('env', 'BW_CLIENTSECRET') }}"
|
||||
15
roles/minecraft/files/minecraft-configmap.yaml
Normal file
15
roles/minecraft/files/minecraft-configmap.yaml
Normal file
@ -0,0 +1,15 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: minecraft-configmap
|
||||
namespace: minecraft
|
||||
data:
|
||||
SERVER_NAME: "Example Minecraft Server"
|
||||
EULA: "true"
|
||||
VERSION: "1.21.1"
|
||||
MAX_PLAYERS: "10"
|
||||
OPS: |
|
||||
tomas
|
||||
ENABLE_WHITELIST: "true"
|
||||
WHITELIST: |
|
||||
tomas
|
||||
4
roles/minecraft/files/minecraft-namespace.yaml
Normal file
4
roles/minecraft/files/minecraft-namespace.yaml
Normal file
@ -0,0 +1,4 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: minecraft
|
||||
11
roles/minecraft/files/minecraft-nfs-csi.yaml
Normal file
11
roles/minecraft/files/minecraft-nfs-csi.yaml
Normal file
@ -0,0 +1,11 @@
|
||||
apiVersion: storage.k8s.io/v1
|
||||
kind: StorageClass
|
||||
metadata:
|
||||
name: minecraft-nfs-csi
|
||||
namespace: minecraft
|
||||
provisioner: nfs.csi.k8s.io
|
||||
parameters:
|
||||
server: 192.168.1.22
|
||||
share: /mnt/fenix-main-nas-pool-0/data/Minecraft/TI0
|
||||
allowVolumeExpansion: true
|
||||
reclaimPolicy: Retain
|
||||
29
roles/minecraft/files/minecraft-pvcs.yaml
Normal file
29
roles/minecraft/files/minecraft-pvcs.yaml
Normal file
@ -0,0 +1,29 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: minecraft-config-pv
|
||||
namespace: minecraft
|
||||
spec:
|
||||
capacity:
|
||||
storage: 30Gi
|
||||
storageClassName: minecraft-nfs-csi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
persistentVolumeReclaimPolicy: Retain
|
||||
nfs:
|
||||
server: 192.168.1.22
|
||||
path: /mnt/fenix-main-nas-pool-0/data/Minecraft/TI0
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: minecraft-config-pvc
|
||||
namespace: minecraft
|
||||
spec:
|
||||
storageClassName: minecraft-nfs-csi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
volumeName: minecraft-config-pv
|
||||
resources:
|
||||
requests:
|
||||
storage: 30Gi
|
||||
12
roles/minecraft/files/minecraft-service.yaml
Normal file
12
roles/minecraft/files/minecraft-service.yaml
Normal file
@ -0,0 +1,12 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: minecraft-service
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
ports:
|
||||
- port: 19132
|
||||
protocol: UDP
|
||||
selector:
|
||||
app: minecraft
|
||||
type: ClusterIP
|
||||
46
roles/minecraft/files/minecraft-statefulset.yaml
Normal file
46
roles/minecraft/files/minecraft-statefulset.yaml
Normal file
@ -0,0 +1,46 @@
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: minecraft
|
||||
namespace: minecraft
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: minecraft
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: minecraft
|
||||
spec:
|
||||
securityContext:
|
||||
runAsNonRoot: true
|
||||
runAsUser: 1013
|
||||
fsGroup: 1013
|
||||
imagePullSecrets:
|
||||
- name: regcred
|
||||
containers:
|
||||
- name: minecraft
|
||||
image: itzg/minecraft-server
|
||||
stdin: true
|
||||
tty: true
|
||||
resources:
|
||||
requests:
|
||||
cpu: 2
|
||||
memory: 5Gi
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: minecraft-configmap
|
||||
ports:
|
||||
- containerPort: 19132
|
||||
name: serverport
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /data
|
||||
volumes:
|
||||
- name: data
|
||||
persistentVolumeClaim:
|
||||
claimName: minecraft-config-pvc
|
||||
|
||||
|
||||
|
||||
52
roles/minecraft/tasks/main.yml
Normal file
52
roles/minecraft/tasks/main.yml
Normal file
@ -0,0 +1,52 @@
|
||||
- name: Remover o diretório /tmp/stack-arr/minecraft/kubernetes-files
|
||||
ansible.builtin.file:
|
||||
path: /tmp/stack-arr/minecraft/kubernetes-files
|
||||
state: absent
|
||||
|
||||
- name: Criar diretório temporário no remoto
|
||||
file:
|
||||
path: /tmp/stack-arr/minecraft/kubernetes-files
|
||||
state: directory
|
||||
mode: '0755'
|
||||
|
||||
- name: Copy file with owner and permissions
|
||||
ansible.builtin.copy:
|
||||
src: ../files
|
||||
dest: /tmp/stack-arr/minecraft/kubernetes-files
|
||||
owner: fenix
|
||||
group: root
|
||||
mode: '0644'
|
||||
|
||||
|
||||
#- name: Obter várias notas do Bitwarden
|
||||
# shell: |
|
||||
# echo "unlock"
|
||||
# BW_SESSION=$(bw unlock {{ bw_password }} --raw)
|
||||
# echo "get item"
|
||||
# bw get item "{{ item.id }}" --session $BW_SESSION | jq -r '.notes' > {{ item.dest }}
|
||||
# loop:
|
||||
# - { id: "iac.ansible.stackarr.minecraft.secret", dest: "/tmp/stack-arr/minecraft/kubernetes-files/files/minecraft-secret.yaml" }
|
||||
# args:
|
||||
# executable: /bin/bash
|
||||
# environment:
|
||||
# BW_PASSWORD: "{{ BW_PASSWORD }}"
|
||||
|
||||
|
||||
- name: Listar conteúdo do diretório remoto
|
||||
shell: ls -l /tmp/stack-arr/minecraft/kubernetes-files/files
|
||||
register: resultado_ls
|
||||
|
||||
|
||||
- name: Mostrar resultado do ls
|
||||
debug:
|
||||
var: resultado_ls.stdout_lines
|
||||
|
||||
|
||||
- name: Aplicar o stolon
|
||||
become: yes
|
||||
become_user: fenix
|
||||
shell: |
|
||||
kubectl apply -f /tmp/stack-arr/minecraft/kubernetes-files/files/minecraft-namespace.yaml
|
||||
kubectl apply -f /tmp/stack-arr/minecraft/kubernetes-files/files/
|
||||
environment:
|
||||
KUBECONFIG: /home/fenix/.kube/config
|
||||
4
roles/minecraft/vars/main.yml
Normal file
4
roles/minecraft/vars/main.yml
Normal file
@ -0,0 +1,4 @@
|
||||
bw_password: "{{ lookup('env', 'BW_PASSWORD') }}"
|
||||
VAULTWARDEN_LINK: "{{ lookup('env', 'VAULTWARDEN_LINK') }}"
|
||||
BW_CLIENTID: "{{ lookup('env', 'BW_CLIENTID') }}"
|
||||
BW_CLIENTSECRET : "{{ lookup('env', 'BW_CLIENTSECRET') }}"
|
||||
66
roles/nvidia-base/tasks/main.yml
Normal file
66
roles/nvidia-base/tasks/main.yml
Normal file
@ -0,0 +1,66 @@
|
||||
- name: Instalar driver NVIDIA
|
||||
become: yes
|
||||
ansible.builtin.apt:
|
||||
name: nvidia-driver-550
|
||||
state: present
|
||||
|
||||
- name: Instalar utilitários NVIDIA
|
||||
become: yes
|
||||
ansible.builtin.apt:
|
||||
name: nvidia-utils-550
|
||||
state: present
|
||||
|
||||
|
||||
- name: Reboot host e esperar voltar
|
||||
become: yes
|
||||
ansible.builtin.reboot:
|
||||
reboot_timeout: 600 # tempo máximo para o host voltar (segundos)
|
||||
test_command: whoami # comando usado para validar que o host voltou
|
||||
|
||||
- name: Adicionar chave GPG da NVIDIA
|
||||
become: yes
|
||||
become_user: fenix
|
||||
ansible.builtin.shell: |
|
||||
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit.gpg
|
||||
args:
|
||||
creates: /usr/share/keyrings/nvidia-container-toolkit.gpg
|
||||
|
||||
- name: Adicionar repositório NVIDIA
|
||||
become: yes
|
||||
ansible.builtin.shell: |
|
||||
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \
|
||||
&& curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \
|
||||
sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
|
||||
sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
|
||||
args:
|
||||
creates: /etc/apt/sources.list.d/nvidia-container-toolkit.list
|
||||
|
||||
- name: Atualizar cache de pacotes
|
||||
become: yes
|
||||
ansible.builtin.apt:
|
||||
update_cache: yes
|
||||
|
||||
- name: Instalar NVIDIA Container Toolkit
|
||||
become: yes
|
||||
ansible.builtin.apt:
|
||||
name: nvidia-container-toolkit
|
||||
state: present
|
||||
|
||||
|
||||
- name: Configurar runtime containerd
|
||||
become: yes
|
||||
ansible.builtin.shell: |
|
||||
nvidia-ctk runtime configure --runtime=containerd
|
||||
|
||||
- name: Reiniciar containerd
|
||||
become: yes
|
||||
ansible.builtin.systemd:
|
||||
name: containerd
|
||||
state: restarted
|
||||
|
||||
|
||||
- name: Mostrar resultado nvidia-smi
|
||||
become: yes
|
||||
ansible.builtin.debug:
|
||||
var: nvidia_smi_output.stdout
|
||||
|
||||
17
roles/nvidia/files/time-slicing-config.yaml
Normal file
17
roles/nvidia/files/time-slicing-config.yaml
Normal file
@ -0,0 +1,17 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: time-slicing-config-all
|
||||
namespace: gpu-operator
|
||||
data:
|
||||
any: |-
|
||||
version: v1
|
||||
flags:
|
||||
migStrategy: none
|
||||
sharing:
|
||||
timeSlicing:
|
||||
renameByDefault: false
|
||||
failRequestsGreaterThanOne: false
|
||||
resources:
|
||||
- name: nvidia.com/gpu
|
||||
replicas: 4
|
||||
67
roles/nvidia/tasks/main.yml
Normal file
67
roles/nvidia/tasks/main.yml
Normal file
@ -0,0 +1,67 @@
|
||||
- name: Adicionar repositório Helm do nvida gpu
|
||||
command: >
|
||||
helm repo add nvidia https://nvidia.github.io/gpu-operator
|
||||
ignore_errors: yes
|
||||
|
||||
- name: Atualizar repositórios Helm
|
||||
command: helm repo update
|
||||
|
||||
- name: Instalar nvida gpu Driver via Helm
|
||||
command: helm upgrade --install nvidia-operator nvidia/gpu-operator --namespace gpu-operator --create-namespace
|
||||
register: resultado_nvidia
|
||||
environment:
|
||||
KUBECONFIG: /home/fenix/.kube/config
|
||||
|
||||
- name: Mostrar resultado do nvida gpu Driver
|
||||
debug:
|
||||
var: resultado_nvidia.stdout_lines
|
||||
|
||||
|
||||
- name: Remover o diretório /tmp/nvidia/kubernetes-files
|
||||
ansible.builtin.file:
|
||||
path: /tmp/nvidia/kubernetes-files
|
||||
state: absent
|
||||
|
||||
- name: Criar diretório temporário no remoto
|
||||
file:
|
||||
path: /tmp/nvidia/kubernetes-files
|
||||
state: directory
|
||||
mode: '0755'
|
||||
|
||||
- name: Copy file with owner and permissions
|
||||
ansible.builtin.copy:
|
||||
src: ../files
|
||||
dest: /tmp/nvidia/kubernetes-files
|
||||
owner: fenix
|
||||
group: root
|
||||
mode: '0644'
|
||||
|
||||
|
||||
- name: Listar conteúdo do diretório remoto
|
||||
shell: ls -l /tmp/nvidia/kubernetes-files/files
|
||||
register: resultado_ls
|
||||
|
||||
|
||||
- name: Mostrar resultado do ls
|
||||
debug:
|
||||
var: resultado_ls.stdout_lines
|
||||
|
||||
|
||||
- name: Aplicar o files
|
||||
become: yes
|
||||
become_user: fenix
|
||||
shell: |
|
||||
kubectl apply -f /tmp/nvidia/kubernetes-files/files/
|
||||
environment:
|
||||
KUBECONFIG: /home/fenix/.kube/config
|
||||
|
||||
|
||||
- name: Aplicar o files
|
||||
become: yes
|
||||
become_user: fenix
|
||||
shell: |
|
||||
kubectl patch clusterpolicies.nvidia.com/cluster-policy -n gpu-operator --type merge -p "{\"spec\": {\"devicePlugin\": {\"config\": {\"name\": \"time-slicing-config-all\", \"default\": \"any\"}}}}"
|
||||
environment:
|
||||
KUBECONFIG: /home/fenix/.kube/config
|
||||
|
||||
|
||||
@ -42,7 +42,7 @@ spec:
|
||||
name: vpn-secret
|
||||
key: password
|
||||
- name: REGION
|
||||
value: "us_east" # ou outro servidor PIA
|
||||
value: "Netherlands" # ou outro servidor PIA
|
||||
- name: WEBUI_PORT
|
||||
value: "8080"
|
||||
- name: DNS_SERVERS
|
||||
@ -51,6 +51,8 @@ spec:
|
||||
value: "1013"
|
||||
- name: GID
|
||||
value: "1013"
|
||||
- name: PORT_FORWARDING
|
||||
value: 'true'
|
||||
- name: HOSTHEADERVALIDATION
|
||||
value: 'false'
|
||||
volumeMounts:
|
||||
|
||||
@ -42,7 +42,7 @@ spec:
|
||||
persistentVolumeReclaimPolicy: Retain
|
||||
nfs:
|
||||
server: 192.168.1.22
|
||||
path: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/stack-arr/bittorrent/downloads
|
||||
path: /mnt/fenix-main-nas-pool-0/data/Filmes_e_Series/Downloads
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
|
||||
75
roles/radarr/files/radarr-deployment.yaml
Normal file
75
roles/radarr/files/radarr-deployment.yaml
Normal file
@ -0,0 +1,75 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: radarr
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: radarr
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: radarr
|
||||
spec:
|
||||
imagePullSecrets:
|
||||
- name: regcred
|
||||
containers:
|
||||
- name: radarr
|
||||
image: lscr.io/linuxserver/radarr:5.28.0
|
||||
securityContext:
|
||||
capabilities:
|
||||
add:
|
||||
- NET_ADMIN
|
||||
ports:
|
||||
- containerPort: 7878
|
||||
name: webui
|
||||
env:
|
||||
- name: PUID
|
||||
value: "1013"
|
||||
- name: PGID
|
||||
value: "1013"
|
||||
- name: TZ
|
||||
value: 'Etc/UTC'
|
||||
- name: RADARR__POSTGRES__HOST
|
||||
value: 'stolon-proxy-service.postgresql.svc.cluster.local'
|
||||
- name: RADARR__POSTGRES__USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: radarr-secret
|
||||
key: username
|
||||
- name: RADARR__POSTGRES__PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: radarr-secret
|
||||
key: password
|
||||
- name: RADARR__POSTGRES__MAINDB
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: radarr-secret
|
||||
key: maindb
|
||||
- name: RADARR__POSTGRES__LOGDB
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: radarr-secret
|
||||
key: logsdb
|
||||
volumeMounts:
|
||||
- name: config
|
||||
mountPath: /config
|
||||
- name: downloads
|
||||
mountPath: /downloads
|
||||
- name: movie
|
||||
mountPath: /movie
|
||||
volumes:
|
||||
- name: config
|
||||
persistentVolumeClaim:
|
||||
claimName: radarr-config-pvc
|
||||
- name: downloads
|
||||
persistentVolumeClaim:
|
||||
claimName: qbittorrent-downloads-pvc
|
||||
- name: movie
|
||||
persistentVolumeClaim:
|
||||
claimName: radarr-movie-pvc
|
||||
|
||||
|
||||
23
roles/radarr/files/radarr-nfs-csi.yaml
Normal file
23
roles/radarr/files/radarr-nfs-csi.yaml
Normal file
@ -0,0 +1,23 @@
|
||||
apiVersion: storage.k8s.io/v1
|
||||
kind: StorageClass
|
||||
metadata:
|
||||
name: radarr-nfs-csi
|
||||
namespace: stack-arr
|
||||
provisioner: nfs.csi.k8s.io
|
||||
parameters:
|
||||
server: 192.168.1.22
|
||||
share: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/stack-arr/radarr
|
||||
allowVolumeExpansion: true
|
||||
reclaimPolicy: Retain
|
||||
---
|
||||
apiVersion: storage.k8s.io/v1
|
||||
kind: StorageClass
|
||||
metadata:
|
||||
name: radarr-movie-nfs-csi
|
||||
namespace: stack-arr
|
||||
provisioner: nfs.csi.k8s.io
|
||||
parameters:
|
||||
server: 192.168.1.22
|
||||
share: /mnt/fenix-main-nas-pool-0/data/Filmes_e_Series/Filmes
|
||||
allowVolumeExpansion: true
|
||||
reclaimPolicy: Retain
|
||||
60
roles/radarr/files/radarr-pvcs.yaml
Normal file
60
roles/radarr/files/radarr-pvcs.yaml
Normal file
@ -0,0 +1,60 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: radarr-config-pv
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
capacity:
|
||||
storage: 2Gi
|
||||
storageClassName: radarr-nfs-csi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
persistentVolumeReclaimPolicy: Retain
|
||||
nfs:
|
||||
server: 192.168.1.22
|
||||
path: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/stack-arr/radarr/config
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: radarr-config-pvc
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
storageClassName: radarr-nfs-csi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
volumeName: radarr-config-pv
|
||||
resources:
|
||||
requests:
|
||||
storage: 2Gi
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: radarr-movie-pv
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
capacity:
|
||||
storage: 50Gi
|
||||
storageClassName: radarr-movie-nfs-csi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
persistentVolumeReclaimPolicy: Retain
|
||||
nfs:
|
||||
server: 192.168.1.22
|
||||
path: /mnt/fenix-main-nas-pool-0/data/Filmes_e_Series/Filmes
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: radarr-movie-pvc
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
storageClassName: radarr-movie-nfs-csi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
volumeName: radarr-movie-pv
|
||||
resources:
|
||||
requests:
|
||||
storage: 50Gi
|
||||
---
|
||||
11
roles/radarr/files/radarr-secret.yaml
Normal file
11
roles/radarr/files/radarr-secret.yaml
Normal file
@ -0,0 +1,11 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: radarr-secret
|
||||
namespace: stack-arr
|
||||
type: Opaque
|
||||
data:
|
||||
username: dXNlcm5hbWU=
|
||||
password: cGFzc3dvcmQ=
|
||||
maindb: bWFpbmRiLXByb3dsYXJy
|
||||
logsdb: bG9nZGItcHJvd2xhcnI=
|
||||
12
roles/radarr/files/radarr-service.yaml
Normal file
12
roles/radarr/files/radarr-service.yaml
Normal file
@ -0,0 +1,12 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: radarr-service
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
ports:
|
||||
- port: 7878
|
||||
targetPort: 7878
|
||||
selector:
|
||||
app: radarr
|
||||
type: ClusterIP
|
||||
51
roles/radarr/tasks/main.yml
Normal file
51
roles/radarr/tasks/main.yml
Normal file
@ -0,0 +1,51 @@
|
||||
- name: Remover o diretório /tmp/stack-arr/radarr/kubernetes-files
|
||||
ansible.builtin.file:
|
||||
path: /tmp/stack-arr/radarr/kubernetes-files
|
||||
state: absent
|
||||
|
||||
- name: Criar diretório temporário no remoto
|
||||
file:
|
||||
path: /tmp/stack-arr/radarr/kubernetes-files
|
||||
state: directory
|
||||
mode: '0755'
|
||||
|
||||
- name: Copy file with owner and permissions
|
||||
ansible.builtin.copy:
|
||||
src: ../files
|
||||
dest: /tmp/stack-arr/radarr/kubernetes-files
|
||||
owner: fenix
|
||||
group: root
|
||||
mode: '0644'
|
||||
|
||||
|
||||
- name: Obter várias notas do Bitwarden
|
||||
shell: |
|
||||
echo "unlock"
|
||||
BW_SESSION=$(bw unlock {{ bw_password }} --raw)
|
||||
echo "get item"
|
||||
bw get item "{{ item.id }}" --session $BW_SESSION | jq -r '.notes' > {{ item.dest }}
|
||||
loop:
|
||||
- { id: "iac.ansible.stackarr.radarr.secret", dest: "/tmp/stack-arr/radarr/kubernetes-files/files/radarr-secret.yaml" }
|
||||
args:
|
||||
executable: /bin/bash
|
||||
environment:
|
||||
BW_PASSWORD: "{{ BW_PASSWORD }}"
|
||||
|
||||
|
||||
- name: Listar conteúdo do diretório remoto
|
||||
shell: ls -l /tmp/stack-arr/radarr/kubernetes-files/files
|
||||
register: resultado_ls
|
||||
|
||||
|
||||
- name: Mostrar resultado do ls
|
||||
debug:
|
||||
var: resultado_ls.stdout_lines
|
||||
|
||||
|
||||
- name: Aplicar o stolon
|
||||
become: yes
|
||||
become_user: fenix
|
||||
shell: |
|
||||
kubectl apply -f /tmp/stack-arr/radarr/kubernetes-files/files/
|
||||
environment:
|
||||
KUBECONFIG: /home/fenix/.kube/config
|
||||
4
roles/radarr/vars/main.yml
Normal file
4
roles/radarr/vars/main.yml
Normal file
@ -0,0 +1,4 @@
|
||||
bw_password: "{{ lookup('env', 'BW_PASSWORD') }}"
|
||||
VAULTWARDEN_LINK: "{{ lookup('env', 'VAULTWARDEN_LINK') }}"
|
||||
BW_CLIENTID: "{{ lookup('env', 'BW_CLIENTID') }}"
|
||||
BW_CLIENTSECRET : "{{ lookup('env', 'BW_CLIENTSECRET') }}"
|
||||
56
roles/shelfarr/files/shelfarr-deployment.yaml
Normal file
56
roles/shelfarr/files/shelfarr-deployment.yaml
Normal file
@ -0,0 +1,56 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: shelfarr
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: shelfarr
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: shelfarr
|
||||
spec:
|
||||
imagePullSecrets:
|
||||
- name: regcred
|
||||
containers:
|
||||
- name: shelfarr
|
||||
image: ghcr.io/pedro-revez-silva/shelfarr:c49adad
|
||||
securityContext:
|
||||
capabilities:
|
||||
add:
|
||||
- NET_ADMIN
|
||||
ports:
|
||||
- containerPort: 5056
|
||||
name: webui
|
||||
env:
|
||||
- name: PUID
|
||||
value: "1013"
|
||||
- name: PGID
|
||||
value: "1013"
|
||||
- name: HTTP_PORT
|
||||
value: "5056"
|
||||
- name: TZ
|
||||
value: 'Etc/UTC'
|
||||
volumeMounts:
|
||||
- name: config
|
||||
mountPath: /rails/storage
|
||||
- name: books
|
||||
mountPath: /books
|
||||
- name: downloads
|
||||
mountPath: /downloads
|
||||
volumes:
|
||||
- name: config
|
||||
persistentVolumeClaim:
|
||||
claimName: shelfarr-config-pvc
|
||||
- name: books
|
||||
persistentVolumeClaim:
|
||||
claimName: shelfarr-books-pvc
|
||||
- name: downloads
|
||||
persistentVolumeClaim:
|
||||
claimName: qbittorrent-downloads-pvc
|
||||
|
||||
|
||||
|
||||
11
roles/shelfarr/files/shelfarr-nfs-csi.yaml
Normal file
11
roles/shelfarr/files/shelfarr-nfs-csi.yaml
Normal file
@ -0,0 +1,11 @@
|
||||
apiVersion: storage.k8s.io/v1
|
||||
kind: StorageClass
|
||||
metadata:
|
||||
name: shelfarr-nfs-csi
|
||||
namespace: stack-arr
|
||||
provisioner: nfs.csi.k8s.io
|
||||
parameters:
|
||||
server: 192.168.1.22
|
||||
share: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/stack-arr/shelfarr
|
||||
allowVolumeExpansion: true
|
||||
reclaimPolicy: Retain
|
||||
60
roles/shelfarr/files/shelfarr-pvcs.yaml
Normal file
60
roles/shelfarr/files/shelfarr-pvcs.yaml
Normal file
@ -0,0 +1,60 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: shelfarr-config-pv
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
capacity:
|
||||
storage: 20Gi
|
||||
storageClassName: shelfarr-nfs-csi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
persistentVolumeReclaimPolicy: Retain
|
||||
nfs:
|
||||
server: 192.168.1.22
|
||||
path: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/stack-arr/shelfarr/config
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: shelfarr-config-pvc
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
storageClassName: shelfarr-nfs-csi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
volumeName: shelfarr-config-pv
|
||||
resources:
|
||||
requests:
|
||||
storage: 20Gi
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: shelfarr-media-pv
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
capacity:
|
||||
storage: 150Gi
|
||||
storageClassName: jellyfin-videos-nfs-csi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
persistentVolumeReclaimPolicy: Retain
|
||||
nfs:
|
||||
server: 192.168.1.22
|
||||
path: /mnt/fenix-main-nas-pool-0/data/Filmes_e_Series/Livros
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: shelfarr-books-pvc
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
storageClassName: jellyfin-videos-nfs-csi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
volumeName: shelfarr-media-pv
|
||||
resources:
|
||||
requests:
|
||||
storage: 150Gi
|
||||
---
|
||||
12
roles/shelfarr/files/shelfarr-service.yaml
Normal file
12
roles/shelfarr/files/shelfarr-service.yaml
Normal file
@ -0,0 +1,12 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: shelfarr-service
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
ports:
|
||||
- port: 5056
|
||||
targetPort: 5056
|
||||
selector:
|
||||
app: shelfarr
|
||||
type: ClusterIP
|
||||
51
roles/shelfarr/tasks/main.yml
Normal file
51
roles/shelfarr/tasks/main.yml
Normal file
@ -0,0 +1,51 @@
|
||||
- name: Remover o diretório /tmp/stack-arr/shelfarr/kubernetes-files
|
||||
ansible.builtin.file:
|
||||
path: /tmp/stack-arr/shelfarr/kubernetes-files
|
||||
state: absent
|
||||
|
||||
- name: Criar diretório temporário no remoto
|
||||
file:
|
||||
path: /tmp/stack-arr/shelfarr/kubernetes-files
|
||||
state: directory
|
||||
mode: '0755'
|
||||
|
||||
- name: Copy file with owner and permissions
|
||||
ansible.builtin.copy:
|
||||
src: ../files
|
||||
dest: /tmp/stack-arr/shelfarr/kubernetes-files
|
||||
owner: fenix
|
||||
group: root
|
||||
mode: '0644'
|
||||
|
||||
|
||||
#- name: Obter várias notas do Bitwarden
|
||||
# shell: |
|
||||
# echo "unlock"
|
||||
# BW_SESSION=$(bw unlock {{ bw_password }} --raw)
|
||||
# echo "get item"
|
||||
# bw get item "{{ item.id }}" --session $BW_SESSION | jq -r '.notes' > {{ item.dest }}
|
||||
# loop:
|
||||
# - { id: "iac.ansible.stackarr.shelfarr.secret", dest: "/tmp/stack-arr/shelfarr/kubernetes-files/files/shelfarr-secret.yaml" }
|
||||
# args:
|
||||
# executable: /bin/bash
|
||||
# environment:
|
||||
# BW_PASSWORD: "{{ BW_PASSWORD }}"
|
||||
|
||||
|
||||
- name: Listar conteúdo do diretório remoto
|
||||
shell: ls -l /tmp/stack-arr/shelfarr/kubernetes-files/files
|
||||
register: resultado_ls
|
||||
|
||||
|
||||
- name: Mostrar resultado do ls
|
||||
debug:
|
||||
var: resultado_ls.stdout_lines
|
||||
|
||||
|
||||
- name: Aplicar o stolon
|
||||
become: yes
|
||||
become_user: fenix
|
||||
shell: |
|
||||
kubectl apply -f /tmp/stack-arr/shelfarr/kubernetes-files/files/
|
||||
environment:
|
||||
KUBECONFIG: /home/fenix/.kube/config
|
||||
4
roles/shelfarr/vars/main.yml
Normal file
4
roles/shelfarr/vars/main.yml
Normal file
@ -0,0 +1,4 @@
|
||||
bw_password: "{{ lookup('env', 'BW_PASSWORD') }}"
|
||||
VAULTWARDEN_LINK: "{{ lookup('env', 'VAULTWARDEN_LINK') }}"
|
||||
BW_CLIENTID: "{{ lookup('env', 'BW_CLIENTID') }}"
|
||||
BW_CLIENTSECRET : "{{ lookup('env', 'BW_CLIENTSECRET') }}"
|
||||
@ -56,7 +56,7 @@
|
||||
become: yes
|
||||
become_user: fenix
|
||||
shell: |
|
||||
kubectl run -i -n=postgresql -t stolonctl --image=sorintlab/stolon:master-pg15 --restart=Never --rm -- /usr/local/bin/stolonctl --cluster-name kube-stolon --store-backend kubernetes --kube-resource-kind=configmap init -y '{"initMode":"existing","existingConfig": {"keeperUID": "keeper0","followersUIDs": ["keeper1","keeper2"]}}'
|
||||
kubectl run -i -n=postgresql -t stolonctl --image=sorintlab/stolon:master-pg15 --restart=Never --rm --timeout=360s -- /usr/local/bin/stolonctl --cluster-name kube-stolon --store-backend kubernetes --kube-resource-kind=configmap init -y '{"initMode":"existing","existingConfig": {"keeperUID": "keeper0","followersUIDs": ["keeper1","keeper2"]}}'
|
||||
# run this if first time setting up database
|
||||
# kubectl run -i -n=postgresql -t stolonctl --image=sorintlab/stolon:master-pg15 --restart=Never --rm -- /usr/local/bin/stolonctl --cluster-name=kube-stolon --store-backend=kubernetes --kube-resource-kind=configmap init --yes
|
||||
environment:
|
||||
|
||||
@ -36,7 +36,7 @@
|
||||
|
||||
- name: Instalar Bitwarden CLI via npm
|
||||
become: true
|
||||
shell: npm install -g @bitwarden/cli
|
||||
shell: npm install -g @bitwarden/cli@2025.11.0
|
||||
args:
|
||||
executable: /bin/bash
|
||||
|
||||
@ -51,6 +51,7 @@
|
||||
|
||||
- name: Fazer login no Bitwarden
|
||||
shell: |
|
||||
bw --version
|
||||
echo "config"
|
||||
echo "VAULTWARDEN_LINK: {{ VAULTWARDEN_LINK }}"
|
||||
bw config server {{ VAULTWARDEN_LINK }}
|
||||
|
||||
42
roles/whisperasr/files/whisperasr-deployment.yaml
Normal file
42
roles/whisperasr/files/whisperasr-deployment.yaml
Normal file
@ -0,0 +1,42 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: whisperasr
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: whisperasr
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: whisperasr
|
||||
spec:
|
||||
imagePullSecrets:
|
||||
- name: regcred
|
||||
volumes:
|
||||
- name: whisperasr-model
|
||||
persistentVolumeClaim:
|
||||
claimName: whisperasr-model-pvc
|
||||
containers:
|
||||
- name: whisperasr
|
||||
image: onerahmet/openai-whisper-asr-webservice:latest-gpu
|
||||
ports:
|
||||
- containerPort: 9000
|
||||
name: api
|
||||
env:
|
||||
- name: ASR_MODEL
|
||||
value: medium
|
||||
- name: ASR_ENGINE
|
||||
value: faster_whisper
|
||||
- name: ASR_MODEL_PATH
|
||||
value: /data/whisper
|
||||
resources:
|
||||
limits:
|
||||
nvidia.com/gpu: '1'
|
||||
volumeMounts:
|
||||
- name: whisperasr-model
|
||||
mountPath: /data/whisper
|
||||
securityContext:
|
||||
privileged: true
|
||||
11
roles/whisperasr/files/whisperasr-nfs-csi.yaml
Normal file
11
roles/whisperasr/files/whisperasr-nfs-csi.yaml
Normal file
@ -0,0 +1,11 @@
|
||||
apiVersion: storage.k8s.io/v1
|
||||
kind: StorageClass
|
||||
metadata:
|
||||
name: whisperasr-nfs-csi
|
||||
namespace: stack-arr
|
||||
provisioner: nfs.csi.k8s.io
|
||||
parameters:
|
||||
server: 192.168.1.22
|
||||
share: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/stack-arr/whisperasr
|
||||
allowVolumeExpansion: true
|
||||
reclaimPolicy: Retain
|
||||
29
roles/whisperasr/files/whisperasr-pvcs.yaml
Normal file
29
roles/whisperasr/files/whisperasr-pvcs.yaml
Normal file
@ -0,0 +1,29 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: whisperasr-model-pv
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
capacity:
|
||||
storage: 30Gi
|
||||
storageClassName: whisperasr-nfs-csi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
persistentVolumeReclaimPolicy: Retain
|
||||
nfs:
|
||||
server: 192.168.1.22
|
||||
path: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/stack-arr/whisperasr/model2
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: whisperasr-model-pvc
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
storageClassName: whisperasr-nfs-csi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
volumeName: whisperasr-model-pv
|
||||
resources:
|
||||
requests:
|
||||
storage: 30Gi
|
||||
12
roles/whisperasr/files/whisperasr-service.yaml
Normal file
12
roles/whisperasr/files/whisperasr-service.yaml
Normal file
@ -0,0 +1,12 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: whisperasr-service
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
ports:
|
||||
- port: 9000
|
||||
targetPort: 9000
|
||||
selector:
|
||||
app: whisperasr
|
||||
type: ClusterIP
|
||||
51
roles/whisperasr/tasks/main.yml
Normal file
51
roles/whisperasr/tasks/main.yml
Normal file
@ -0,0 +1,51 @@
|
||||
- name: Remover o diretório /tmp/stack-arr/whisperasr/kubernetes-files
|
||||
ansible.builtin.file:
|
||||
path: /tmp/stack-arr/whisperasr/kubernetes-files
|
||||
state: absent
|
||||
|
||||
- name: Criar diretório temporário no remoto
|
||||
file:
|
||||
path: /tmp/stack-arr/whisperasr/kubernetes-files
|
||||
state: directory
|
||||
mode: '0755'
|
||||
|
||||
- name: Copy file with owner and permissions
|
||||
ansible.builtin.copy:
|
||||
src: ../files
|
||||
dest: /tmp/stack-arr/whisperasr/kubernetes-files
|
||||
owner: fenix
|
||||
group: root
|
||||
mode: '0644'
|
||||
|
||||
|
||||
#- name: Obter várias notas do Bitwarden
|
||||
# shell: |
|
||||
# echo "unlock"
|
||||
# BW_SESSION=$(bw unlock {{ bw_password }} --raw)
|
||||
# echo "get item"
|
||||
# bw get item "{{ item.id }}" --session $BW_SESSION | jq -r '.notes' > {{ item.dest }}
|
||||
# loop:
|
||||
# - { id: "iac.ansible.stackarr.radarr.secret", dest: "/tmp/stack-arr/radarr/kubernetes-files/files/radarr-secret.yaml" }
|
||||
# args:
|
||||
# executable: /bin/bash
|
||||
# environment:
|
||||
# BW_PASSWORD: "{{ BW_PASSWORD }}"
|
||||
|
||||
|
||||
- name: Listar conteúdo do diretório remoto
|
||||
shell: ls -l /tmp/stack-arr/whisperasr/kubernetes-files/files
|
||||
register: resultado_ls
|
||||
|
||||
|
||||
- name: Mostrar resultado do ls
|
||||
debug:
|
||||
var: resultado_ls.stdout_lines
|
||||
|
||||
|
||||
- name: Aplicar o stolon
|
||||
become: yes
|
||||
become_user: fenix
|
||||
shell: |
|
||||
kubectl apply -f /tmp/stack-arr/whisperasr/kubernetes-files/files/
|
||||
environment:
|
||||
KUBECONFIG: /home/fenix/.kube/config
|
||||
4
roles/whisperasr/vars/main.yml
Normal file
4
roles/whisperasr/vars/main.yml
Normal file
@ -0,0 +1,4 @@
|
||||
bw_password: "{{ lookup('env', 'BW_PASSWORD') }}"
|
||||
VAULTWARDEN_LINK: "{{ lookup('env', 'VAULTWARDEN_LINK') }}"
|
||||
BW_CLIENTID: "{{ lookup('env', 'BW_CLIENTID') }}"
|
||||
BW_CLIENTSECRET : "{{ lookup('env', 'BW_CLIENTSECRET') }}"
|
||||
Reference in New Issue
Block a user