# Copyright © 2018 Amdocs # Copyright © 2018,2021 Bell Canada # Copyright © 2019 Samsung Electronics # Copyright © 2020 Bitnami, Orange # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. ################################################################# # Secrets metaconfig ################################################################# secrets: - uid: '{{ include "common.mariadb.secret.rootPassUID" . }}' type: password externalSecret: '{{ tpl (default "" .Values.rootUser.externalSecret) . }}' password: '{{ .Values.rootUser.password }}' - uid: '{{ include "common.mariadb.secret.userCredentialsUID" . }}' type: basicAuth externalSecret: '{{ tpl (default "" .Values.db.externalSecret) . }}' login: '{{ .Values.db.user }}' password: '{{ .Values.db.password }}' - uid: '{{ include "common.mariadb.secret.backupCredentialsUID" . }}' type: basicAuth externalSecret: '{{ tpl (default "" .Values.galera.mariabackup.externalSecret) . }}' login: '{{ .Values.galera.mariabackup.user }}' password: '{{ .Values.galera.mariabackup.password }}' # bitnami image doesn't support well single quote in password passwordStrengthOverride: basic ################################################################# # Global configuration defaults. ################################################################# global: nodePortPrefix: 302 persistence: mountPath: /dockerdata-nfs backup: mountPath: /dockerdata-nfs/backup clusterDomain: cluster.local metrics: {} image: bitnami/mariadb-galera:10.6.5-debian-10-r28 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images ## pullPolicy: Always ## Set to true if you would like to see extra information on logs ## It turns BASH debugging in minideb-extras-base ## debug: true ## Sometimes, especially when a lot of pods are created at the same time, ## actions performed on the databases are tried to be done before actual start. init_sleep_time: 5 ## String to partially override common.names.fullname template (will maintain the release name) ## nameOverride: mariadb-galera ## Use an alternate scheduler, e.g. "stork". ## ref: https://kubernetes.io/docs/tasks/administer-cluster/configure-multiple-schedulers/ ## # schedulerName: ## StatefulSet controller supports relax its ordering guarantees while preserving its uniqueness and identity guarantees. There are two valid pod management policies: OrderedReady and Parallel ## ref: https://kubernetes.io/docs/tutorials/stateful-application/basic-stateful-set/#pod-management-policy ## podManagementPolicy: OrderedReady ## MariaDB Gallera K8s svc properties ## service: ## Kubernetes service type and port number ## type: ClusterIP headless: {} internalPort: &dbPort 3306 ports: - name: mysql port: *dbPort headlessPorts: - name: galera port: 4567 - name: ist port: 4568 - name: sst port: 4444 ## Pods Service Account ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/ ## serviceAccount: nameOverride: mariadb-galera roles: - read ## Pod Security Context ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ ## securityContext: enabled: true user_id: 10001 group_id: 10001 ## Database credentials for root (admin) user ## rootUser: ## MariaDB admin user user: root ## MariaDB admin password ## Password is ignored if externalSecret is specified. ## If not set, password will be "randomly" generated ## ref: https://github.com/bitnami/bitnami-docker-mariadb-galera#setting-the-root-password-on-first-run ## # password: # externalSecret: ## Custom db configuration ## db: ## MariaDB username and password ## Password is ignored if externalSecret is specified. ## If not set, password will be "randomly" generated ## ref: https://github.com/bitnami/bitnami-docker-mariadb-galera#creating-a-database-user-on-first-run ## user: my-user # password: # externalSecret: ## Database to create ## ref: https://github.com/bitnami/bitnami-docker-mariadb-galera#creating-a-database-on-first-run ## # name: my_database ## Galera configuration ## galera: ## Galera cluster name ## name: galera ## Bootstraping options ## ref: https://github.com/bitnami/bitnami-docker-mariadb-galera#bootstraping bootstrap: ## Node to bootstrap from, you will need to change this parameter incase you want to bootstrap from other node ## bootstrapFromNode: ## Force safe_to_bootstrap in grastate.date file. ## This will set safe_to_bootstrap=1 in the node indicated by bootstrapFromNode. forceSafeToBootstrap: false ## Credentials to perform backups ## mariabackup: ## MariaBackup username and password ## Password is ignored if externalSecret is specified. ## If not set, password will be "randomly" generated ## ref: https://github.com/bitnami/bitnami-docker-mariadb-galera#setting-up-a-multi-master-cluster ## user: mariabackup # password: # externalSecret: backup: enabled: false cron: "00 00 * * *" retentionPeriod: 3 persistence: ## If true, use a Persistent Volume Claim, If false, use emptyDir ## enabled: true # Enable persistence using an existing PVC # existingClaim: ## selector can be used to match an existing PersistentVolume ## selector: ## matchLabels: ## app: my-app selector: {} ## Persistent Volume Storage Class ## If defined, storageClassName: ## If set to "-", storageClassName: "", which disables dynamic provisioning ## If undefined (the default) or set to null, no storageClassName spec is ## set, choosing the default provisioner. (gp2 on AWS, standard on ## GKE, AWS & OpenStack) ## # storageClass: "-" ## Persistent Volume Claim annotations ## annotations: ## Persistent Volume Access Mode ## accessMode: ReadWriteOnce ## Persistent Volume size ## size: 2Gi readinessCheck: wait_for: - '{{ include "common.name" . }}' ## TLS configuration ## tls: ## Enable TLS ## enab
#!/bin/bash
#
# Copyright 2017 ZTE Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Place the scripts in run order:
# Start all process required for executing test case

