fix automouting of gluster mounts on home
This commit is contained in:
@@ -21,10 +21,10 @@ volumes:
|
||||
brick_folder: brick
|
||||
# bricks found at "{{mounts.paths[gitea]}}/{{volumes.brick_folder}}"
|
||||
replicated:
|
||||
# - name: gitea
|
||||
- name: gitea
|
||||
# - name: jenkins
|
||||
# - name: vmshares
|
||||
# - name: mariadb
|
||||
- name: mariadb
|
||||
- name: plex
|
||||
# - name: nextcloud2
|
||||
# - name: prometheus
|
||||
|
||||
@@ -5,24 +5,21 @@ kube_context: home
|
||||
fstab:
|
||||
gluster:
|
||||
#state can be present, mounted, absent, unmounted, remounted
|
||||
- name: plex
|
||||
path: "/var/lib/plex"
|
||||
state: absent
|
||||
- name: plex
|
||||
path: "/opt/data/plex"
|
||||
state: mounted
|
||||
# - name: jenkins
|
||||
# path: "/var/lib/jenkins"
|
||||
# state: mounted
|
||||
# - name: gitea
|
||||
# path: "/var/lib/gitea"
|
||||
# state: present
|
||||
- name: gitea
|
||||
path: "/opt/data/gitea"
|
||||
state: mounted
|
||||
# - name: vmshares
|
||||
# path: "/opt/shared"
|
||||
# state: mounted
|
||||
# - name: mariadb
|
||||
# path: "/opt/mariadb"
|
||||
# state: mounted
|
||||
- name: mariadb
|
||||
path: "/opt/mariadb"
|
||||
state: mounted
|
||||
|
||||
helm:
|
||||
repos:
|
||||
@@ -41,3 +38,5 @@ apps:
|
||||
stash:
|
||||
state: present
|
||||
namespace: stashapp
|
||||
mariadb:
|
||||
namespace: mariadb
|
||||
|
||||
13
ansible-5/roles/prod.k3s/files/mariadb/pv-claim.yaml
Normal file
13
ansible-5/roles/prod.k3s/files/mariadb/pv-claim.yaml
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: "{{apps.mariadb.namespace}}"
|
||||
namespace: mariadb
|
||||
spec:
|
||||
storageClassName: manual
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 10Gi
|
||||
17
ansible-5/roles/prod.k3s/files/mariadb/pv.yaml
Normal file
17
ansible-5/roles/prod.k3s/files/mariadb/pv.yaml
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
# persistent volume
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: mariadb-pv-local
|
||||
labels:
|
||||
type: local
|
||||
spec:
|
||||
storageClassName: manual
|
||||
capacity:
|
||||
storage: 100Gi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
hostPath:
|
||||
path: "/opt/mariadb"
|
||||
|
||||
17
ansible-5/roles/prod.k3s/files/mariadb/values.yaml
Normal file
17
ansible-5/roles/prod.k3s/files/mariadb/values.yaml
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
# mariadb values file
|
||||
|
||||
secondary:
|
||||
replicaCount: 0
|
||||
|
||||
image:
|
||||
# repository: mariadb
|
||||
# tag: 10.5
|
||||
|
||||
auth:
|
||||
rootPassword: "aifuoqibcqobcqb3"
|
||||
# existingSecret: ''
|
||||
|
||||
#primary:
|
||||
# persistence:
|
||||
# existingClaim: mariadb-pv-claim
|
||||
51
ansible-5/roles/prod.k3s/tasks/deployments/mariadb.yaml
Normal file
51
ansible-5/roles/prod.k3s/tasks/deployments/mariadb.yaml
Normal file
@@ -0,0 +1,51 @@
|
||||
---
|
||||
#https://github.com/bitnami/charts/tree/master/bitnami/mariadb
|
||||
|
||||
|
||||
- name: "todo: deploy mariadb"
|
||||
debug:
|
||||
msg: "TODO: write deployment tasks"
|
||||
|
||||
- name: Create a namespace for mariadb
|
||||
k8s:
|
||||
kubeconfig: "/etc/rancher/k3s/k3s.yaml"
|
||||
name: mariadb
|
||||
api_version: v1
|
||||
kind: Namespace
|
||||
state: present
|
||||
become: true
|
||||
|
||||
- name: create persistent volume resources
|
||||
kubernetes.core.k8s:
|
||||
kubeconfig: "/etc/rancher/k3s/k3s.yaml"
|
||||
state: present
|
||||
definition: "{{ lookup('template', item) | from_yaml }}"
|
||||
loop:
|
||||
- mariadb/pv.yaml
|
||||
- mariadb/pv-claim.yaml
|
||||
become: true
|
||||
|
||||
- name: Install mariadb globally available
|
||||
block:
|
||||
- name: Add mariadb chart helm repo
|
||||
local_action:
|
||||
module: kubernetes.core.helm_repository
|
||||
name: bitnami
|
||||
repo_url: https://charts.bitnami.com/bitnami
|
||||
|
||||
- name: load variables files/mariadb/values.yaml
|
||||
ansible.builtin.include_vars:
|
||||
file: files/mariadb/values.yaml
|
||||
name: stash_values
|
||||
|
||||
- name: Install mariadb Release
|
||||
local_action:
|
||||
module: kubernetes.core.helm
|
||||
release_state: present
|
||||
name: "{{apps.mariadb.namespace}}"
|
||||
namespace: mariadb
|
||||
create_namespace: yes
|
||||
update_repo_cache: True
|
||||
chart_ref: bitnami/mariadb
|
||||
values: "{{stash_values}}"
|
||||
wait: true
|
||||
@@ -7,7 +7,7 @@
|
||||
path: "{{item.path}}"
|
||||
src: "gluster:/{{item.name}}"
|
||||
fstype: "glusterfs"
|
||||
boot: false
|
||||
boot: true
|
||||
opts: "direct-io-mode=disable,_netdev,x-systemd.automount 0 0"
|
||||
state: "{{item.state}}"
|
||||
with_items: "{{fstab.gluster}}"
|
||||
|
||||
@@ -2,18 +2,22 @@
|
||||
# provisioning services in k3s cluster
|
||||
|
||||
# mount gluster
|
||||
#- include_tasks: gluster.fstab.yml
|
||||
- include_tasks: gluster.fstab.yml
|
||||
#
|
||||
## add helm repositories
|
||||
#- include_tasks: add_repos.yml
|
||||
#
|
||||
#- include_tasks: cert_manager.yml
|
||||
#
|
||||
#- include_tasks: hello-world.yaml
|
||||
- name: deploy cert_manager
|
||||
include_tasks: cert_manager.yml
|
||||
|
||||
- include_tasks: deployments/stash.yaml
|
||||
- name: deploy hello-world
|
||||
include_tasks: hello-world.yaml
|
||||
|
||||
- include_tasks: deployments/argoCD.yaml
|
||||
- name: deploy stash
|
||||
include_tasks: deployments/stash.yaml
|
||||
|
||||
#- name: deploy mariadb
|
||||
# include_tasks: deployments/mariadb.yaml
|
||||
|
||||
|
||||
#-----------------------------------------------------
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
---
|
||||
#https://github.com/bitnami/charts/tree/master/bitnami/mariadb
|
||||
|
||||
|
||||
Reference in New Issue
Block a user