Skip to content

Commit

Permalink
cast-hl migration (#34)
Browse files Browse the repository at this point in the history
* cast-hl migration

* db job update

* version 1.1.33

* version 1.1.34

* version 1.1.35

* version 1.1.36

* version 1.1.37

* version 1.1.38

* version 1.1.39

* version 1.1.40

* version 1.1.42

* version 1.1.43

* version 1.1.44

* version 1.1.45

* version 1.1.46

* version 1.1.47

* version 1.1.48

* version 1.1.49

* version 1.1.50
  • Loading branch information
mcavoyjd authored Nov 15, 2024
1 parent 48a5eea commit 1e65c19
Show file tree
Hide file tree
Showing 18 changed files with 95 additions and 132 deletions.
6 changes: 6 additions & 0 deletions charts/cast-highlight/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies:
- name: postgresql
repository: https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami
version: 10.14.4
digest: sha256:ad1fefa7419c494c8ee12b7807a1eda5cb8be7d9a95bb7d5a5544f8aea5504d6
generated: "2024-10-31T14:30:01.276766Z"
9 changes: 7 additions & 2 deletions charts/cast-highlight/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,13 @@ type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
version: 1.1.22
version: 1.1.50

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
appVersion: 1.0.0
appVersion: 1.0.1
dependencies:
- name: postgresql
version: 10.14.4
repository: https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami
condition: postgresql.enabled
Binary file not shown.
6 changes: 3 additions & 3 deletions charts/cast-highlight/templates/cast-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ metadata:
labels:
app: {{ .Values.server.name }}
data:
HL_PG_SERVER: {{ .Values.database.name }}
HL_PG_SERVER: {{ .Values.env.database_url }}
HL_PG_PORT: "5432"
HL_PG_DB: highlight
HL_PG_SCHEMA: {{ .Values.database.schema }}
HL_PG_DB: {{ .Values.env.database_name }}
HL_PG_SCHEMA: {{ .Values.env.database_schema }}
HL_HOSTNAME: {{ .Values.server.host }}
HL_ROOT_URL: https://{{ .Values.server.host }}/
HL_ANTEPEDIA_HOST: {{ .Values.sca.host }}
Expand Down
8 changes: 4 additions & 4 deletions charts/cast-highlight/templates/cast-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ spec:
- name: {{ .Values.server.name }}
image: {{ .Values.server.container.image }}
ports:
- containerPort: {{ .Values.server.container.port }}
- containerPort: {{ .Values.server.container.port }}
envFrom:
- configMapRef:
name: {{ .Values.server.name }}-config
Expand All @@ -32,12 +32,12 @@ spec:
valueFrom:
secretKeyRef:
key: username
name: {{ .Values.database.name }}-secret
name: {{ .Values.env.database_name }}-secret
- name: HL_PG_PASSWORD
valueFrom:
secretKeyRef:
key: password
name: {{ .Values.database.name }}-secret
name: {{ .Values.env.database_name }}-secret
- name: HL_ADMIN_MAIL
valueFrom:
secretKeyRef:
Expand Down Expand Up @@ -73,7 +73,7 @@ spec:
defaultMode: 420
name: {{ .Values.server.name }}-saml-realms-config
name: {{ .Values.containers.volumeMounts.name }}-saml-realms

---
apiVersion: v1
kind: Service
Expand Down
6 changes: 3 additions & 3 deletions charts/cast-highlight/templates/db-config.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Values.database.name }}-config
name: {{ .Values.env.database_name }}-config
namespace: {{ .Values.namespace.name }}
labels:
app: {{ .Values.database.name }}
app: {{ .Values.env.database_name }}
data:
POSTGRES_DB: {{ .Values.database.schema }}
POSTGRES_DB: {{ .Values.env.database_schema }}
62 changes: 0 additions & 62 deletions charts/cast-highlight/templates/db-deployment.yaml

This file was deleted.

