diff --git a/deploy.sh b/deploy.sh index 46b576ce6914c30d2bc439a8e8ae1465a3b0a6da..472b59753637925008462be7d0ef9cb005f355d8 100755 --- a/deploy.sh +++ b/deploy.sh @@ -202,12 +202,12 @@ if [[ "$TFS_COMPONENTS" == *"webui"* ]] && [[ "$TFS_COMPONENTS" == *"monitoring" echo "Configuring WebUI DataStores and Dashboards..." sleep 3 - INFLUXDB_HOST="monitoringservice" - INFLUXDB_PORT=$(kubectl --namespace $TFS_K8S_NAMESPACE get service/monitoringservice -o jsonpath='{.spec.ports[?(@.name=="influxdb")].port}') - INFLUXDB_URL="http://${INFLUXDB_HOST}:${INFLUXDB_PORT}" - INFLUXDB_USER=$(kubectl --namespace $TFS_K8S_NAMESPACE get secrets influxdb-secrets -o jsonpath='{.data.INFLUXDB_ADMIN_USER}' | base64 --decode) - INFLUXDB_PASSWORD=$(kubectl --namespace $TFS_K8S_NAMESPACE get secrets influxdb-secrets -o jsonpath='{.data.INFLUXDB_ADMIN_PASSWORD}' | base64 --decode) - INFLUXDB_DATABASE=$(kubectl --namespace $TFS_K8S_NAMESPACE get secrets influxdb-secrets -o jsonpath='{.data.INFLUXDB_DB}' | base64 --decode) + # INFLUXDB_HOST="monitoringservice" + # INFLUXDB_PORT=$(kubectl --namespace $TFS_K8S_NAMESPACE get service/monitoringservice -o jsonpath='{.spec.ports[?(@.name=="influxdb")].port}') + # INFLUXDB_URL="http://${INFLUXDB_HOST}:${INFLUXDB_PORT}" + # INFLUXDB_USER=$(kubectl --namespace $TFS_K8S_NAMESPACE get secrets influxdb-secrets -o jsonpath='{.data.INFLUXDB_ADMIN_USER}' | base64 --decode) + # INFLUXDB_PASSWORD=$(kubectl --namespace $TFS_K8S_NAMESPACE get secrets influxdb-secrets -o jsonpath='{.data.INFLUXDB_ADMIN_PASSWORD}' | base64 --decode) + # INFLUXDB_DATABASE=$(kubectl --namespace $TFS_K8S_NAMESPACE get secrets influxdb-secrets -o jsonpath='{.data.INFLUXDB_DB}' | base64 --decode) # Exposed through the ingress controller "tfs-ingress" GRAFANA_HOSTNAME="127.0.0.1" @@ -235,18 +235,18 @@ if [[ "$TFS_COMPONENTS" == *"webui"* ]] && [[ "$TFS_COMPONENTS" == *"monitoring" }' ${GRAFANA_URL_DEFAULT}/api/user/password echo - # Create InfluxDB DataSource # Ref: https://grafana.com/docs/grafana/latest/http_api/data_source/ - curl -X POST -H "Content-Type: application/json" -d '{ - "type" : "influxdb", - "name" : "InfluxDB", - "url" : "'"$INFLUXDB_URL"'", + # TODO: replace user, password and database by variables to be saved + echo "Creating a datasource..." + curl -X POST -H "Content-Type: application/json" -H "Accept: application/json" -d '{ + "type" : "postgres", + "name" : "monitoringdb", "access" : "proxy", - "basicAuth": false, - "user" : "'"$INFLUXDB_USER"'", - "password" : "'"$INFLUXDB_PASSWORD"'", + "user" : "admin", + "password" : "quest", "isDefault": true, - "database" : "'"$INFLUXDB_DATABASE"'" + "database" : "qdb", + "sslmode" :"disable" }' ${GRAFANA_URL_UPDATED}/api/datasources echo diff --git a/my_deploy.sh b/my_deploy.sh index 032408565f67b6b46834eaa301b78d699d4fe88b..67a2e0558c25d767e14b635e6dd9174433827156 100644 --- a/my_deploy.sh +++ b/my_deploy.sh @@ -1,5 +1,5 @@ # Set the URL of your local Docker registry where the images will be uploaded to. -export TFS_REGISTRY_IMAGE="" # http://localhost:32000/tfs/ +export TFS_REGISTRY_IMAGE="http://localhost:32000/tfs/" # Set the list of components, separated by comas, you want to build images for, and deploy. # Supported components are: @@ -16,7 +16,7 @@ export TFS_IMAGE_TAG="dev" export TFS_K8S_NAMESPACE="tfs" # Set additional manifest files to be applied after the deployment -export TFS_EXTRA_MANIFESTS="" # manifests/nginx_ingress_http.yaml +export TFS_EXTRA_MANIFESTS="manifests/nginx_ingress_http.yaml" # Set the neew Grafana admin password export TFS_GRAFANA_PASSWORD="admin123+"