infrastructure/k8s/roles/nocodb/tasks/main.yml

52 lines
1.5 KiB
YAML
Raw Normal View History

---
- name: Create NocoDB namespace
kubernetes.core.k8s:
name: nocodb
api_version: v1
kind: Namespace
state: present
definition:
metadata:
labels:
prometheus: default
# TODO deploy KeyDB for cache
- name: Add KeyDB chart repo
kubernetes.core.helm_repository:
name: enapter
repo_url: https://enapter.github.io/charts/
- name: Deploy KeyDB chart
kubernetes.core.helm:
name: nocodb-keydb
chart_ref: enapter/keydb
release_namespace: nocodb
chart_version: "0.48.0"
update_repo_cache: true
release_values: "{{ lookup('template', 'values.nextcloud-keydb.yml.j2') | from_yaml }}"
- name: Create NocoDB secrets
kubernetes.core.k8s:
state: present
definition:
apiVersion: v1
kind: Secret
metadata:
name: nocodb-secret-config
namespace: nocodb
data:
# DB
NC_DB: "{{ 'pg://postgres-15-postgresql.postgres.svc.cluster.local:5432?u=%s&p=%s&d=noco' | format(nocodb.db.user, nocodb.db.password) | b64encode }}"
# Auth
NC_AUTH_JWT_SECRET: "{{ nocodb.jwtSecret | b64encode }}"
NC_ADMIN_PASSWORD: "{{ nocodb.auth.adminPassword | b64encode }}"
# S3 storage plugin
NC_S3_ACCESS_KEY: "{{ minio.rootUser | b64encode }}"
NC_S3_ACCESS_SECRET: "{{ minio.rootPassword | b64encode }}"
- name: Deploy NocoDB kustomization
k8s:
definition: "{{ lookup('kubernetes.core.kustomize', dir=([role_path, 'files'] | path_join)) }}"