9 changes: 3 additions & 6 deletions charts/cast-highlight/templates/db-initdb-config.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
kind: ConfigMap
apiVersion: v1
metadata:
name: {{ .Values.database.name }}-initdb-config
name: {{ .Values.env.database_name }}-initdb-config
namespace: {{ .Values.namespace.name }}
labels:
app: {{ .Values.database.name }}
app: {{ .Values.env.database_name }}
data:
initdb.sql: |
--
Expand All @@ -26,11 +26,8 @@ data:
--
-- Name: highlight; Type: SCHEMA; Schema: -; Owner: highlight
--
ALTER DATABASE HIGHLIGHT OWNER TO {{ .Values.database.secret.username }};
CREATE SCHEMA {{ .Values.database.schema }};
ALTER SCHEMA {{ .Values.database.schema }} OWNER TO {{ .Values.database.secret.username }};
CREATE SCHEMA {{ .Values.env.database_schema }};
--
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner:
Expand Down
22 changes: 11 additions & 11 deletions charts/cast-highlight/templates/db-job.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
apiVersion: batch/v1
kind: Job
metadata:
name: {{ .Values.database.name }}
name: {{ .Values.env.database_name }}
namespace: {{ .Values.namespace.name }}
labels:
app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
app.kubernetes.io/instance: {{ .Release.Name | quote }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
app: {{ .Values.database.name }}-job
app: {{ .Values.env.database_name }}-job
annotations:
# This is what defines this resource as a hook. Without this line, the
# job is considered part of the release.
Expand All @@ -18,12 +18,12 @@ metadata:
spec:
template:
metadata:
name: {{ .Values.database.name }}-job
name: {{ .Values.env.database_name }}-job
labels:
app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
app.kubernetes.io/instance: {{ .Release.Name | quote }}
helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
app: {{ .Values.database.name }}-job
app: {{ .Values.env.database_name }}-job
annotations:
"sidecar.istio.io/inject": "false"
spec:
Expand All @@ -34,21 +34,21 @@ spec:
restartPolicy: Never
containers:
- name: post-install-job
image: {{ .Values.database.job.image }}
# command: ["sh", "-c", "sleep 60s ; psql -h {{ .Values.database.name }} -U {{ .Values.database.secret.username }} -d highlight -p {{ .Values.database.container.port }} -a -f /post-scripts/data_insert.sql"]
image: {{ .Values.env.database_image }}
# command: ["sh", "-c", "sleep 60s ; psql -h {{ .Values.env.database_name }} -U {{ .Values.server.secret.username }} -d highlight -p {{ .Values.env.database_container_port }} -a -f /post-scripts/data_insert.sql"]
# command: ["sh", "-c", "sleep 3600s"]
# command: ["sh", "-c", "sleep 60s ; cat /pg-restore/pg_restore.sql | psql -h {{ .Values.database.name }} -U {{ .Values.database.secret.username }} -p {{ .Values.database.container.port }} -d highlight "]
# command: ["sh", "-c", "sleep 60s ; cat /pg-restore/pg_restore.sql | psql -h {{ .Values.env.database_name }} -U {{ .Values.server.secret.username }} -p {{ .Values.env.database_containerport }} -d highlight "]
command: ["sh", "-c", "sleep 180s ; . /scripts/cast-init.sh"]
env:
- name: HL_PG_PASSWORD
valueFrom:
secretKeyRef:
key: password
name: {{ .Values.database.name }}-secret
name: {{ .Values.env.database_name }}-secret
volumeMounts:
- name: {{ .Values.database.name }}-init-script
- name: {{ .Values.env.database_name }}-init-script
mountPath: "/scripts"
volumes:
- name: {{ .Values.database.name }}-init-script
- name: {{ .Values.env.database_name }}-init-script
configMap:
name: {{ .Values.database.name }}-init-script
name: {{ .Values.env.database_name }}-init-script
12 changes: 0 additions & 12 deletions charts/cast-highlight/templates/db-pv.yaml

This file was deleted.

6 changes: 3 additions & 3 deletions charts/cast-highlight/templates/db-secret.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
apiVersion: v1
kind: Secret
metadata:
name: {{ .Values.database.name }}-secret
name: {{ .Values.env.database_name }}-secret
namespace: {{ .Values.namespace.name }}
type: Opaque
stringData:
username: {{ .Values.database.secret.username }}
password: {{ .Values.database.secret.password }}
username: {{ .Values.env.database_username }}
password: {{ .Values.env.database_password }}
6 changes: 3 additions & 3 deletions charts/cast-highlight/templates/init-cast.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Values.database.name }}-init-script
name: {{ .Values.env.database_name }}-init-script
namespace: {{ .Values.namespace.name }}
labels:
app: {{ .Values.database.name }}
app: {{ .Values.env.database_name }}
data:
cast-init.sh: |
#/bin/sh
Expand Down Expand Up @@ -109,7 +109,7 @@ data:
## SET USER PASSWORD
#### GET UUID FROM PSQL
REG_URLS=$(PGPASSWORD=$HL_PG_PASSWORD psql -h {{ .Values.database.name }} -U highlight_root -p 5432 -d highlight -c 'select $$'https://cast/#/?registration='$$ || uuid FROM highlight.mail_operations, highlight.roles, highlight.mail_address WHERE highlight.mail_address.user_id = highlight.roles.user_id AND highlight.roles.id = highlight.mail_operations.u_id;')
REG_URLS=$(PGPASSWORD=$HL_PG_PASSWORD psql -h "{{ .Values.env.database_url }}" -U foresight -p 5432 -d "cast-db" -c "SELECT 'https://cast/#/?registration=' || uuid FROM highlight.mail_operations, highlight.roles, highlight.mail_address WHERE highlight.mail_address.user_id = highlight.roles.user_id AND highlight.roles.id = highlight.mail_operations.u_id;")
MANAGER_URL=$(echo $REG_URLS | awk -F' ' '{print $3}')
VIEWER_URL=$(echo $REG_URLS | awk -F' ' '{print $4}')
MANAGER_UUID=$(echo $MANAGER_URL | sed -n 's/.*ation=//p')
Expand Down
54 changes: 31 additions & 23 deletions charts/cast-highlight/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ containers:
requests:
cpu: 2
memory: 2G
env:
database_username: ""
database_password: ""
database_url: ""
database_name: cast-db
database_schema: highlight
database_image: cerberussystems/postgres-curl
database_container_port: "5432"
database_secret_username: ""
server:
name: cast-hl
replicas: 1
Expand Down Expand Up @@ -42,33 +51,32 @@ server:
password:
additionalAccountPassword:

database:
name: hl-db
replicas: 1
container:
image: postgres:12-alpine
port: 5432
volumeMounts:
name: hl-db-persistent-storage
mountPath: /usr/lib/postgresql/data
subPath: hl
strategy: Recreate
volume:
name: hl-db-persistent-storage
persistentVolumeClaim: postgres-pv-claim
persistentVolumeClaimStorage: 20Gi
storageClassName: aws-efs
secret:
username:
password:
schema: highlight
job:
image: bitnami/postgresql:latest

sca:
host:
port: 80
ssl: false

imagePullSecrets:
name:

##### POSTGRES Configuration
postgresql:
enabled: false
annotations:
app: sage-database
common:
image:
pullSecrets: ""
pullPolicy: "IfNotPresent"
persistence:
mountPath: /var/lib/postgresql/data
subPath: sagedb
size: 20Gi
storageClass: aws-efs
# PostgreSQL User to create
postgresqlUsername: sage-db
# PostgreSQL Password for the new user
postgresqlPassword: ""
# PostgreSQL Database to create
postgresqlDatabase: sage-db
# Persistent Volume Storage configuration
6 changes: 6 additions & 0 deletions charts/commondata-backend/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies:
- name: postgresql
repository: https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami
version: 10.14.4
digest: sha256:ad1fefa7419c494c8ee12b7807a1eda5cb8be7d9a95bb7d5a5544f8aea5504d6
generated: "2024-10-31T14:30:24.877179Z"
6 changes: 6 additions & 0 deletions charts/sage-backend/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies:
- name: postgresql
repository: https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami
version: 10.14.4
digest: sha256:ad1fefa7419c494c8ee12b7807a1eda5cb8be7d9a95bb7d5a5544f8aea5504d6
generated: "2024-10-31T14:30:44.111663Z"
9 changes: 9 additions & 0 deletions charts/superset/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
dependencies:
- name: postgresql
repository: https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami
version: 10.14.4
- name: redis
repository: https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami
version: 17.3.17
digest: sha256:6adda42ad963a44eb44262cb68b377440f4a3cb4f53c56f314451237a80fb1ed
generated: "2024-10-31T14:31:07.781895Z"
Binary file added charts/superset/charts/postgresql-10.14.4.tgz
Binary file not shown.
Binary file added charts/superset/charts/redis-17.3.17.tgz
Binary file not shown.

0 comments on commit 1e65c19

Please sign in to comment.