From cd934ec56048ee63087e2d42c90dd7ece573023d Mon Sep 17 00:00:00 2001 From: ThomasCardin Date: Mon, 4 Mar 2024 10:30:39 -0500 Subject: [PATCH 1/6] issue #81: cloudbeaver deployment --- .../aks/system/cloudbeaver/argo-app.yaml | 22 +++++++++ .../system/cloudbeaver/base/deployment.yaml | 48 +++++++++++++++++++ .../aks/system/cloudbeaver/base/ingress.yaml | 27 +++++++++++ .../aks/system/cloudbeaver/kustomization.yaml | 6 +++ 4 files changed, 103 insertions(+) create mode 100644 kubernetes/aks/system/cloudbeaver/argo-app.yaml create mode 100644 kubernetes/aks/system/cloudbeaver/base/deployment.yaml create mode 100644 kubernetes/aks/system/cloudbeaver/base/ingress.yaml create mode 100644 kubernetes/aks/system/cloudbeaver/kustomization.yaml diff --git a/kubernetes/aks/system/cloudbeaver/argo-app.yaml b/kubernetes/aks/system/cloudbeaver/argo-app.yaml new file mode 100644 index 00000000..182aab66 --- /dev/null +++ b/kubernetes/aks/system/cloudbeaver/argo-app.yaml @@ -0,0 +1,22 @@ +--- +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: cloudbeaver + namespace: argocd + finalizers: + - resources-finalizer.argocd.argoproj.io +spec: + project: default + destination: + server: https://kubernetes.default.svc + namespace: cloudbeaver + source: + repoURL: https://github.com/ai-cfia/howard.git + path: kubernetes/aks/system/cloudbeaver/base + targetRevision: HEAD + syncPolicy: + automated: + selfHeal: true + syncOptions: + - CreateNamespace=true diff --git a/kubernetes/aks/system/cloudbeaver/base/deployment.yaml b/kubernetes/aks/system/cloudbeaver/base/deployment.yaml new file mode 100644 index 00000000..86f168c6 --- /dev/null +++ b/kubernetes/aks/system/cloudbeaver/base/deployment.yaml @@ -0,0 +1,48 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: cloudbeaver + namespace: cloudbeaver +spec: + replicas: 2 + selector: + matchLabels: + app: cloudbeaver + template: + metadata: + labels: + app: cloudbeaver + spec: + containers: + - name: cloudbeaver + image: dbeaver/cloudbeaver:24.0.0 + imagePullPolicy: Always + ports: + - containerPort: 8978 + livenessProbe: + httpGet: + path: / + port: 8978 + initialDelaySeconds: 60 + periodSeconds: 10 + readinessProbe: + httpGet: + path: / + port: 8978 + initialDelaySeconds: 40 + periodSeconds: 10 + +--- +apiVersion: v1 +kind: Service +metadata: + name: cloudbeaver + namespace: cloudbeaver +spec: + clusterIP: None + selector: + app: cloudbeaver + ports: + - protocol: TCP + port: 8978 diff --git a/kubernetes/aks/system/cloudbeaver/base/ingress.yaml b/kubernetes/aks/system/cloudbeaver/base/ingress.yaml new file mode 100644 index 00000000..09cab9e0 --- /dev/null +++ b/kubernetes/aks/system/cloudbeaver/base/ingress.yaml @@ -0,0 +1,27 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: cloudbeaver-ingress + namespace: cloudbeaver + annotations: + external-dns.alpha.kubernetes.io/target: inspection.alpha.canada.ca + cert-manager.io/cluster-issuer: letsencrypt-prod + ingress.kubernetes.io/force-ssl-redirect: "true" + kubernetes.io/tls-acme: "true" +spec: + ingressClassName: cloudbeaver + tls: + - hosts: + - cloudbeaver.inspection.alpha.canada.ca + secretName: cloudbeaver-tls + rules: + - host: cloudbeaver.inspection.alpha.canada.ca + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: cloudbeaver + port: + number: 8978 diff --git a/kubernetes/aks/system/cloudbeaver/kustomization.yaml b/kubernetes/aks/system/cloudbeaver/kustomization.yaml new file mode 100644 index 00000000..d1bc2b63 --- /dev/null +++ b/kubernetes/aks/system/cloudbeaver/kustomization.yaml @@ -0,0 +1,6 @@ +--- +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - argo-app.yaml From 087338e727c2c7ed471f1df3b8c1a0debf6e403a Mon Sep 17 00:00:00 2001 From: ThomasCardin Date: Mon, 4 Mar 2024 10:31:10 -0500 Subject: [PATCH 2/6] issue #81: added cloudbeaver to argo apps --- kubernetes/aks/apps/argo-apps/kustomization.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/kubernetes/aks/apps/argo-apps/kustomization.yaml b/kubernetes/aks/apps/argo-apps/kustomization.yaml index 0d866e0d..ad6ea69e 100644 --- a/kubernetes/aks/apps/argo-apps/kustomization.yaml +++ b/kubernetes/aks/apps/argo-apps/kustomization.yaml @@ -15,6 +15,7 @@ resources: - ../../system/monitoring/ - ../../system/cloudnativepg/ - ../../system/coder + - ../../system/cloudbeaver patches: From 800ed8a579c626216ddc09af0ac21ff016b70cf5 Mon Sep 17 00:00:00 2001 From: ThomasCardin Date: Mon, 4 Mar 2024 17:51:19 +0000 Subject: [PATCH 3/6] issue #81: fixed ingressclassname --- kubernetes/aks/system/cloudbeaver/base/ingress.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kubernetes/aks/system/cloudbeaver/base/ingress.yaml b/kubernetes/aks/system/cloudbeaver/base/ingress.yaml index 09cab9e0..ae5bc172 100644 --- a/kubernetes/aks/system/cloudbeaver/base/ingress.yaml +++ b/kubernetes/aks/system/cloudbeaver/base/ingress.yaml @@ -9,7 +9,7 @@ metadata: ingress.kubernetes.io/force-ssl-redirect: "true" kubernetes.io/tls-acme: "true" spec: - ingressClassName: cloudbeaver + ingressClassName: nginx tls: - hosts: - cloudbeaver.inspection.alpha.canada.ca From 399235eb03e518ac176683d7fd4174eb8b6c6ee1 Mon Sep 17 00:00:00 2001 From: Thomas Cardin <49320132+ThomasCardin@users.noreply.github.com> Date: Tue, 5 Mar 2024 15:01:43 -0500 Subject: [PATCH 4/6] issue #81: cloudbeaver deployment --- .../cloudbeaver/base/config/cloudbeaver.conf | 69 +++++++++++++++++++ .../cloudbeaver/base/config/data-sources.json | 29 ++++++++ .../cloudbeaver/base/config/product.conf | 34 +++++++++ .../system/cloudbeaver/base/deployment.yaml | 32 +++++++++ .../cloudbeaver/base/kustomization.yaml | 25 +++++++ .../system/cloudbeaver/base/namespace.yaml | 6 ++ 6 files changed, 195 insertions(+) create mode 100644 kubernetes/aks/system/cloudbeaver/base/config/cloudbeaver.conf create mode 100644 kubernetes/aks/system/cloudbeaver/base/config/data-sources.json create mode 100644 kubernetes/aks/system/cloudbeaver/base/config/product.conf create mode 100644 kubernetes/aks/system/cloudbeaver/base/kustomization.yaml create mode 100644 kubernetes/aks/system/cloudbeaver/base/namespace.yaml diff --git a/kubernetes/aks/system/cloudbeaver/base/config/cloudbeaver.conf b/kubernetes/aks/system/cloudbeaver/base/config/cloudbeaver.conf new file mode 100644 index 00000000..23462a58 --- /dev/null +++ b/kubernetes/aks/system/cloudbeaver/base/config/cloudbeaver.conf @@ -0,0 +1,69 @@ +{ + server: { + serverPort: 8978, + + workspaceLocation: "workspace", + contentRoot: "web", + driversLocation: "drivers", + + rootURI: "/", + serviceURI: "/api/", + + productConfiguration: "conf/product.conf", + + expireSessionAfterPeriod: 1800000, + + develMode: false, + + enableSecurityManager: false, + + database: { + driver="h2_embedded", + url: "jdbc:h2:${workspace}/.data/cb.h2.dat", + + createDatabase: true, + + initialDataConfiguration: "conf/initial-data.conf", + + pool: { + minIdleConnections: 4, + maxIdleConnections: 10, + maxConnections: 100, + validationQuery: "SELECT 1" + } + } + + }, + app: { + anonymousAccessEnabled: false, + anonymousUserRole: "user", + supportsCustomConnections: false, + + forwardProxy: false, + + publicCredentialsSaveEnabled: false, + adminCredentialsSaveEnabled: false, + + resourceManagerEnabled: true, + + resourceQuotas: { + dataExportFileSizeLimit: 10000000, + resourceManagerFileSizeLimit: 500000, + sqlMaxRunningQueries: 100, + sqlResultSetRowsLimit: 100000, + sqlResultSetMemoryLimit: 2000000, + sqlTextPreviewMaxLength: 4096, + sqlBinaryPreviewMaxLength: 261120 + }, + enabledAuthProviders: [ + "local" + ], + + enabledDrivers: [ + "sqlite:sqlite_jdbc", + "h2:h2_embedded", + "clickhouse:yandex_clickhouse" + ] + + } +} diff --git a/kubernetes/aks/system/cloudbeaver/base/config/data-sources.json b/kubernetes/aks/system/cloudbeaver/base/config/data-sources.json new file mode 100644 index 00000000..962098b1 --- /dev/null +++ b/kubernetes/aks/system/cloudbeaver/base/config/data-sources.json @@ -0,0 +1,29 @@ +{ + "folders": { + "My DBs": {} + }, + "connections": { + "DB-example-01": { + "provider": "postgresql", + "driver": "postgres-jdbc", + "name": "DB-example-01", + "description": "Postgre connection", + "save-password": false, + "show-system-objects": true, + "read-only": false, + "folder": "My DBs", + "configuration": { + "user": "my-db-user", + "host": "postgres", + "port": "5432", + "database": "my-postgre-db", + "url": "jdbc:postgresql://postgres:5432/my-postgre-db", + "type": "dev", + "provider-properties": { + "@dbeaver-show-non-default-db@": "true" + }, + "auth-model": "native" + } + } + } +} diff --git a/kubernetes/aks/system/cloudbeaver/base/config/product.conf b/kubernetes/aks/system/cloudbeaver/base/config/product.conf new file mode 100644 index 00000000..2708c49b --- /dev/null +++ b/kubernetes/aks/system/cloudbeaver/base/config/product.conf @@ -0,0 +1,34 @@ +// Product configuration. Customized web application behavior +// It is in JSONC format +{ + // Global properties + core: { + // User defaults + user: { + defaultTheme: "dark", + defaultLanguage: "en" + }, + app: { + // Log viewer config + logViewer: { + refreshTimeout: 3000, + logBatchSize: 1000, + maxLogRecords: 2000, + maxFailedRequests: 3 + } + }, + authentication: { + anonymousAccessEnabled: false + } + }, + // Notifications config + core_events: { + notificationsPool: 5 + }, + plugin_data_spreadsheet_new: { + hidden: false + }, + plugin_data_export: { + disabled: false + } +} diff --git a/kubernetes/aks/system/cloudbeaver/base/deployment.yaml b/kubernetes/aks/system/cloudbeaver/base/deployment.yaml index 86f168c6..918128b3 100644 --- a/kubernetes/aks/system/cloudbeaver/base/deployment.yaml +++ b/kubernetes/aks/system/cloudbeaver/base/deployment.yaml @@ -32,6 +32,38 @@ spec: port: 8978 initialDelaySeconds: 40 periodSeconds: 10 + volumeMounts: + - name: dbeaver-product + mountPath: /opt/cloudbeaver/conf/product.conf + subPath: product.conf + - name: dbeaver-sources-user + mountPath: /opt/cloudbeaver/workspace/user-projects/admin.dbeaver/.dbeaver/data-sources.json + subPath: data-sources.json + - name: dbeaver-sources-global + mountPath: /opt/cloudbeaver/workspace/GlobalConfiguration/.dbeaver/data-sources.json + subPath: data-sources.json + - name: dbeaver-server + mountPath: /opt/cloudbeaver/conf/cloudbeaver.conf + subPath: cloudbeaver.conf + - name: dbeaver-initial-data + mountPath: /opt/cloudbeaver/conf/initial-data.conf + subPath: initial-data.conf + volumes: + - name: dbeaver-product + configMap: + name: dbeaver-product-configmap-76t74t24mh + - name: dbeaver-sources-user + configMap: + name: dbeaver-sources-user-configmap-t8m94c4gb7 + - name: dbeaver-sources-global + configMap: + name: dbeaver-sources-global-configmap-t8m94c4gb7 + - name: dbeaver-server + configMap: + name: dbeaver-server-configmap-9tgdffkdbb + - name: dbeaver-initial-data + configMap: + name: dbeaver-initial-data-configmap-t58fgmffkg --- apiVersion: v1 diff --git a/kubernetes/aks/system/cloudbeaver/base/kustomization.yaml b/kubernetes/aks/system/cloudbeaver/base/kustomization.yaml new file mode 100644 index 00000000..9a7ed93c --- /dev/null +++ b/kubernetes/aks/system/cloudbeaver/base/kustomization.yaml @@ -0,0 +1,25 @@ +--- +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - deployment.yaml + - ingress.yaml + - namespace.yaml + +configMapGenerator: + - name: dbeaver-product-configmap + files: + - config/product.conf + - name: dbeaver-sources-user-configmap + files: + - config/data-sources.json + - name: dbeaver-sources-global-configmap + files: + - config/data-sources.json + - name: dbeaver-server-configmap + files: + - config/cloudbeaver.conf + - name: dbeaver-initial-data-configmap + files: + - config/initial-data.conf diff --git a/kubernetes/aks/system/cloudbeaver/base/namespace.yaml b/kubernetes/aks/system/cloudbeaver/base/namespace.yaml new file mode 100644 index 00000000..3287d104 --- /dev/null +++ b/kubernetes/aks/system/cloudbeaver/base/namespace.yaml @@ -0,0 +1,6 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: cloudbeaver + labels: + name: cloudbeaver From e7be25a3d55b1b88514353b312a718936d9d4286 Mon Sep 17 00:00:00 2001 From: Thomas Cardin <49320132+ThomasCardin@users.noreply.github.com> Date: Tue, 12 Mar 2024 13:23:43 -0400 Subject: [PATCH 5/6] issue #81: removed cloudbeaver from app --- kubernetes/aks/apps/argo-apps/kustomization.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/kubernetes/aks/apps/argo-apps/kustomization.yaml b/kubernetes/aks/apps/argo-apps/kustomization.yaml index ad6ea69e..0d866e0d 100644 --- a/kubernetes/aks/apps/argo-apps/kustomization.yaml +++ b/kubernetes/aks/apps/argo-apps/kustomization.yaml @@ -15,7 +15,6 @@ resources: - ../../system/monitoring/ - ../../system/cloudnativepg/ - ../../system/coder - - ../../system/cloudbeaver patches: From 1521519ca3313d6fc9468bdb90b376c690ae03fc Mon Sep 17 00:00:00 2001 From: Thomas Cardin <49320132+ThomasCardin@users.noreply.github.com> Date: Tue, 12 Mar 2024 13:24:07 -0400 Subject: [PATCH 6/6] issue #81: removed cloudbeaver argoapp --- .../aks/system/cloudbeaver/argo-app.yaml | 22 ------------------- 1 file changed, 22 deletions(-) delete mode 100644 kubernetes/aks/system/cloudbeaver/argo-app.yaml diff --git a/kubernetes/aks/system/cloudbeaver/argo-app.yaml b/kubernetes/aks/system/cloudbeaver/argo-app.yaml deleted file mode 100644 index 182aab66..00000000 --- a/kubernetes/aks/system/cloudbeaver/argo-app.yaml +++ /dev/null @@ -1,22 +0,0 @@ ---- -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: cloudbeaver - namespace: argocd - finalizers: - - resources-finalizer.argocd.argoproj.io -spec: - project: default - destination: - server: https://kubernetes.default.svc - namespace: cloudbeaver - source: - repoURL: https://github.com/ai-cfia/howard.git - path: kubernetes/aks/system/cloudbeaver/base - targetRevision: HEAD - syncPolicy: - automated: - selfHeal: true - syncOptions: - - CreateNamespace=true