#login to the onap nexus docker repo
docker login -u docker -p docker nexus3.onap.org:10001

# start msb
docker run -d -p 8500:8500 --name msb_consul consul:0.9.3
CONSUL_IP=`get-instance-ip.sh msb_consul`
echo CONSUL_IP=${CONSUL_IP}

docker run -d -p 10081:10081 -e CONSUL_IP=$CONSUL_IP --name msb_discovery nexus3.onap.org:10001/onap/msb/msb_discovery
DISCOVERY_IP=`get-instance-ip.sh msb_discovery`
echo DISCOVERY_IP=${DISCOVERY_IP}

docker run -d -p 80:80 -e CONSUL_IP=$CONSUL_IP -e SDCLIENT_IP=$DISCOVERY_IP -e "ROUTE_LABELS=visualRange:1" --name msb_internal_apigateway nexus3.onap.org:10001/onap/msb/msb_apigateway
MSB_IP==`get-instance-ip.sh msb_internal_apigateway`
echo MSB_IP=${MSB_IP}

# Wait for initialization(8500 Consul, 10081 Service Registration & Discovery, 80 api gateway)
for i in {1..10}; do
    curl -sS -m 1 ${CONSUL_IP}:8500 && curl -sS -m 1 ${DISCOVERY_IP}:10081 && curl -sS -m 1 ${MSB_IP}:80 && break
    echo sleep $i
    sleep $i
done

# Need some time so service info can be synced from discovery to api gateway
echo sleep 60
sleep 60

# start vfc-catalog
docker run -d --name vfc-catalog -v /var/lib/mysql -e MSB_ADDR=${DISCOVERY_IP}:10081 nexus3.onap.org:10001/onap/vfc/catalog
CATALOG_IP=`get-instance-ip.sh vfc-catalog`
for i in {1..10}; do
    curl -sS -m 1 ${CATALOG_IP}:8806 && break
    echo sleep $i
    sleep $i
done

# Pass any variables required by Robot test suites in ROBOT_VARIABLES
ROBOT_VARIABLES="-v MSB_IP:${MSB_IP} -v CATALOG_IP:${CATALOG_IP} -v MSB_DISCOVERY_IP:${DISCOVERY_IP}"
ed as a template ## relabelings: [] ## MetricRelabelConfigs to apply to samples before ingestion ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#relabelconfig ## Value is evalued as a template ## metricRelabelings: [] # - sourceLabels: # - "__name__" # targetLabel: "__name__" # action: replace # regex: '(.*)' # replacement: 'example_prefix_$1' ## Prometheus Operator PrometheusRule configuration ## prometheusRules: enabled: false ## Additional labels to add to the PrometheusRule so it is picked up by the operator. ## If using the [Helm Chart](https://github.com/helm/charts/tree/master/stable/prometheus-operator) this is the name of the Helm release and 'app: prometheus-operator' selector: app: prometheus-operator release: prometheus ## Rules as a map. rules: {} # - alert: MariaDB-Down # annotations: # message: 'MariaDB instance {{ $labels.instance }} is down' # summary: MariaDB instance is down # expr: absent(up{job="mariadb-galera"} == 1) # labels: # severity: warning # service: mariadb-galera # for: 5m