diff --git a/vkpr/devportal/install/src/unix/formula/formula.sh b/vkpr/devportal/install/src/unix/formula/formula.sh index 9c65b11f..cb91b233 100755 --- a/vkpr/devportal/install/src/unix/formula/formula.sh +++ b/vkpr/devportal/install/src/unix/formula/formula.sh @@ -30,8 +30,16 @@ formulaInputs() { checkGlobalConfig "$VKPR_ENV_GLOBAL_INGRESS_CLASS_NAME" "$VKPR_ENV_GLOBAL_INGRESS_CLASS_NAME" "devportal.ingressClassName" "DEVPORTAL_INGRESS_CLASS_NAME" checkGlobalConfig "$VKPR_ENV_GLOBAL_NAMESPACE" "$VKPR_ENV_GLOBAL_NAMESPACE" "devportal.namespace" "DEVPORTAL_NAMESPACE" checkGlobalConfig "$PROVIDER" "" "devportal.provider" "CATALOG_PROVIDER" -} + checkGlobalConfig "$GIT_BRANCH" "" ".catalog.providers.branch" "GIT_BRANCH" + checkGlobalConfig "$GIT_REPO" "" ".catalog.providers.repository" "GIT_REPO" + checkGlobalConfig "$GITHUB_CLIENT_ID" "" ".auth.providers.github.clientId" "GITHUB_CLIENT_ID" + checkGlobalConfig "$GITHUB_CLIENT_SECRET" "" ".auth.providers.github.clientSecret" "GITHUB_CLIENT_SECRET" + checkGlobalConfig "$GITHUB_TOKEN" "" ".integrations.github.token" "GITHUB_TOKEN" + checkGlobalConfig "$GITHUB_ORGANIZATION" "" ".catalog.providers.repository" "GITHUB_ORGANIZATION" + checkGlobalConfig "$CLIENT_GROUPS" "" ".catalog.providers.gitlab.group" "CLIENT_GROUPS" + checkGlobalConfig "$GITLAB_TOKEN" "" ".integrations.gitlab.token" "GITLAB_TOKEN" +} validateInputs() { validateDevportalDomain "$VKPR_ENV_GLOBAL_DOMAIN" validateDevportalSecure "$VKPR_ENV_GLOBAL_SECURE" @@ -68,21 +76,21 @@ settingDevportal(){ github) YQ_VALUES="$YQ_VALUES | del(.catalog.providers.gitlab) | - .auth.providers.github.clientId = \"$GITHUB_CLIENT_ID\" | - .auth.providers.github.clientSecret = \"$GITHUB_CLIENT_SECRET\" | - .integrations.github.token = \"$GITHUB_TOKEN\" | - .catalog.providers.github.organization = \"$CLIENT_ORGANIZATION\" | - .catalog.providers.github.filters.repository = \"$GIT_REPO\" | - .catalog.providers.github.filters.branch = \"$GIT_BRANCH\" + .auth.providers.github.clientId = \"$VKPR_ENV_GITHUB_CLIENT_ID\" | + .auth.providers.github.clientSecret = \"$VKPR_ENV_GITHUB_CLIENT_SECRET\" | + .integrations.github.token = \"$VKPR_ENV_GITHUB_TOKEN\" | + .catalog.providers.github.organization = \"$VKPR_ENV_CLIENT_ORGANIZATION\" | + .catalog.providers.github.filters.repository = \"$VKPR_ENV_GIT_REPO\" | + .catalog.providers.github.filters.branch = \"$VKPR_ENV_GIT_BRANCH\" " ;; gitlab) YQ_VALUES="$YQ_VALUES | del(.catalog.providers.github) | - .integrations.gitlab.token = \"$GITLAB_TOKEN\" | - .catalog.providers.gitlab.group = \"$CLIENT_GROUPS\" | - .catalog.providers.gitlab.projectPattern = \"$GIT_REPO\" | - .catalog.providers.gitlab.branch = \"$GIT_BRANCH\" + .integrations.gitlab.token = \"$VKPR_ENV_GITLAB_TOKEN\" | + .catalog.providers.gitlab.group= \"$$VKPR_ENV_CLIENT_GROUPS\" | + .catalog.providers.gitlab.projectPattern = \"$VKPR_ENV_GIT_REPO\" | + .catalog.providers.gitlab.branch = \"$VKPR_ENV_GIT_BRANCH\" " ;; *) diff --git a/vkpr/jaeger/install/src/unix/formula/formula.sh b/vkpr/jaeger/install/src/unix/formula/formula.sh index d02bea79..ecd533df 100755 --- a/vkpr/jaeger/install/src/unix/formula/formula.sh +++ b/vkpr/jaeger/install/src/unix/formula/formula.sh @@ -8,7 +8,9 @@ runFormula() { VKPR_ENV_JAEGER_DOMAIN="jaeger.${VKPR_ENV_GLOBAL_DOMAIN}" VKPR_JAEGER_VALUES=$(dirname "$0")/utils/jaeger.yaml - VKPR_JAEGER_DATASOURCE=$(dirname "$0")/utils/datasource.json + VKPR_JAEGER_DATASOURCE=$(dirname "$0")/utils/prometheus-stack-kube-prom-grafana-datasource.yaml + #VKPR_JAEGER_DATASOURCE=$(dirname "$0")/utils/datasource.json + startInfos settingJaeger @@ -63,10 +65,13 @@ settingJaeger() { .allInOne.ingress.ingressClassName = \"$VKPR_ENV_JAEGER_INGRESS_CLASS_NAME\" " if [[ "$VKPR_ENV_JAEGER_METRICS" == true ]] && [[ $(checkPodName "$VKPR_ENV_GRAFANA_NAMESPACE" "prometheus-stack-grafana") == "true" ]]; then - DATASOURCE_URL="http://jaeger-query.$VKPR_ENV_JAEGER_NAMESPACE:16686/" - $VKPR_JQ ".url = \"$DATASOURCE_URL\"" $VKPR_JAEGER_DATASOURCE > tmp.json - cat tmp.json > $VKPR_JAEGER_DATASOURCE && rm tmp.json - createGrafanaDatasource "$VKPR_JAEGER_DATASOURCE" "$VKPR_ENV_GRAFANA_NAMESPACE" + $VKPR_KUBECTL apply -f "$VKPR_JAEGER_DATASOURCE" -n "$VKPR_ENV_JAEGER_NAMESPACE" + + + # DATASOURCE_URL="jaeger-query.$VKPR_ENV_JAEGER_NAMESPACE:16686/" + # $VKPR_JQ ".url = \"$DATASOURCE_URL\"" $VKPR_JAEGER_DATASOURCE > tmp.json + # cat tmp.json > $VKPR_JAEGER_DATASOURCE && rm tmp.json + # createGrafanaDatasource "$VKPR_JAEGER_DATASOURCE" "$VKPR_ENV_GRAFANA_NAMESPACE" # createGrafanaDashboard "$(dirname "$0")/utils/dashboard.json" "$VKPR_ENV_GRAFANA_NAMESPACE" # YQ_VALUES="$YQ_VALUES | diff --git a/vkpr/jaeger/install/src/utils/prometheus-stack-kube-prom-grafana-datasource.yaml b/vkpr/jaeger/install/src/utils/prometheus-stack-kube-prom-grafana-datasource.yaml new file mode 100644 index 00000000..018015af --- /dev/null +++ b/vkpr/jaeger/install/src/utils/prometheus-stack-kube-prom-grafana-datasource.yaml @@ -0,0 +1,51 @@ +apiVersion: v1 +data: + datasource.yaml: |- + apiVersion: 1 + datasources: + - name: Prometheus + type: prometheus + uid: prometheus + url: http://prometheus-stack-kube-prom-prometheus.vkpr:9090 + access: proxy + isDefault: true + jsonData: + httpMethod: POST + timeInterval: 10s + - access: proxy + basicAuth: false + editable: true + isDefault: false + name: Loki + type: loki + uid: loki + url: http://loki.vkpr:3100 + version: 1 + - name: Jaeger + type: jaeger + uid: jaeger + access: http + url: http://jaeger-query.vkpr:16686 + isDefault: false + version: 1 + editable: true + basicAuth: false +kind: ConfigMap +metadata: + annotations: + meta.helm.sh/release-name: prometheus-stack + meta.helm.sh/release-namespace: vkpr + creationTimestamp: "2023-09-25T15:50:01Z" + labels: + app: kube-prometheus-stack-grafana + app.kubernetes.io/instance: prometheus-stack + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/part-of: kube-prometheus-stack + app.kubernetes.io/version: 45.20.0 + chart: kube-prometheus-stack-45.20.0 + grafana_datasource: "1" + heritage: Helm + release: prometheus-stack + name: prometheus-stack-kube-prom-grafana-datasource + namespace: vkpr + diff --git a/vkpr/otel/install/config.json b/vkpr/otel/install/config.json index d8d61c24..c5e94ea8 100644 --- a/vkpr/otel/install/config.json +++ b/vkpr/otel/install/config.json @@ -24,6 +24,19 @@ "false" ] }, + { + "tutorial": "Instrumentation namespace aplication", + "condition": { + "variable": "otel_auto", + "operator": "==", + "value": "true" + }, + "label": "Instrumentation Namespace Aplication ?", + "name": "INSTRUMENTATION_NAMESPACE", + "type": "text", + "required": true, + "default": "vkpr" + }, { "tutorial": "Simulate an install", "label": "Dry-run ?", diff --git a/vkpr/otel/install/src/unix/formula/formula.sh b/vkpr/otel/install/src/unix/formula/formula.sh index 15fdd521..d800614c 100755 --- a/vkpr/otel/install/src/unix/formula/formula.sh +++ b/vkpr/otel/install/src/unix/formula/formula.sh @@ -26,7 +26,7 @@ runFormula() { fi if [[ "$VKPR_ENV_OTEL_AUTO" == true ]]; then - $VKPR_KUBECTL apply -f "$VKPR_INSTRUMENTATION" -n "$VKPR_ENV_OTEL_NAMESPACE" + $VKPR_KUBECTL apply -f "$VKPR_INSTRUMENTATION" -n "$VKPR_ENV_INSTRUMENTATION_NAMESPACE" fi } @@ -38,12 +38,14 @@ startInfos() { boldNotice "Namespace: $VKPR_ENV_OTEL_NAMESPACE" boldNotice "Trace: $VKPR_ENV_TRACE" boldNotice "Auto Instrumentation: $VKPR_ENV_OTEL_AUTO" + boldNotice "Instrumentation Namespace: $VKPR_ENV_INSTRUMENTATION_NAMESPACE" bold "==============================" } formulaInputs() { # App values checkGlobalConfig "$VKPR_ENV_GLOBAL_NAMESPACE" "$VKPR_ENV_GLOBAL_NAMESPACE" "otel.namespace" "OTEL_NAMESPACE" + checkGlobalConfig "$INSTRUMENTATION_NAMESPACE" "$VKPR_ENV_GLOBAL_NAMESPACE" "otel.instrumentation" "INSTRUMENTATION_NAMESPACE" checkGlobalConfig "$OTEL_AUTO" "true" "otel.auto.enable" "OTEL_AUTO" checkGlobalConfig "$TRACE" "jaeger" "otel.trace" "TRACE" } diff --git a/vkpr/prometheus-stack/install/src/utils/prometheus-stack.yaml b/vkpr/prometheus-stack/install/src/utils/prometheus-stack.yaml index 24ae1007..dd5a735e 100644 --- a/vkpr/prometheus-stack/install/src/utils/prometheus-stack.yaml +++ b/vkpr/prometheus-stack/install/src/utils/prometheus-stack.yaml @@ -41,3 +41,4 @@ prometheusOperator: enabled: true prometheus: enabled: true +