command
This commit is contained in:
9
opencloud/charts/mongodb/templates/mongo_seed_data.yml
Normal file
9
opencloud/charts/mongodb/templates/mongo_seed_data.yml
Normal file
@@ -0,0 +1,9 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: mongo-seed-data
|
||||
data:
|
||||
{{- range $path, $_ := .Files.Glob (printf "start_files/%s/*.json" .Values.name) }}
|
||||
{{ base $path }}: |
|
||||
{{ $.Files.Get $path | indent 4 }}
|
||||
{{- end }}
|
||||
52
opencloud/charts/mongodb/templates/mongo_seed_job.yaml
Normal file
52
opencloud/charts/mongodb/templates/mongo_seed_job.yaml
Normal file
@@ -0,0 +1,52 @@
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: mongo-seed
|
||||
spec:
|
||||
backoffLimit: 1
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: mongo-seed
|
||||
image: mongo:6
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
- |
|
||||
echo "Waiting for Mongo to be ready..."
|
||||
until mongo --host mongo --eval "print(\"ok\")" >/dev/null 2>&1; do
|
||||
echo "Mongo not ready yet..."
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "Checking for JSON files in /opt/opencloud/seed-data..."
|
||||
files=(/opt/opencloud/seed-data/*.json)
|
||||
|
||||
if [ "${files[0]}" = "/opt/opencloud/seed-data/*.json" ]; then
|
||||
echo "No JSON files found. Skipping import."
|
||||
else
|
||||
echo "Importing JSON files..."
|
||||
for file in /opt/opencloud/seed-data/*.json; do
|
||||
if [ -f "$file" ]; then
|
||||
collection=$(basename "$file" .json)
|
||||
echo "Importing $file into collection $collection"
|
||||
mongoimport \
|
||||
--uri="mongodb://mongo:27017/opencloud" \
|
||||
--collection "$collection" \
|
||||
--drop \
|
||||
--file "$file" \
|
||||
--jsonArray || echo "Failed to import $file, continuing..."
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
echo "Mongo seed job finished."
|
||||
exit 0
|
||||
volumeMounts:
|
||||
- name: seed-volume
|
||||
mountPath: /opt/opencloud/seed-data
|
||||
volumes:
|
||||
- name: seed-volume
|
||||
configMap:
|
||||
name: mongo-seed-data
|
||||
restartPolicy: Never
|
||||
BIN
opencloud/cmd
Executable file
BIN
opencloud/cmd
Executable file
Binary file not shown.
BIN
opencloud/main
Executable file
BIN
opencloud/main
Executable file
Binary file not shown.
@@ -1,19 +0,0 @@
|
||||
{{- if index .Values.ocFront.enabled }}
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: front-config
|
||||
data:
|
||||
config.json: |
|
||||
{
|
||||
"WORKSPACE_HOST": "{{ .Values.scheme }}://{{ .Values.host }}/workspace",
|
||||
"WORKFLOW_HOST": "{{ .Values.scheme }}://{{ .Values.host }}/workflow",
|
||||
"CATALOG_HOST": "{{ .Values.scheme }}://{{ .Values.host }}/catalog",
|
||||
"SCHEDULER_HOST": "{{ .Values.scheme }}://{{ .Values.host }}/scheduler",
|
||||
"PEER_HOST": "{{ .Values.scheme }}://{{ .Values.host }}/peers",
|
||||
"DATACENTER_HOST": "{{ .Values.scheme }}://{{ .Values.host }}/datacenter",
|
||||
"COLLABORATIVE_AREA_HOST": "{{ .Values.scheme }}://{{ .Values.host }}/shared",
|
||||
"HOST": "{{ .Values.scheme }}://{{ .Values.host }}",
|
||||
"AUTH_HOST": "{{ .Values.scheme }}://{{ .Values.host }}/auth"
|
||||
}
|
||||
{{- end }}
|
||||
@@ -1,5 +1,6 @@
|
||||
env: ${RELEASE:-prod} # For storage class provisioning
|
||||
host: ${HOST:-beta.opencloud.com} # For reverse proxy rule
|
||||
name: ${CLUSTER_NAME:-opencloud}
|
||||
host: ${HOST:-beta.opencloud.com}
|
||||
registryHost: ${REGISTRY_HOST:-oc} # For reverse proxy rule
|
||||
scheme: https # For reverse proxy rule
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
env: test # For storage class provisioning
|
||||
host: beta.opencloud.com # For reverse proxy rule
|
||||
name: opencloud
|
||||
host: beta.opencloud.com
|
||||
registryHost: oc # For reverse proxy rule
|
||||
scheme: https # For reverse proxy rule
|
||||
|
||||
@@ -76,23 +77,6 @@ nats:
|
||||
# name is the volume name used in volumeMounts; keep it simple
|
||||
name: nats-jetstream
|
||||
|
||||
reloader:
|
||||
enabled: false
|
||||
image: "natsio/nats-server-config-reloader:0.16.0-debian"
|
||||
# Override ENTRYPOINT so we can raise ulimit before starting the real binary
|
||||
command:
|
||||
- /bin/sh
|
||||
- -c
|
||||
args:
|
||||
- -pid
|
||||
- /var/run/nats/nats.pid
|
||||
- -config
|
||||
- /etc/nats-config/nats.conf
|
||||
|
||||
# Required to allow ulimit raise
|
||||
securityContext:
|
||||
runAsUser: 0
|
||||
|
||||
openldap:
|
||||
enabled: true
|
||||
test:
|
||||
|
||||
Reference in New Issue
Block a user