fix
This commit is contained in:
@@ -6,36 +6,21 @@ metadata:
|
|||||||
name: dolibarr
|
name: dolibarr
|
||||||
description: null
|
description: null
|
||||||
options:
|
options:
|
||||||
postgres:
|
user-groups:
|
||||||
default:
|
default:
|
||||||
replicas: 1
|
- admin: true
|
||||||
storage: 5Gi
|
name: dolibarr-admin
|
||||||
version: '14'
|
|
||||||
examples:
|
examples:
|
||||||
- replicas: 1
|
- - admin: true
|
||||||
storage: 5Gi
|
name: dolibarr-admin
|
||||||
version: '14'
|
items:
|
||||||
properties:
|
properties:
|
||||||
replicas:
|
admin:
|
||||||
default: 1
|
type: boolean
|
||||||
type: integer
|
name:
|
||||||
storage:
|
type: string
|
||||||
default: 5Gi
|
type: object
|
||||||
type: string
|
type: array
|
||||||
version:
|
|
||||||
default: '14'
|
|
||||||
type: string
|
|
||||||
type: object
|
|
||||||
sub-domain:
|
|
||||||
default: erp
|
|
||||||
examples:
|
|
||||||
- erp
|
|
||||||
type: string
|
|
||||||
ingress-class:
|
|
||||||
default: traefik
|
|
||||||
examples:
|
|
||||||
- traefik
|
|
||||||
type: string
|
|
||||||
parameters:
|
parameters:
|
||||||
default:
|
default:
|
||||||
MAIN_LANG_DEFAULT: auto
|
MAIN_LANG_DEFAULT: auto
|
||||||
@@ -46,39 +31,6 @@ options:
|
|||||||
default: auto
|
default: auto
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
hpa:
|
|
||||||
default:
|
|
||||||
avg-cpu: 50
|
|
||||||
max-replicas: 5
|
|
||||||
min-replicas: 1
|
|
||||||
examples:
|
|
||||||
- avg-cpu: 50
|
|
||||||
max-replicas: 5
|
|
||||||
min-replicas: 1
|
|
||||||
properties:
|
|
||||||
avg-cpu:
|
|
||||||
default: 50
|
|
||||||
type: integer
|
|
||||||
max-replicas:
|
|
||||||
default: 5
|
|
||||||
type: integer
|
|
||||||
min-replicas:
|
|
||||||
default: 1
|
|
||||||
type: integer
|
|
||||||
type: object
|
|
||||||
modules:
|
|
||||||
default:
|
|
||||||
- societe
|
|
||||||
examples:
|
|
||||||
- - societe
|
|
||||||
items:
|
|
||||||
type: string
|
|
||||||
type: array
|
|
||||||
domain-name:
|
|
||||||
default: your_company.com
|
|
||||||
examples:
|
|
||||||
- your_company.com
|
|
||||||
type: string
|
|
||||||
resources:
|
resources:
|
||||||
default:
|
default:
|
||||||
limits:
|
limits:
|
||||||
@@ -120,42 +72,10 @@ options:
|
|||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
type: object
|
type: object
|
||||||
storage:
|
domain-name:
|
||||||
default:
|
default: your_company.com
|
||||||
accessMode: ReadWriteOnce
|
|
||||||
size: 10Gi
|
|
||||||
type: Filesystem
|
|
||||||
examples:
|
examples:
|
||||||
- accessMode: ReadWriteOnce
|
- your_company.com
|
||||||
size: 10Gi
|
|
||||||
type: Filesystem
|
|
||||||
properties:
|
|
||||||
accessMode:
|
|
||||||
default: ReadWriteOnce
|
|
||||||
enum:
|
|
||||||
- ReadWriteOnce
|
|
||||||
- ReadOnlyMany
|
|
||||||
- ReadWriteMany
|
|
||||||
type: string
|
|
||||||
size:
|
|
||||||
default: 10Gi
|
|
||||||
type: string
|
|
||||||
type:
|
|
||||||
default: Filesystem
|
|
||||||
enum:
|
|
||||||
- Filesystem
|
|
||||||
- block
|
|
||||||
type: string
|
|
||||||
type: object
|
|
||||||
domain:
|
|
||||||
default: your-company
|
|
||||||
examples:
|
|
||||||
- your-company
|
|
||||||
type: string
|
|
||||||
issuer:
|
|
||||||
default: letsencrypt-prod
|
|
||||||
examples:
|
|
||||||
- letsencrypt-prod
|
|
||||||
type: string
|
type: string
|
||||||
redis:
|
redis:
|
||||||
default:
|
default:
|
||||||
@@ -190,6 +110,86 @@ options:
|
|||||||
default: 2Gi
|
default: 2Gi
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
|
storage:
|
||||||
|
default:
|
||||||
|
accessMode: ReadWriteOnce
|
||||||
|
size: 10Gi
|
||||||
|
type: Filesystem
|
||||||
|
examples:
|
||||||
|
- accessMode: ReadWriteOnce
|
||||||
|
size: 10Gi
|
||||||
|
type: Filesystem
|
||||||
|
properties:
|
||||||
|
accessMode:
|
||||||
|
default: ReadWriteOnce
|
||||||
|
enum:
|
||||||
|
- ReadWriteOnce
|
||||||
|
- ReadOnlyMany
|
||||||
|
- ReadWriteMany
|
||||||
|
type: string
|
||||||
|
size:
|
||||||
|
default: 10Gi
|
||||||
|
type: string
|
||||||
|
type:
|
||||||
|
default: Filesystem
|
||||||
|
enum:
|
||||||
|
- Filesystem
|
||||||
|
- block
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
ingress-class:
|
||||||
|
default: traefik
|
||||||
|
examples:
|
||||||
|
- traefik
|
||||||
|
type: string
|
||||||
|
modules:
|
||||||
|
default:
|
||||||
|
- societe
|
||||||
|
examples:
|
||||||
|
- - societe
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
type: array
|
||||||
|
postgres:
|
||||||
|
default:
|
||||||
|
replicas: 1
|
||||||
|
storage: 5Gi
|
||||||
|
version: '14'
|
||||||
|
examples:
|
||||||
|
- replicas: 1
|
||||||
|
storage: 5Gi
|
||||||
|
version: '14'
|
||||||
|
properties:
|
||||||
|
replicas:
|
||||||
|
default: 1
|
||||||
|
type: integer
|
||||||
|
storage:
|
||||||
|
default: 5Gi
|
||||||
|
type: string
|
||||||
|
version:
|
||||||
|
default: '14'
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
sub-domain:
|
||||||
|
default: erp
|
||||||
|
examples:
|
||||||
|
- erp
|
||||||
|
type: string
|
||||||
|
issuer:
|
||||||
|
default: letsencrypt-prod
|
||||||
|
examples:
|
||||||
|
- letsencrypt-prod
|
||||||
|
type: string
|
||||||
|
domain:
|
||||||
|
default: your-company
|
||||||
|
examples:
|
||||||
|
- your-company
|
||||||
|
type: string
|
||||||
|
log-level:
|
||||||
|
default: 5
|
||||||
|
examples:
|
||||||
|
- 5
|
||||||
|
type: integer
|
||||||
images:
|
images:
|
||||||
default:
|
default:
|
||||||
dolibarr:
|
dolibarr:
|
||||||
@@ -255,26 +255,26 @@ options:
|
|||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
type: object
|
type: object
|
||||||
log-level:
|
hpa:
|
||||||
default: 5
|
|
||||||
examples:
|
|
||||||
- 5
|
|
||||||
type: integer
|
|
||||||
user-groups:
|
|
||||||
default:
|
default:
|
||||||
- admin: true
|
avg-cpu: 50
|
||||||
name: dolibarr-admin
|
max-replicas: 5
|
||||||
|
min-replicas: 1
|
||||||
examples:
|
examples:
|
||||||
- - admin: true
|
- avg-cpu: 50
|
||||||
name: dolibarr-admin
|
max-replicas: 5
|
||||||
items:
|
min-replicas: 1
|
||||||
properties:
|
properties:
|
||||||
admin:
|
avg-cpu:
|
||||||
type: boolean
|
default: 50
|
||||||
name:
|
type: integer
|
||||||
type: string
|
max-replicas:
|
||||||
type: object
|
default: 5
|
||||||
type: array
|
type: integer
|
||||||
|
min-replicas:
|
||||||
|
default: 1
|
||||||
|
type: integer
|
||||||
|
type: object
|
||||||
dependencies:
|
dependencies:
|
||||||
- dist: null
|
- dist: null
|
||||||
category: share
|
category: share
|
||||||
|
|||||||
@@ -2,72 +2,6 @@ locals {
|
|||||||
pg-labels = merge(local.common-labels, {
|
pg-labels = merge(local.common-labels, {
|
||||||
"app.kubernetes.io/component" = "pg"
|
"app.kubernetes.io/component" = "pg"
|
||||||
})
|
})
|
||||||
postgres-labels = merge(local.common-labels, {
|
|
||||||
"app.kubernetes.io/component" = "postgresql"
|
|
||||||
})
|
|
||||||
}
|
|
||||||
resource "kubectl_manifest" "dolibarr_postgresql" {
|
|
||||||
yaml_body = <<-EOF
|
|
||||||
apiVersion: "acid.zalan.do/v1"
|
|
||||||
kind: "postgresql"
|
|
||||||
metadata:
|
|
||||||
name: "${var.instance}-${var.component}"
|
|
||||||
namespace: "${var.namespace}"
|
|
||||||
labels: ${jsonencode(local.postgres-labels)}
|
|
||||||
spec:
|
|
||||||
databases:
|
|
||||||
${var.component}: "${var.component}"
|
|
||||||
numberOfInstances: ${var.postgres.replicas}
|
|
||||||
podAnnotations:
|
|
||||||
"k8up.io/backupcommand": "pg_dump -U postgres -d ${var.component} --clean"
|
|
||||||
"k8up.io/file-extension": ".sql"
|
|
||||||
postgresql:
|
|
||||||
version: "${var.postgres.version}"
|
|
||||||
teamId: "${var.instance}"
|
|
||||||
users:
|
|
||||||
${var.component}:
|
|
||||||
- "superuser"
|
|
||||||
- "createdb"
|
|
||||||
volume:
|
|
||||||
size: "${var.postgres.storage}"
|
|
||||||
EOF
|
|
||||||
}
|
|
||||||
|
|
||||||
resource "kubectl_manifest" "prj_pre_migrate_pg" {
|
|
||||||
yaml_body = <<-EOF
|
|
||||||
apiVersion: batch/v1
|
|
||||||
kind: Job
|
|
||||||
metadata:
|
|
||||||
name: "${var.instance}-remove-zalando-extensions"
|
|
||||||
namespace: "${var.namespace}"
|
|
||||||
spec:
|
|
||||||
template:
|
|
||||||
spec:
|
|
||||||
restartPolicy: OnFailure
|
|
||||||
containers:
|
|
||||||
- name: clean
|
|
||||||
image: docker.io/postgres:15.3-bookworm
|
|
||||||
imagePullPolicy: IfNotPresent
|
|
||||||
env:
|
|
||||||
- name: USERNAME
|
|
||||||
valueFrom:
|
|
||||||
secretKeyRef:
|
|
||||||
key: username
|
|
||||||
name: postgres.${var.instance}-${var.component}.credentials.postgresql.acid.zalan.do
|
|
||||||
- name: PASSWORD
|
|
||||||
valueFrom:
|
|
||||||
secretKeyRef:
|
|
||||||
key: password
|
|
||||||
name: postgres.${var.instance}-${var.component}.credentials.postgresql.acid.zalan.do
|
|
||||||
- name: DBURL
|
|
||||||
value: "${var.instance}-${var.component}"
|
|
||||||
- name: DBNAME
|
|
||||||
value: "${var.component}"
|
|
||||||
command:
|
|
||||||
- /bin/bash
|
|
||||||
- "-c"
|
|
||||||
- "echo -ne 'drop view if exists metric_helpers.pg_stat_statements;\ndrop function if exists metric_helpers.pg_stat_statements;\nDROP EXTENSION IF EXISTS pg_stat_kcache;\nDROP EXTENSION IF EXISTS pg_stat_statements;\nDROP EXTENSION IF EXISTS set_user;\n'| PGPASSWORD=\"$PASSWORD\" psql -U $USERNAME -d $DBNAME -h $DBURL"
|
|
||||||
EOF
|
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "kubectl_manifest" "prj_pg" {
|
resource "kubectl_manifest" "prj_pg" {
|
||||||
@@ -83,25 +17,5 @@ resource "kubectl_manifest" "prj_pg" {
|
|||||||
instances: ${var.postgres.replicas}
|
instances: ${var.postgres.replicas}
|
||||||
storage:
|
storage:
|
||||||
size: "${var.postgres.storage}"
|
size: "${var.postgres.storage}"
|
||||||
bootstrap:
|
|
||||||
initdb:
|
|
||||||
database: ${var.component}
|
|
||||||
owner: ${var.component}
|
|
||||||
import:
|
|
||||||
type: microservice
|
|
||||||
databases:
|
|
||||||
- ${var.component}
|
|
||||||
source:
|
|
||||||
externalCluster: "${var.instance}-${var.component}"
|
|
||||||
externalClusters:
|
|
||||||
- name: "${var.instance}-${var.component}"
|
|
||||||
connectionParameters:
|
|
||||||
host: "${var.instance}-${var.component}"
|
|
||||||
user: postgres
|
|
||||||
dbname: postgres
|
|
||||||
sslmode: require
|
|
||||||
password:
|
|
||||||
name: "postgres.${var.instance}-${var.component}.credentials.postgresql.acid.zalan.do"
|
|
||||||
key: password
|
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,51 +9,11 @@ metadata:
|
|||||||
A painless self-hosted Git service.
|
A painless self-hosted Git service.
|
||||||
Gitea is a community managed lightweight code hosting solution written in Go. It is published under the MIT license.
|
Gitea is a community managed lightweight code hosting solution written in Go. It is published under the MIT license.
|
||||||
options:
|
options:
|
||||||
issuer:
|
domain:
|
||||||
default: letsencrypt-prod
|
default: your-company
|
||||||
examples:
|
examples:
|
||||||
- letsencrypt-prod
|
- your-company
|
||||||
type: string
|
type: string
|
||||||
theme:
|
|
||||||
default: gitea-modern
|
|
||||||
examples:
|
|
||||||
- gitea-modern
|
|
||||||
type: string
|
|
||||||
default-branch:
|
|
||||||
default: main
|
|
||||||
examples:
|
|
||||||
- main
|
|
||||||
type: string
|
|
||||||
volume:
|
|
||||||
default:
|
|
||||||
size: 10Gi
|
|
||||||
examples:
|
|
||||||
- size: 10Gi
|
|
||||||
properties:
|
|
||||||
size:
|
|
||||||
default: 10Gi
|
|
||||||
type: string
|
|
||||||
type: object
|
|
||||||
ingress-class:
|
|
||||||
default: traefik
|
|
||||||
examples:
|
|
||||||
- traefik
|
|
||||||
type: string
|
|
||||||
sub-domain:
|
|
||||||
default: git
|
|
||||||
examples:
|
|
||||||
- git
|
|
||||||
type: string
|
|
||||||
disable-registration:
|
|
||||||
default: true
|
|
||||||
examples:
|
|
||||||
- true
|
|
||||||
type: boolean
|
|
||||||
replicas:
|
|
||||||
default: 1
|
|
||||||
examples:
|
|
||||||
- 1
|
|
||||||
type: integer
|
|
||||||
postgres:
|
postgres:
|
||||||
default:
|
default:
|
||||||
replicas: 1
|
replicas: 1
|
||||||
@@ -74,61 +34,21 @@ options:
|
|||||||
default: '14'
|
default: '14'
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
domain:
|
webhook:
|
||||||
default: your-company
|
|
||||||
examples:
|
|
||||||
- your-company
|
|
||||||
type: string
|
|
||||||
release:
|
|
||||||
default: 8.3.0
|
|
||||||
examples:
|
|
||||||
- 8.3.0
|
|
||||||
type: string
|
|
||||||
ssh-port:
|
|
||||||
default: 2222
|
|
||||||
examples:
|
|
||||||
- 2222
|
|
||||||
type: integer
|
|
||||||
push-create:
|
|
||||||
default:
|
default:
|
||||||
org: 'true'
|
allowed-hosts: private
|
||||||
private: 'false'
|
skip-tls-verify: false
|
||||||
user: 'true'
|
|
||||||
examples:
|
examples:
|
||||||
- org: 'true'
|
- allowed-hosts: private
|
||||||
private: 'false'
|
skip-tls-verify: false
|
||||||
user: 'true'
|
|
||||||
properties:
|
properties:
|
||||||
org:
|
allowed-hosts:
|
||||||
default: 'true'
|
default: private
|
||||||
type: string
|
|
||||||
private:
|
|
||||||
default: 'false'
|
|
||||||
type: string
|
|
||||||
user:
|
|
||||||
default: 'true'
|
|
||||||
type: string
|
type: string
|
||||||
|
skip-tls-verify:
|
||||||
|
default: false
|
||||||
|
type: boolean
|
||||||
type: object
|
type: object
|
||||||
domain-name:
|
|
||||||
default: your_company.com
|
|
||||||
examples:
|
|
||||||
- your_company.com
|
|
||||||
type: string
|
|
||||||
load-balancer:
|
|
||||||
default:
|
|
||||||
ip: ''
|
|
||||||
examples:
|
|
||||||
- ip: ''
|
|
||||||
properties:
|
|
||||||
ip:
|
|
||||||
default: ''
|
|
||||||
type: string
|
|
||||||
type: object
|
|
||||||
timezone:
|
|
||||||
default: Europe/Paris
|
|
||||||
examples:
|
|
||||||
- Europe/Paris
|
|
||||||
type: string
|
|
||||||
images:
|
images:
|
||||||
default:
|
default:
|
||||||
gitea:
|
gitea:
|
||||||
@@ -192,6 +112,11 @@ options:
|
|||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
type: object
|
type: object
|
||||||
|
ingress-class:
|
||||||
|
default: traefik
|
||||||
|
examples:
|
||||||
|
- traefik
|
||||||
|
type: string
|
||||||
admin:
|
admin:
|
||||||
default:
|
default:
|
||||||
email: git-admin@git.your_company.com
|
email: git-admin@git.your_company.com
|
||||||
@@ -207,21 +132,96 @@ options:
|
|||||||
default: gitea_admin
|
default: gitea_admin
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
webhook:
|
load-balancer:
|
||||||
default:
|
default:
|
||||||
allowed-hosts: private
|
ip: ''
|
||||||
skip-tls-verify: false
|
|
||||||
examples:
|
examples:
|
||||||
- allowed-hosts: private
|
- ip: ''
|
||||||
skip-tls-verify: false
|
|
||||||
properties:
|
properties:
|
||||||
allowed-hosts:
|
ip:
|
||||||
default: private
|
default: ''
|
||||||
type: string
|
type: string
|
||||||
skip-tls-verify:
|
|
||||||
default: false
|
|
||||||
type: boolean
|
|
||||||
type: object
|
type: object
|
||||||
|
disable-registration:
|
||||||
|
default: true
|
||||||
|
examples:
|
||||||
|
- true
|
||||||
|
type: boolean
|
||||||
|
volume:
|
||||||
|
default:
|
||||||
|
size: 10Gi
|
||||||
|
examples:
|
||||||
|
- size: 10Gi
|
||||||
|
properties:
|
||||||
|
size:
|
||||||
|
default: 10Gi
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
domain-name:
|
||||||
|
default: your_company.com
|
||||||
|
examples:
|
||||||
|
- your_company.com
|
||||||
|
type: string
|
||||||
|
timezone:
|
||||||
|
default: Europe/Paris
|
||||||
|
examples:
|
||||||
|
- Europe/Paris
|
||||||
|
type: string
|
||||||
|
default-branch:
|
||||||
|
default: main
|
||||||
|
examples:
|
||||||
|
- main
|
||||||
|
type: string
|
||||||
|
release:
|
||||||
|
default: 8.3.0
|
||||||
|
examples:
|
||||||
|
- 8.3.0
|
||||||
|
type: string
|
||||||
|
ssh-port:
|
||||||
|
default: 2222
|
||||||
|
examples:
|
||||||
|
- 2222
|
||||||
|
type: integer
|
||||||
|
sub-domain:
|
||||||
|
default: git
|
||||||
|
examples:
|
||||||
|
- git
|
||||||
|
type: string
|
||||||
|
push-create:
|
||||||
|
default:
|
||||||
|
org: 'true'
|
||||||
|
private: 'false'
|
||||||
|
user: 'true'
|
||||||
|
examples:
|
||||||
|
- org: 'true'
|
||||||
|
private: 'false'
|
||||||
|
user: 'true'
|
||||||
|
properties:
|
||||||
|
org:
|
||||||
|
default: 'true'
|
||||||
|
type: string
|
||||||
|
private:
|
||||||
|
default: 'false'
|
||||||
|
type: string
|
||||||
|
user:
|
||||||
|
default: 'true'
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
replicas:
|
||||||
|
default: 1
|
||||||
|
examples:
|
||||||
|
- 1
|
||||||
|
type: integer
|
||||||
|
theme:
|
||||||
|
default: gitea-modern
|
||||||
|
examples:
|
||||||
|
- gitea-modern
|
||||||
|
type: string
|
||||||
|
issuer:
|
||||||
|
default: letsencrypt-prod
|
||||||
|
examples:
|
||||||
|
- letsencrypt-prod
|
||||||
|
type: string
|
||||||
dependencies:
|
dependencies:
|
||||||
- dist: null
|
- dist: null
|
||||||
category: share
|
category: share
|
||||||
|
|||||||
@@ -2,72 +2,6 @@ locals {
|
|||||||
pg-labels = merge(local.common-labels, {
|
pg-labels = merge(local.common-labels, {
|
||||||
"app.kubernetes.io/component" = "pg"
|
"app.kubernetes.io/component" = "pg"
|
||||||
})
|
})
|
||||||
postgres-labels = merge(local.common-labels, {
|
|
||||||
"app.kubernetes.io/component" = "postgresql"
|
|
||||||
})
|
|
||||||
}
|
|
||||||
resource "kubectl_manifest" "gitea_postgresql" {
|
|
||||||
yaml_body = <<-EOF
|
|
||||||
apiVersion: "acid.zalan.do/v1"
|
|
||||||
kind: "postgresql"
|
|
||||||
metadata:
|
|
||||||
name: "${var.instance}-${var.component}"
|
|
||||||
namespace: "${var.namespace}"
|
|
||||||
labels: ${jsonencode(local.postgres-labels)}
|
|
||||||
spec:
|
|
||||||
databases:
|
|
||||||
${var.component}: "${var.component}"
|
|
||||||
numberOfInstances: ${var.postgres.replicas}
|
|
||||||
podAnnotations:
|
|
||||||
"k8up.io/backupcommand": "pg_dump -U postgres -d ${var.component} --clean"
|
|
||||||
"k8up.io/file-extension": ".sql"
|
|
||||||
postgresql:
|
|
||||||
version: "${var.postgres.version}"
|
|
||||||
teamId: "${var.instance}"
|
|
||||||
users:
|
|
||||||
${var.component}:
|
|
||||||
- "superuser"
|
|
||||||
- "createdb"
|
|
||||||
volume:
|
|
||||||
size: "${var.postgres.storage}"
|
|
||||||
EOF
|
|
||||||
}
|
|
||||||
|
|
||||||
resource "kubectl_manifest" "prj_pre_migrate_pg" {
|
|
||||||
yaml_body = <<-EOF
|
|
||||||
apiVersion: batch/v1
|
|
||||||
kind: Job
|
|
||||||
metadata:
|
|
||||||
name: "${var.instance}-remove-zalando-extensions"
|
|
||||||
namespace: "${var.namespace}"
|
|
||||||
spec:
|
|
||||||
template:
|
|
||||||
spec:
|
|
||||||
restartPolicy: OnFailure
|
|
||||||
containers:
|
|
||||||
- name: clean
|
|
||||||
image: docker.io/postgres:15.3-bookworm
|
|
||||||
imagePullPolicy: IfNotPresent
|
|
||||||
env:
|
|
||||||
- name: USERNAME
|
|
||||||
valueFrom:
|
|
||||||
secretKeyRef:
|
|
||||||
key: username
|
|
||||||
name: postgres.${var.instance}-${var.component}.credentials.postgresql.acid.zalan.do
|
|
||||||
- name: PASSWORD
|
|
||||||
valueFrom:
|
|
||||||
secretKeyRef:
|
|
||||||
key: password
|
|
||||||
name: postgres.${var.instance}-${var.component}.credentials.postgresql.acid.zalan.do
|
|
||||||
- name: DBURL
|
|
||||||
value: "${var.instance}-${var.component}"
|
|
||||||
- name: DBNAME
|
|
||||||
value: "${var.component}"
|
|
||||||
command:
|
|
||||||
- /bin/bash
|
|
||||||
- "-c"
|
|
||||||
- "echo -ne 'drop view if exists metric_helpers.pg_stat_statements;\ndrop function if exists metric_helpers.pg_stat_statements;\nDROP EXTENSION IF EXISTS pg_stat_kcache;\nDROP EXTENSION IF EXISTS pg_stat_statements;\nDROP EXTENSION IF EXISTS set_user;\n'| PGPASSWORD=\"$PASSWORD\" psql -U $USERNAME -d $DBNAME -h $DBURL"
|
|
||||||
EOF
|
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "kubectl_manifest" "prj_pg" {
|
resource "kubectl_manifest" "prj_pg" {
|
||||||
@@ -83,25 +17,5 @@ resource "kubectl_manifest" "prj_pg" {
|
|||||||
instances: ${var.postgres.replicas}
|
instances: ${var.postgres.replicas}
|
||||||
storage:
|
storage:
|
||||||
size: "${var.postgres.storage}"
|
size: "${var.postgres.storage}"
|
||||||
bootstrap:
|
|
||||||
initdb:
|
|
||||||
database: ${var.component}
|
|
||||||
owner: ${var.component}
|
|
||||||
import:
|
|
||||||
type: microservice
|
|
||||||
databases:
|
|
||||||
- ${var.component}
|
|
||||||
source:
|
|
||||||
externalCluster: "${var.instance}-${var.component}"
|
|
||||||
externalClusters:
|
|
||||||
- name: "${var.instance}-${var.component}"
|
|
||||||
connectionParameters:
|
|
||||||
host: "${var.instance}-${var.component}"
|
|
||||||
user: postgres
|
|
||||||
dbname: postgres
|
|
||||||
sslmode: require
|
|
||||||
password:
|
|
||||||
name: "postgres.${var.instance}-${var.component}.credentials.postgresql.acid.zalan.do"
|
|
||||||
key: password
|
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,36 @@ metadata:
|
|||||||
name: nextcloud
|
name: nextcloud
|
||||||
description: null
|
description: null
|
||||||
options:
|
options:
|
||||||
|
postgres:
|
||||||
|
default:
|
||||||
|
replicas: 1
|
||||||
|
storage: 5Gi
|
||||||
|
version: '14'
|
||||||
|
examples:
|
||||||
|
- replicas: 1
|
||||||
|
storage: 5Gi
|
||||||
|
version: '14'
|
||||||
|
properties:
|
||||||
|
replicas:
|
||||||
|
default: 1
|
||||||
|
type: integer
|
||||||
|
storage:
|
||||||
|
default: 5Gi
|
||||||
|
type: string
|
||||||
|
version:
|
||||||
|
default: '14'
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
ingress-class:
|
||||||
|
default: traefik
|
||||||
|
examples:
|
||||||
|
- traefik
|
||||||
|
type: string
|
||||||
|
domain-name:
|
||||||
|
default: your_company.com
|
||||||
|
examples:
|
||||||
|
- your_company.com
|
||||||
|
type: string
|
||||||
apps:
|
apps:
|
||||||
default:
|
default:
|
||||||
audioplayer: false
|
audioplayer: false
|
||||||
@@ -96,21 +126,6 @@ options:
|
|||||||
default: true
|
default: true
|
||||||
type: boolean
|
type: boolean
|
||||||
type: object
|
type: object
|
||||||
admin:
|
|
||||||
default:
|
|
||||||
name: nextcloud_admin
|
|
||||||
examples:
|
|
||||||
- name: nextcloud_admin
|
|
||||||
properties:
|
|
||||||
name:
|
|
||||||
default: nextcloud_admin
|
|
||||||
type: string
|
|
||||||
type: object
|
|
||||||
domain-name:
|
|
||||||
default: your_company.com
|
|
||||||
examples:
|
|
||||||
- your_company.com
|
|
||||||
type: string
|
|
||||||
images:
|
images:
|
||||||
default:
|
default:
|
||||||
collabora:
|
collabora:
|
||||||
@@ -274,10 +289,10 @@ options:
|
|||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
type: object
|
type: object
|
||||||
ingress-class:
|
openid-name:
|
||||||
default: traefik
|
default: vynil
|
||||||
examples:
|
examples:
|
||||||
- traefik
|
- vynil
|
||||||
type: string
|
type: string
|
||||||
redis:
|
redis:
|
||||||
default:
|
default:
|
||||||
@@ -312,36 +327,11 @@ options:
|
|||||||
default: 2Gi
|
default: 2Gi
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
sub-domain:
|
|
||||||
default: files
|
|
||||||
examples:
|
|
||||||
- files
|
|
||||||
type: string
|
|
||||||
domain:
|
domain:
|
||||||
default: your-company
|
default: your-company
|
||||||
examples:
|
examples:
|
||||||
- your-company
|
- your-company
|
||||||
type: string
|
type: string
|
||||||
postgres:
|
|
||||||
default:
|
|
||||||
replicas: 1
|
|
||||||
storage: 5Gi
|
|
||||||
version: '14'
|
|
||||||
examples:
|
|
||||||
- replicas: 1
|
|
||||||
storage: 5Gi
|
|
||||||
version: '14'
|
|
||||||
properties:
|
|
||||||
replicas:
|
|
||||||
default: 1
|
|
||||||
type: integer
|
|
||||||
storage:
|
|
||||||
default: 5Gi
|
|
||||||
type: string
|
|
||||||
version:
|
|
||||||
default: '14'
|
|
||||||
type: string
|
|
||||||
type: object
|
|
||||||
storage:
|
storage:
|
||||||
default:
|
default:
|
||||||
accessMode: ReadWriteOnce
|
accessMode: ReadWriteOnce
|
||||||
@@ -361,16 +351,26 @@ options:
|
|||||||
default: 10Gi
|
default: 10Gi
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
|
sub-domain:
|
||||||
|
default: files
|
||||||
|
examples:
|
||||||
|
- files
|
||||||
|
type: string
|
||||||
issuer:
|
issuer:
|
||||||
default: letsencrypt-prod
|
default: letsencrypt-prod
|
||||||
examples:
|
examples:
|
||||||
- letsencrypt-prod
|
- letsencrypt-prod
|
||||||
type: string
|
type: string
|
||||||
openid-name:
|
admin:
|
||||||
default: vynil
|
default:
|
||||||
|
name: nextcloud_admin
|
||||||
examples:
|
examples:
|
||||||
- vynil
|
- name: nextcloud_admin
|
||||||
type: string
|
properties:
|
||||||
|
name:
|
||||||
|
default: nextcloud_admin
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
hpa:
|
hpa:
|
||||||
default:
|
default:
|
||||||
avg-cpu: 50
|
avg-cpu: 50
|
||||||
|
|||||||
@@ -2,72 +2,6 @@ locals {
|
|||||||
pg-labels = merge(local.common-labels, {
|
pg-labels = merge(local.common-labels, {
|
||||||
"app.kubernetes.io/component" = "pg"
|
"app.kubernetes.io/component" = "pg"
|
||||||
})
|
})
|
||||||
postgres-labels = merge(local.common-labels, {
|
|
||||||
"app.kubernetes.io/component" = "postgresql"
|
|
||||||
})
|
|
||||||
}
|
|
||||||
resource "kubectl_manifest" "prj_postgresql" {
|
|
||||||
yaml_body = <<-EOF
|
|
||||||
apiVersion: "acid.zalan.do/v1"
|
|
||||||
kind: "postgresql"
|
|
||||||
metadata:
|
|
||||||
name: "${var.instance}-${var.component}"
|
|
||||||
namespace: "${var.namespace}"
|
|
||||||
labels: ${jsonencode(local.postgres-labels)}
|
|
||||||
spec:
|
|
||||||
databases:
|
|
||||||
${var.component}: "${var.component}"
|
|
||||||
numberOfInstances: ${var.postgres.replicas}
|
|
||||||
podAnnotations:
|
|
||||||
"k8up.io/backupcommand": "pg_dump -U postgres -d ${var.component} --clean"
|
|
||||||
"k8up.io/file-extension": ".sql"
|
|
||||||
postgresql:
|
|
||||||
version: "${var.postgres.version}"
|
|
||||||
teamId: "${var.instance}"
|
|
||||||
users:
|
|
||||||
${var.component}:
|
|
||||||
- "superuser"
|
|
||||||
- "createdb"
|
|
||||||
volume:
|
|
||||||
size: "${var.postgres.storage}"
|
|
||||||
EOF
|
|
||||||
}
|
|
||||||
|
|
||||||
resource "kubectl_manifest" "prj_pre_migrate_pg" {
|
|
||||||
yaml_body = <<-EOF
|
|
||||||
apiVersion: batch/v1
|
|
||||||
kind: Job
|
|
||||||
metadata:
|
|
||||||
name: "${var.instance}-remove-zalando-extensions"
|
|
||||||
namespace: "${var.namespace}"
|
|
||||||
spec:
|
|
||||||
template:
|
|
||||||
spec:
|
|
||||||
restartPolicy: OnFailure
|
|
||||||
containers:
|
|
||||||
- name: clean
|
|
||||||
image: docker.io/postgres:15.3-bookworm
|
|
||||||
imagePullPolicy: IfNotPresent
|
|
||||||
env:
|
|
||||||
- name: USERNAME
|
|
||||||
valueFrom:
|
|
||||||
secretKeyRef:
|
|
||||||
key: username
|
|
||||||
name: postgres.${var.instance}-${var.component}.credentials.postgresql.acid.zalan.do
|
|
||||||
- name: PASSWORD
|
|
||||||
valueFrom:
|
|
||||||
secretKeyRef:
|
|
||||||
key: password
|
|
||||||
name: postgres.${var.instance}-${var.component}.credentials.postgresql.acid.zalan.do
|
|
||||||
- name: DBURL
|
|
||||||
value: "${var.instance}-${var.component}"
|
|
||||||
- name: DBNAME
|
|
||||||
value: "${var.component}"
|
|
||||||
command:
|
|
||||||
- /bin/bash
|
|
||||||
- "-c"
|
|
||||||
- "echo -ne 'drop view if exists metric_helpers.pg_stat_statements;\ndrop function if exists metric_helpers.pg_stat_statements;\nDROP EXTENSION IF EXISTS pg_stat_kcache;\nDROP EXTENSION IF EXISTS pg_stat_statements;\nDROP EXTENSION IF EXISTS set_user;\n'| PGPASSWORD=\"$PASSWORD\" psql -U $USERNAME -d $DBNAME -h $DBURL"
|
|
||||||
EOF
|
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "kubectl_manifest" "prj_pg" {
|
resource "kubectl_manifest" "prj_pg" {
|
||||||
@@ -83,25 +17,5 @@ resource "kubectl_manifest" "prj_pg" {
|
|||||||
instances: ${var.postgres.replicas}
|
instances: ${var.postgres.replicas}
|
||||||
storage:
|
storage:
|
||||||
size: "${var.postgres.storage}"
|
size: "${var.postgres.storage}"
|
||||||
bootstrap:
|
|
||||||
initdb:
|
|
||||||
database: ${var.component}
|
|
||||||
owner: ${var.component}
|
|
||||||
import:
|
|
||||||
type: microservice
|
|
||||||
databases:
|
|
||||||
- ${var.component}
|
|
||||||
source:
|
|
||||||
externalCluster: "${var.instance}-${var.component}"
|
|
||||||
externalClusters:
|
|
||||||
- name: "${var.instance}-${var.component}"
|
|
||||||
connectionParameters:
|
|
||||||
host: "${var.instance}-${var.component}"
|
|
||||||
user: postgres
|
|
||||||
dbname: postgres
|
|
||||||
sslmode: require
|
|
||||||
password:
|
|
||||||
name: "postgres.${var.instance}-${var.component}.credentials.postgresql.acid.zalan.do"
|
|
||||||
key: password
|
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user