- name: init-data
mountPath: /aaa/init/marketplace_tables_postgres.sql
subPath: marketplace_tables_postgres.sql
- {{ include "common.waitForJobContainer" . | indent 6 | trim }}
{{- include "common.imagePullSecrets" . | nindent 6 }}
volumes:
- name: init-data
args:
- -c
- |
- {{- if include "common.onServiceMesh" . }}
- echo "waiting 15s for istio side cars to be up"; sleep 15s;{{- end }}
- sh docker-entrypoint.sh createDBSchema.sh;
- {{ include "common.serviceMesh.killSidecar" . | indent 11 | trim }}
+ sh docker-entrypoint.sh createDBSchema.sh
env:
{{- if .Values.config.debug.enabled }}
- name: JVM_OPTS
args:
- -c
- |
- {{- if include "common.onServiceMesh" . }}
- echo "waiting 15s for istio side cars to be up"; sleep 15s;{{- end }}
- bash docker-entrypoint.sh dataSnapshot.sh;
- {{ include "common.serviceMesh.killSidecar" . | indent 11 | trim }}
+ bash docker-entrypoint.sh dataSnapshot.sh
volumeMounts:
- mountPath: /opt/app/aai-graphadmin/logs/data/dataSnapshots
name: snapshots
args:
- -c
- |
- {{- if include "common.onServiceMesh" . }}
- echo "waiting 15s for istio side cars to be up"; sleep 15s;{{- end }}
- sh docker-entrypoint.sh createDBSchema.sh;
- {{ include "common.serviceMesh.killSidecar" . | indent 11 | trim }}
+ sh docker-entrypoint.sh createDBSchema.sh
env:
{{- if .Values.config.debug.enabled }}
- name: JVM_OPTS
args:
- -c
- |
- {{- if include "common.onServiceMesh" . }}
- echo "waiting 15s for istio side cars to be up"; sleep 15s;{{- end }}
- sh docker-entrypoint.sh run_Migrations.sh -e UpdateAaiUriIndexMigration --commit --skipPreMigrationSnapShot --runDisabled RebuildAllEdges ;
- {{ include "common.serviceMesh.killSidecar" . | indent 11 | trim }}
+ sh docker-entrypoint.sh run_Migrations.sh -e UpdateAaiUriIndexMigration --commit --skipPreMigrationSnapShot --runDisabled RebuildAllEdges
{{ include "common.containerSecurityContext" . | indent 8 | trim }}
volumeMounts:
- mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/janusgraph-realtime.properties
args:
- -c
- |
- {{- if include "common.onServiceMesh" . }}
- echo "waiting 15s for istio side cars to be up"; sleep 15s;{{- end }}
sh docker-entrypoint.sh dataSnapshot.sh
- {{ include "common.serviceMesh.killSidecar" . | indent 11 | trim }}
volumeMounts:
- mountPath: /opt/app/aai-graphadmin/logs/data/dataSnapshots
name: snapshots
fi
sh -x /opt/app/aai-traversal/bin/install/updateQueryData.sh ;
-
- {{ include "common.serviceMesh.killSidecar" . | indent 11 | trim }}
{{ include "common.containerSecurityContext" . | indent 8 | trim }}
resources: {{ include "common.resources" . | nindent 10 }}
volumeMounts:
{{- end -}}
{{- end -}}
-{{/*
- Calculate if we require a sidecar killer.
-*/}}
-{{- define "common.requireSidecarKiller" -}}
-{{- if (include "common.onServiceMesh" .) }}
-{{- if eq .Values.global.serviceMesh.engine "istio" }}
-{{- if not (default false .Values.global.serviceMesh.nativeSidecars) -}}
-true
-{{- end -}}
-{{- end -}}
-{{- end -}}
-{{- end -}}
-
-{{/*
- Kills the sidecar proxy associated with a pod.
-*/}}
-{{- define "common.serviceMesh.killSidecar" -}}
-{{- if (include "common.requireSidecarKiller" .) }}
-RCODE="$?";
-echo "*** script finished with exit code $RCODE" ;
-echo "*** killing service mesh sidecar" ;
-wget --quiet --post-data '' --output-document=- http://127.0.0.1:15020/quitquitquit || exit $? ;
-echo "" ;
-echo "*** exiting with script exit code" ;
-exit "$RCODE"
-{{- end }}
-{{- end -}}
-
-{{/*
- Wait for job container.
-*/}}
-{{- define "common.waitForJobContainer" -}}
-{{- $dot := default . .dot -}}
-{{- $wait_for_job_container := default $dot.Values.wait_for_job_container .wait_for_job_container -}}
-{{- if (include "common.requireSidecarKiller" .) }}
-- name: {{ include "common.name" $dot }}{{ ternary "" (printf "-%s" $wait_for_job_container.name) (empty $wait_for_job_container.name) }}-service-mesh-wait-for-job-container
- image: {{ include "repositoryGenerator.image.quitQuit" $dot }}
- imagePullPolicy: {{ $dot.Values.global.pullPolicy | default $dot.Values.pullPolicy }}
- command:
- - /bin/sh
- - "-c"
- args:
- - echo "waiting 10s for istio side cars to be up"; sleep 10s;
- {{- range $container := $wait_for_job_container.containers }}
- /app/ready.py --service-mesh-check {{ tpl $container $dot }} -t 45;
- {{- end }}
- env:
- - name: NAMESPACE
- valueFrom:
- fieldRef:
- apiVersion: v1
- fieldPath: metadata.namespace
- securityContext:
- capabilities:
- drop:
- - ALL
- - CAP_NET_RAW
- privileged: false
- readOnlyRootFilesystem: true
- allowPrivilegeEscalation: false
- runAsUser: 100
- runAsGroup: 65533
- resources:
- limits:
- cpu: 100m
- memory: 500Mi
- requests:
- cpu: 10m
- memory: 10Mi
-{{- end }}
-{{- end }}
-
{{/*
Use Authorization Policies or not.
*/}}
- /bin/sh
- -ec
- |
- {{- if include "common.onServiceMesh" . }}
- echo "waiting 15s for istio side cars to be up"; sleep 15s;{{- end }}
# Create users
export ETCDCTL_ENDPOINTS=http://${ETCD_HOST}:${ETCD_PORT}
export ETCDCTL_API=3
- name: KEY_PREFIX
value: "{{ .Values.config.keyPrefix }}"
resources: {{ include "common.resources" . | nindent 10 }}
- {{ include "common.waitForJobContainer" . | indent 6 | trim }}
{{- if .Values.nodeSelector }}
nodeSelector: {{ toYaml .Values.nodeSelector | nindent 10 }}
{{- end -}}
nameOverride: etcd-init
roles:
- read
-
-wait_for_job_container:
- containers:
- - '{{ include "common.name" . }}'
- /bin/sh
- -c
- |
- {{- if include "common.onServiceMesh" . }}
- echo "waiting 15s for istio side cars to be up"; sleep 15s;{{- end }}
/db_init/db_init.sh {{ if or .Values.dbScriptConfigMap .Values.dbScript }} &&
/db_config/db_cmd.sh{{ end }}
env:
mountPath: /db_config/
{{- end }}
resources: {{ include "common.resources" . | nindent 10 }}
- {{ include "common.waitForJobContainer" . | indent 6 | trim }}
{{- if .Values.nodeSelector }}
nodeSelector:
{{ toYaml .Values.nodeSelector | indent 10 }}
roles:
- read
-wait_for_job_container:
- containers:
- - '{{ include "common.name" . }}'
-
readinessCheck:
wait_for:
services:
export MONGODB_ROOT_PASSWORD=`prepare_password $MONGODB_ROOT_PASSWORD_INPUT`;
export MONGODB_USER=`prepare_password $MONGODB_USER_INPUT`;
export MONGODB_ROOT_USER=`prepare_password $MONGODB_ROOT_USER_INPUT`;
- {{- if include "common.onServiceMesh" . }}
- echo "waiting 15s for istio side cars to be up"; sleep 15s;
- {{- end }}
cd /config-input && for PFILE in `ls -1 .`; do envsubst <${PFILE} >/config/${PFILE}; done;
env:
- name: MONGODB_HOST
- mountPath: /config
name: mgconf
resources: {{ include "common.resources" . | nindent 10 }}
- {{ include "common.waitForJobContainer" . | indent 6 | trim }}
{{- if .Values.nodeSelector }}
nodeSelector:
{{ toYaml .Values.nodeSelector | indent 10 }}
services:
- '{{ .Values.global.mongodb.service.name }}'
-wait_for_job_container:
- containers:
- - '{{ include "common.name" . }}-setup-db'
-
# Annotations to control the execution and deletion of the job
# Can be used to delete a job before an Upgrade
#
}
export PG_PASSWORD=`prepare_password $PG_PASSWORD_INPUT`;
export PG_ROOT_PASSWORD=`prepare_password $PG_ROOT_PASSWORD_INPUT`;
- {{- if include "common.onServiceMesh" . }}
- echo "waiting 15s for istio side cars to be up"; sleep 15s;{{- end }}
cd /config-input && for PFILE in `ls -1 .`; do envsubst <${PFILE} >/config/${PFILE}; done;
psql "postgresql://postgres:$PG_ROOT_PASSWORD@$PG_HOST" < /config/setup.sql
env:
name: pgconf
resources: {{ include "common.resources" . | nindent 10 }}
{{ include "common.containerSecurityContext" . | indent 8 | trim }}
- {{ include "common.waitForJobContainer" . | indent 6 | trim }}
{{- if .Values.nodeSelector }}
nodeSelector:
{{ toYaml .Values.nodeSelector | indent 10 }}
services:
- '{{ .Values.global.postgres.service.name2 }}'
-wait_for_job_container:
- containers:
- - '{{ include "common.name" . }}-update-config'
-
# Annotations to control the execution and deletion of the job
# Can be used to delete a job before an Upgrade
#
value: {{ .Values.basicAuth.userPass }}
resources:
{{- toYaml .Values.resources_initContainer | nindent 12 }}
- {{ include "common.waitForJobContainer" . | indent 6 | trim }}
serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
volumes:
- name: {{ include "common.fullname" . }}-environments
services:
- sdc-be
-wait_for_job_container:
- containers:
- - '{{ include "common.name" . }}-job'
-
#Log configuration
log:
path: /var/log/onap
failureThreshold: {{ .Values.readiness.failureThreshold }}
{{ include "common.containerSecurityContext" . | indent 10 | trim }}
resources: {{ include "common.resources" . | nindent 12 }}
- {{ include "common.waitForJobContainer" . | indent 6 | trim }}
serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
volumes:
- name: {{ include "common.fullname" . }}-cassandra-db-scripts
roles:
- read
-wait_for_job_container:
- containers:
- - '{{ include "common.name" . }}-job'
-
# Resource Limit flavor -By Default using small
flavor: small
# Segregation for Different environment (Small and Large)
imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
{{- if include "common.onServiceMesh" . }}
args:
- - echo "waiting 10s for istio side cars to be up"; sleep 10s; /home/sdc/startup.sh
+ - /home/sdc/startup.sh
command:
- /bin/sh
- -c
successThreshold: {{ .Values.readiness.successThreshold }}
failureThreshold: {{ .Values.readiness.failureThreshold }}
{{ include "common.containerSecurityContext" . | indent 10 | trim }}
- {{ include "common.waitForJobContainer" . | indent 6 | trim }}
serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
volumes:
- name: {{ include "common.fullname" . }}-environments
roles:
- read
-wait_for_job_container:
- containers:
- - '{{ include "common.name" . }}-job'
-
readinessCheck:
wait_for:
timeout: 25
- name: CS_PASSWORD
valueFrom: {secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: sdc_password}}
resources: {{ include "common.resources" . | nindent 10 }}
- {{ include "common.waitForJobContainer" . | indent 6 | trim }}
serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
volumes:
- name: {{ include "common.fullname" . }}-cqlshrc
roles:
- read
-wait_for_job_container:
- containers:
- - '{{ include "common.name" . }}-job'
-
readinessCheck:
waitForSdcCs:
jobs:
- |
sleep 60; {{.Values.config.binDir }}/installSdncDb.sh
resources: {{ include "common.resources" . | nindent 10 }}
- {{- if include "common.onServiceMesh" . }}
- - name: sdnc-service-mesh-wait-for-job-container
- image: {{ include "repositoryGenerator.image.quitQuit" . }}
- imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
- command:
- - /bin/sh
- - "-c"
- args:
- - |
- echo "waiting 20s for istio side cars to be up"; sleep 20s;
- /app/ready.py --service-mesh-check sdnc -t 45;
- env:
- - name: NAMESPACE
- valueFrom:
- fieldRef:
- apiVersion: v1
- fieldPath: metadata.namespace
- {{- end }}
{{- if .Values.nodeSelector }}
nodeSelector: {{ toYaml .Values.nodeSelector | nindent 8 }}
{{- end }}
subPath: createSdnrDb.sh
{{- end }}
resources: {{ include "common.resources" . | nindent 10 }}
- {{- if include "common.onServiceMesh" . }}
- - name: sdnrdb-service-mesh-wait-for-job-container
- image: {{ include "repositoryGenerator.image.quitQuit" . }}
- imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
- command:
- - /bin/sh
- - "-c"
- args:
- - |
- echo "waiting 30s for istio side cars to be up"; sleep 30s;
- /app/ready.py --service-mesh-check sdnc-sdnrdb-init-job -t 45;
- env:
- - name: NAMESPACE
- valueFrom:
- fieldRef:
- apiVersion: v1
- fieldPath: metadata.namespace
- {{- end }}
{{- if .Values.nodeSelector }}
nodeSelector: {{ toYaml .Values.nodeSelector | nindent 10 }}
{{- end -}}
- /bin/bash
- -c
- |
- {{- if include "common.onServiceMesh" . }}
- echo "waiting 15s for istio side cars to be up"; sleep 15s;{{- end }}
mysqldump -vv --user=${DB_USER} --password=${DB_PASS} --host=${DB_HOST} --port=${DB_PORT} --databases --single-transaction --quick --lock-tables=false catalogdb requestdb nfvo cnfm > /var/data/mariadb/backup-`date +%s`.sql
volumeMounts:
- name: backup-storage
mountPath: /var/data/mariadb
- {{ include "common.waitForJobContainer" . | indent 6 | trim }}
serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
volumes:
- name: backup-storage
mountPath: /var/data/mariadb
{{- end }}
resources: {{ include "common.resources" . | nindent 10 }}
- {{ include "common.waitForJobContainer" . | indent 6 | trim }}
{{- if .Values.nodeSelector }}
nodeSelector:
{{ toYaml .Values.nodeSelector | indent 10 }}
roles:
- read
-wait_for_job_container:
- containers:
- - '{{ include "common.name" . }}-config'
-
readinessCheck:
wait_for:
services:
- name: init-data
mountPath: /aaa/init/intent-analysis-init.sql
subPath: intent-analysis-init.sql
- {{ include "common.waitForJobContainer" . | indent 6 | trim }}
{{- include "common.imagePullSecrets" . | nindent 6 }}
serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
volumes:
services:
- '{{ .Values.postgres.service.name2 }}'
-wait_for_job_container:
- containers:
- - '{{ include "common.name" . }}-job'
-
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
- name: init-data
mountPath: /aaa/init/llm-adaptation-init.sql
subPath: llm-adaptation-init.sql
- {{ include "common.waitForJobContainer" . | indent 6 | trim }}
{{- include "common.imagePullSecrets" . | nindent 6 }}
serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
volumes:
services:
- '{{ .Values.postgres.service.name2 }}'
-wait_for_job_container:
- containers:
- - '{{ include "common.name" . }}-job'
-
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
- name: init-data
mountPath: /aaa/init/postgres.sql
subPath: postgres.sql
- {{ include "common.waitForJobContainer" . | indent 6 | trim }}
{{- include "common.imagePullSecrets" . | nindent 6 }}
serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
volumes:
services:
- '{{ .Values.postgres.service.name2 }}'
-wait_for_job_container:
- containers:
- - '{{ include "common.name" . }}-job'
-
# Annotations to control the execution and deletion of the job
# Can be used to delete a job before an Upgrade
#