Add redis service to cluster

This commit is contained in:
2023-03-23 19:23:20 -04:00
parent 463ac84e3a
commit 2d770a9fcd
6 changed files with 162 additions and 0 deletions

View File

@@ -90,3 +90,13 @@ apps:
enabled: true
namespace: default
state: present
funkwhale:
enabled: true
namespace: funkwhale
state: present
redis:
enabled: true
namespace: redis
state: present

View File

@@ -0,0 +1,42 @@
---
# Funkwhale values
# https://gitlab.com/ananace/charts/-/tree/master/charts/funkwhale
ingress:
enabled: true
host: funkwhale.xai-corp.net
# protocol: https
tls: # < placing a host in the TLS config will determine what ends up in the cert's subjectAltNames
- secretName: xai-corp-production-tls
postgresql:
## If you already have a Postgresql service you'd like to use, set
## this to false and adjust the host to use your existing service.
enabled: true
## External Postgresql hostname or IP
# host: postgresql.example.com
auth:
## Database user
username: funkwhale
## Database password
password: funkwhale
## Database password
database: funkwhale
## Database port
service:
port: 5432
redis:
## If you already have a Redis service you'd like to use, set
## this to false and adjust the host to use your existing service.
enabled: false
## External Redis hostname or IP
host: redis.redis

View File

@@ -0,0 +1,12 @@
---
# redis values
# https://bitnami.com/stack/redis/helm
# https://github.com/bitnami/charts/tree/main/bitnami/redis/
## @param architecture Redis&reg; architecture. Allowed values: `standalone` or `replication`
##
architecture: standalone
auth:
## @param auth.enabled Enable password authentication
##
enabled: false

View File

@@ -0,0 +1,47 @@
---
#deployment tasks for gitea
- name: Create a namespace for funkwhale
k8s:
kubeconfig: "/etc/rancher/k3s/k3s.yaml"
name: "{{apps.funkwhale.namespace}}"
api_version: v1
kind: Namespace
state: "{{apps.funkwhale.state}}"
become: true
#- name: create persistent volume resources
# kubernetes.core.k8s:
# kubeconfig: "/etc/rancher/k3s/k3s.yaml"
# state: "{{apps.funkwhale.state}}"
# definition: "{{ lookup('template', item) | from_yaml }}"
# loop:
# - funkwhale/pv.yaml
# - funkwhale/pv-claim.yaml
# become: true
- name: Install funkwhale globally available
block:
- name: Add funkwhale chart helm repo
local_action:
module: kubernetes.core.helm_repository
name: ananace-charts
repo_url: https://ananace.gitlab.io/charts
- name: load variables files/funkwhale/values.yaml
ansible.builtin.include_vars:
file: files/funkwhale/values.yaml
name: release_values
- name: Install funkwhale Release
local_action:
module: kubernetes.core.helm
release_state: "{{apps.funkwhale.state}}"
name: gitea
namespace: "{{apps.funkwhale.namespace}}"
create_namespace: yes
update_repo_cache: True
chart_ref: ananace-charts/funkwhale
values: "{{release_values}}"
wait: true

View File

@@ -0,0 +1,47 @@
---
#deployment tasks for redis
- name: Create a namespace for redis
k8s:
kubeconfig: "/etc/rancher/k3s/k3s.yaml"
name: "{{apps.redis.namespace}}"
api_version: v1
kind: Namespace
state: "{{apps.redis.state}}"
become: true
#- name: create persistent volume resources
# kubernetes.core.k8s:
# kubeconfig: "/etc/rancher/k3s/k3s.yaml"
# state: "{{apps.funkwhale.state}}"
# definition: "{{ lookup('template', item) | from_yaml }}"
# loop:
# - funkwhale/pv.yaml
# - funkwhale/pv-claim.yaml
# become: true
- name: Install redis globally available
block:
- name: Add redis chart helm repo
local_action:
module: kubernetes.core.helm_repository
name: bitnami
repo_url: https://charts.bitnami.com/bitnami
- name: load variables files/redis/values.yaml
ansible.builtin.include_vars:
file: files/redis/values.yaml
name: release_values
- name: Install redis Release
local_action:
module: kubernetes.core.helm
release_state: "{{apps.redis.state}}"
name: redis
namespace: "{{apps.redis.namespace}}"
create_namespace: yes
update_repo_cache: True
chart_ref: bitnami/redis
values: "{{release_values}}"
wait: true

View File

@@ -38,6 +38,10 @@
include_tasks: deployments/nextcloud.yaml
when: apps.nextcloud.enabled
- name: deploy redis
include_tasks: deployments/redis.yaml
when: apps.redis.enabled
#-----------------------------------------------------
#- include_tasks: mariadb.yaml
#