Add redis service to cluster
This commit is contained in:
@@ -90,3 +90,13 @@ apps:
|
|||||||
enabled: true
|
enabled: true
|
||||||
namespace: default
|
namespace: default
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
|
funkwhale:
|
||||||
|
enabled: true
|
||||||
|
namespace: funkwhale
|
||||||
|
state: present
|
||||||
|
|
||||||
|
redis:
|
||||||
|
enabled: true
|
||||||
|
namespace: redis
|
||||||
|
state: present
|
||||||
|
|||||||
42
ansible-5/roles/prod.k3s/files/funkwhale/values.yaml
Normal file
42
ansible-5/roles/prod.k3s/files/funkwhale/values.yaml
Normal 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
|
||||||
12
ansible-5/roles/prod.k3s/files/redis/values.yaml
Normal file
12
ansible-5/roles/prod.k3s/files/redis/values.yaml
Normal 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® architecture. Allowed values: `standalone` or `replication`
|
||||||
|
##
|
||||||
|
architecture: standalone
|
||||||
|
auth:
|
||||||
|
## @param auth.enabled Enable password authentication
|
||||||
|
##
|
||||||
|
enabled: false
|
||||||
47
ansible-5/roles/prod.k3s/tasks/deployments/funkwhale.yaml
Normal file
47
ansible-5/roles/prod.k3s/tasks/deployments/funkwhale.yaml
Normal 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
|
||||||
47
ansible-5/roles/prod.k3s/tasks/deployments/redis.yaml
Normal file
47
ansible-5/roles/prod.k3s/tasks/deployments/redis.yaml
Normal 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
|
||||||
@@ -38,6 +38,10 @@
|
|||||||
include_tasks: deployments/nextcloud.yaml
|
include_tasks: deployments/nextcloud.yaml
|
||||||
when: apps.nextcloud.enabled
|
when: apps.nextcloud.enabled
|
||||||
|
|
||||||
|
- name: deploy redis
|
||||||
|
include_tasks: deployments/redis.yaml
|
||||||
|
when: apps.redis.enabled
|
||||||
|
|
||||||
#-----------------------------------------------------
|
#-----------------------------------------------------
|
||||||
#- include_tasks: mariadb.yaml
|
#- include_tasks: mariadb.yaml
|
||||||
#
|
#
|
||||||
|
|||||||
Reference in New Issue
Block a user