#deploys osm pods and services
function deploy_osm_services() {
[ -z "${DEBUG_INSTALL}" ] || DEBUG beginning of function
- # helm is already installed as part of install_kubeadm_cluster.sh
-
# Generate helm values to be passed with -f osm-values.yaml
sudo mkdir -p ${OSM_HELM_WORK_DIR}
if [ -n "${INSTALL_JUJU}" ]; then
#deploy mongodb
function deploy_mongodb() {
[ -z "${DEBUG_INSTALL}" ] || DEBUG beginning of function
- MONGO_OPTS="-d ${OSM_HELM_WORK_DIR} -D ${OSM_DEVOPS} -t ${OSM_DOCKER_TAG} -U ${DOCKER_USER} ${DEBUG_INSTALL}"
+ MONGO_OPTS="-d ${OSM_HELM_WORK_DIR} -D ${OSM_DEVOPS} -s ${OSM_NAMESPACE} -t ${OSM_DOCKER_TAG} -U ${DOCKER_USER} ${DEBUG_INSTALL}"
[ -n "${DOCKER_REGISTRY_URL}" ] && MONGO_OPTS="${MONGO_OPTS} -r ${DOCKER_REGISTRY_URL}"
$OSM_DEVOPS/installers/install_mongodb.sh ${MONGO_OPTS} || \
FATAL_TRACK install_osm_mongodb_service "install_mongodb.sh failed"
function install_osm_ngsa_service() {
[ -z "${DEBUG_INSTALL}" ] || DEBUG beginning of function
- NGSA_OPTS="-i ${OSM_DEFAULT_IP} -d ${OSM_HELM_WORK_DIR} -D ${OSM_DEVOPS} -t ${OSM_DOCKER_TAG} -U ${DOCKER_USER} ${DEBUG_INSTALL}"
+ NGSA_OPTS="-i ${OSM_DEFAULT_IP} -d ${OSM_HELM_WORK_DIR} -D ${OSM_DEVOPS} -s ${OSM_NAMESPACE} -t ${OSM_DOCKER_TAG} -U ${DOCKER_USER} ${DEBUG_INSTALL}"
[ -n "${DOCKER_REGISTRY_URL}" ] && NGSA_OPTS="${NGSA_OPTS} -r ${DOCKER_REGISTRY_URL}"
$OSM_DEVOPS/installers/install_ngsa.sh ${NGSA_OPTS} || \
FATAL_TRACK install_osm_ngsa_service "install_ngsa.sh failed"
function install_k8s_monitoring() {
[ -z "${DEBUG_INSTALL}" ] || DEBUG beginning of function
# install OSM monitoring
- sudo chmod +x $OSM_DEVOPS/installers/k8s/*.sh
- sudo $OSM_DEVOPS/installers/k8s/install_osm_k8s_monitoring.sh || FATAL_TRACK install_k8s_monitoring "k8s/install_osm_k8s_monitoring.sh failed"
+ sudo $OSM_DEVOPS/installers/k8s/install_osm_k8s_monitoring.sh -o ${OSM_NAMESPACE} || FATAL_TRACK install_k8s_monitoring "k8s/install_osm_k8s_monitoring.sh failed"
[ -z "${DEBUG_INSTALL}" ] || DEBUG end of function
}
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update
- helm upgrade mongodb-k8s bitnami/mongodb -n osm --create-namespace --install -f ${OSM_HELM_WORK_DIR}/mongodb-values.yaml --version ${MONGODB_HELM_VERSION} --timeout 10m || FATAL_TRACK mongodb "Failed installing mongodb helm chart"
+ helm upgrade mongodb-k8s bitnami/mongodb -n ${OSM_NAMESPACE} --create-namespace --install -f ${OSM_HELM_WORK_DIR}/mongodb-values.yaml --version ${MONGODB_HELM_VERSION} --timeout 10m || FATAL_TRACK mongodb "Failed installing mongodb helm chart"
[ -z "${DEBUG_INSTALL}" ] || DEBUG end of function
}
OSM_DEVOPS="/usr/share/osm-devops"
OSM_DOCKER_TAG="testing-daily"
OSM_HELM_WORK_DIR="/etc/osm/helm"
+OSM_NAMESPACE="osm"
-while getopts ":D:d:t:r:U:-: " o; do
+while getopts ":D:d:s:t:r:U:-: " o; do
case "${o}" in
D)
OSM_DEVOPS="${OPTARG}"
d)
OSM_HELM_WORK_DIR="${OPTARG}"
;;
+ s)
+ OSM_NAMESPACE="${OPTARG}"
+ ;;
t)
OSM_DOCKER_TAG="${OPTARG}"
;;
echo "OSM_DEVOPS=$OSM_DEVOPS"
echo "OSM_DOCKER_TAG=$OSM_DOCKER_TAG"
echo "OSM_HELM_WORK_DIR=$OSM_HELM_WORK_DIR"
+echo "OSM_NAMESPACE=$OSM_NAMESPACE"
install_mongodb
helm repo add apache-airflow https://airflow.apache.org
helm repo update
- helm upgrade airflow apache-airflow/airflow -n osm --create-namespace --install -f ${OSM_HELM_WORK_DIR}/airflow-values.yaml --version ${AIRFLOW_HELM_VERSION} --timeout 10m || FATAL_TRACK ngsa "Failed installing airflow helm chart"
+ helm upgrade airflow apache-airflow/airflow -n ${OSM_NAMESPACE} --create-namespace --install -f ${OSM_HELM_WORK_DIR}/airflow-values.yaml --version ${AIRFLOW_HELM_VERSION} --timeout 10m || FATAL_TRACK ngsa "Failed installing airflow helm chart"
[ -z "${DEBUG_INSTALL}" ] || DEBUG end of function
}
OSM_DEVOPS="/usr/share/osm-devops"
OSM_DOCKER_TAG="testing-daily"
OSM_HELM_WORK_DIR="/etc/osm/helm"
+OSM_NAMESPACE="osm"
DEFAULT_IP="127.0.0.1"
-while getopts ":D:d:i:t:r:U:-: " o; do
+while getopts ":D:d:i:s:t:r:U:-: " o; do
case "${o}" in
i)
DEFAULT_IP="${OPTARG}"
d)
OSM_HELM_WORK_DIR="${OPTARG}"
;;
+ s)
+ OSM_NAMESPACE="${OPTARG}"
+ ;;
t)
OSM_DOCKER_TAG="${OPTARG}"
;;
echo "OSM_DEVOPS=$OSM_DEVOPS"
echo "OSM_DOCKER_TAG=$OSM_DOCKER_TAG"
echo "OSM_HELM_WORK_DIR=$OSM_HELM_WORK_DIR"
+echo "OSM_NAMESPACE=$OSM_NAMESPACE"
install_airflow
track deploy_osm airflow_ok
echo -e "usage: $0 [OPTIONS]"
echo -e "Install OSM Monitoring"
echo -e " OPTIONS"
- echo -e " -n <namespace> : use specified kubernetes namespace - default: monitoring"
+ echo -e " -n <namespace> : namespace to deploy k8s cluster monitoring - default: monitoring"
+ echo -e " -o <osm_namespace> : namespace where OSM is installed - default: osm"
echo -e " -s <service_type>: service type (ClusterIP|NodePort|LoadBalancer) - default: NodePort"
echo -e " --debug : debug script"
echo -e " --dump : dump arguments and versions"
}
NAMESPACE=monitoring
+OSM_NAMESPACE=osm
HELM=""
DEBUG=""
DUMP_VARS=""
SERVICE_TYPE=""
-while getopts ":h-:n:s:" o; do
+while getopts ":h-:n:o:s:" o; do
case "${o}" in
h)
usage && exit 0
n)
NAMESPACE="${OPTARG}"
;;
-
+ o)
+ OSM_NAMESPACE="${OPTARG}"
+ ;;
s)
SERVICE_TYPE="${OPTARG}"
;;
-
-)
[ "${OPTARG}" == "help" ] && usage && exit 0
[ "${OPTARG}" == "debug" ] && DEBUG="y" && continue
function dump_vars(){
echo "Args...."
echo "NAMESPACE=$NAMESPACE"
+ echo "OSM_NAMESPACE=$OSM_NAMESPACE"
echo "SERVICE_TYPE=$SERVICE_TYPE"
echo "DEBUG=$DEBUG"
echo "Versions...."
# Mysql
# exporter
echo "Creating prometheus-community/prometheus-mysql-exporter"
-helm install osm-mysql-exporter --namespace $NAMESPACE --version=$V_MYSQL_EXPORTER --set serviceMonitor.enabled=true,serviceMonitor.additionalLabels.release=osm-monitoring,mysql.user="root",mysql.pass=`kubectl -n osm get secret ro-db-secret -o yaml | grep -i -A1 '^data:$' | grep MYSQL_ROOT_PASSWORD | awk '{print $2}' | base64 -d`,mysql.host="mysql.osm",mysql.port="3306",'collectors.info_schema\.tables=true' prometheus-community/prometheus-mysql-exporter
+helm install osm-mysql-exporter --namespace $NAMESPACE --version=$V_MYSQL_EXPORTER --set serviceMonitor.enabled=true,serviceMonitor.additionalLabels.release=osm-monitoring,mysql.user="root",mysql.pass=`kubectl -n ${OSM_NAMESPACE} get secret ro-db-secret -o yaml | grep -i -A1 '^data:$' | grep MYSQL_ROOT_PASSWORD | awk '{print $2}' | base64 -d`,mysql.host="mysql.osm",mysql.port="3306",'collectors.info_schema\.tables=true' prometheus-community/prometheus-mysql-exporter
#dashboard:
kubectl -n $NAMESPACE apply -f $HERE/mysql-exporter-dashboard.yaml
# Kafka