-
Notifications
You must be signed in to change notification settings - Fork 63
OU-1389: update devspace setup #1073
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| echo "Applying UIPlugin CR 'monitoring'..." | ||
| kubectl apply -f - <<EOF | ||
| apiVersion: observability.openshift.io/v1alpha1 | ||
| kind: UIPlugin | ||
| metadata: | ||
| name: monitoring | ||
| namespace: openshift-cluster-observability-operator | ||
| spec: | ||
| type: Monitoring | ||
| monitoring: | ||
| perses: | ||
| enabled: true | ||
| clusterHealthAnalyzer: | ||
| enabled: true | ||
| acm: | ||
| enabled: true | ||
| alertmanager: | ||
| url: "https://alertmanager.open-cluster-management-observability.svc:9095" | ||
| thanosQuerier: | ||
| url: "https://rbac-query-proxy.open-cluster-management-observability.svc:8443" | ||
| EOF | ||
|
|
||
| echo "Waiting for monitoring deployment to become available..." | ||
| kubectl rollout status deployment/monitoring \ | ||
| -n openshift-cluster-observability-operator \ | ||
| --timeout=300s |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| echo "Checking if COO is already installed..." | ||
| if kubectl get deployment -n openshift-cluster-observability-operator observability-operator \ | ||
| >/dev/null 2>&1; then | ||
| echo "COO is already installed, skipping." | ||
| exit 0 | ||
| fi | ||
|
|
||
| echo "Creating namespace openshift-cluster-observability-operator..." | ||
| kubectl create namespace openshift-cluster-observability-operator --dry-run=client -o yaml | kubectl apply -f - | ||
|
|
||
| echo "Creating OperatorGroup..." | ||
| kubectl apply -f - <<EOF | ||
| apiVersion: operators.coreos.com/v1 | ||
| kind: OperatorGroup | ||
| metadata: | ||
| name: observability-operator-group | ||
| namespace: openshift-cluster-observability-operator | ||
| spec: {} | ||
| EOF | ||
|
|
||
| echo "Creating Subscription..." | ||
| kubectl apply -f - <<EOF | ||
| apiVersion: operators.coreos.com/v1alpha1 | ||
| kind: Subscription | ||
| metadata: | ||
| name: cluster-observability-operator | ||
| namespace: openshift-cluster-observability-operator | ||
| spec: | ||
| channel: fast | ||
| name: cluster-observability-operator | ||
| source: redhat-operators | ||
| sourceNamespace: openshift-marketplace | ||
| EOF | ||
|
|
||
| echo "Waiting for COO CSV to reach Succeeded phase (timeout 5m)..." | ||
| SECONDS_ELAPSED=0 | ||
| until \ | ||
| CSV_NAME=$(kubectl get csv -n openshift-cluster-observability-operator \ | ||
| -o jsonpath='{.items[?(@.spec.displayName=="Cluster Observability Operator")].metadata.name}' \ | ||
| 2>/dev/null) && \ | ||
| [[ -n "${CSV_NAME}" ]] && \ | ||
| kubectl get csv -n openshift-cluster-observability-operator "${CSV_NAME}" \ | ||
| -o jsonpath='{.status.phase}' 2>/dev/null | grep -q "^Succeeded$"; do | ||
| if [[ ${SECONDS_ELAPSED} -ge 300 ]]; then | ||
| echo "ERROR: Timed out waiting for COO CSV to succeed." | ||
| exit 1 | ||
| fi | ||
| sleep 5 | ||
| SECONDS_ELAPSED=$((SECONDS_ELAPSED + 5)) | ||
| echo " Waiting... (${SECONDS_ELAPSED}s / 300s)" | ||
| done | ||
|
|
||
| echo "COO installed successfully." |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| echo "Patching ClusterVersion to disable CMO management of monitoring-plugin..." | ||
| oc patch clusterversion version --type json \ | ||
| -p "$(cat ./web/cypress/fixtures/cmo/disable-monitoring.yaml)" | ||
|
|
||
| echo "Scaling down cluster-monitoring-operator in openshift-monitoring..." | ||
| kubectl scale --replicas=0 -n openshift-monitoring deployment/cluster-monitoring-operator | ||
|
PeterYurkovich marked this conversation as resolved.
|
||
|
|
||
| echo "Waiting for cluster-monitoring-operator to scale down..." | ||
| kubectl rollout status deployment/cluster-monitoring-operator \ | ||
| -n openshift-monitoring \ | ||
| --timeout=120s | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| echo "Scaling down observability-operator..." | ||
| kubectl scale --replicas=0 -n openshift-cluster-observability-operator deployment/observability-operator | ||
|
|
||
| echo "Waiting for observability-operator to scale down..." | ||
| kubectl rollout status deployment/observability-operator \ | ||
| -n openshift-cluster-observability-operator \ | ||
| --timeout=120s | ||
|
|
||
| echo "Re-enabling monitoring-console-plugin in Console..." | ||
| # COO removes the plugin from the Console when scaled down — add it back so the | ||
| # devspace container is reachable from the Console frontend. | ||
| PLUGINS=$(oc get console.operator.openshift.io cluster -o jsonpath='{.spec.plugins}' 2>/dev/null) | ||
| if [[ -z "${PLUGINS}" ]]; then | ||
| oc patch console.operator.openshift.io cluster --type=json \ | ||
| -p '[{"op":"add","path":"/spec/plugins","value":["monitoring-console-plugin"]}]' | ||
| elif ! echo "${PLUGINS}" | grep -q "monitoring-console-plugin"; then | ||
| oc patch console.operator.openshift.io cluster --type=json \ | ||
| -p '[{"op":"add","path":"/spec/plugins/-","value":"monitoring-console-plugin"}]' | ||
| else | ||
| echo "monitoring-console-plugin already enabled in Console, skipping." | ||
| fi |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| echo "Restoring ClusterVersion to re-enable CMO management of monitoring-plugin..." | ||
| oc patch clusterversion version --type json \ | ||
| -p '[{"op": "remove", "path": "/spec/overrides"}]' | ||
|
PeterYurkovich marked this conversation as resolved.
|
||
|
|
||
| echo "Scaling up cluster-monitoring-operator in openshift-monitoring..." | ||
| kubectl scale --replicas=1 -n openshift-monitoring deployment/cluster-monitoring-operator | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| echo "Scaling up observability-operator..." | ||
| kubectl scale --replicas=1 -n openshift-cluster-observability-operator deployment/observability-operator |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,7 +6,7 @@ CONSOLE_IMAGE=${CONSOLE_IMAGE:="quay.io/openshift/origin-console:latest"} | |
| CONSOLE_PORT=${CONSOLE_PORT:=9000} | ||
| PLUGIN_PORT=${PLUGIN_PORT:=9443} | ||
| CONSOLE_IMAGE_PLATFORM=${CONSOLE_IMAGE_PLATFORM:="linux/amd64"} | ||
| npm_package_consolePlugin_name=${npm_package_consolePlugin_name:="monitoring-plugin"} | ||
| npm_package_consolePlugin_name=${CONSOLE_PLUGIN_NAME:-"monitoring-plugin"} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win Keep proxy routing consistent with the selected plugin. When 🤖 Prompt for AI Agents |
||
|
|
||
| echo "Starting local OpenShift console..." | ||
|
|
||
|
|
@@ -19,7 +19,7 @@ BRIDGE_K8S_MODE_OFF_CLUSTER_THANOS=$(oc -n openshift-config-managed get configma | |
| BRIDGE_K8S_MODE_OFF_CLUSTER_ALERTMANAGER=$(oc -n openshift-config-managed get configmap monitoring-shared-config -o jsonpath='{.data.alertmanagerPublicURL}') | ||
| BRIDGE_K8S_AUTH_BEARER_TOKEN=$(oc whoami --show-token 2>/dev/null) | ||
| BRIDGE_USER_SETTINGS_LOCATION="localstorage" | ||
| BRIDGE_I18N_NAMESPACES=plugin__monitoring-plugin | ||
| BRIDGE_I18N_NAMESPACES="plugin__${npm_package_consolePlugin_name}" | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| echo "API Server: $BRIDGE_K8S_MODE_OFF_CLUSTER_ENDPOINT" | ||
| echo "Console Image: $CONSOLE_IMAGE" | ||
|
|
||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we set the I18N_NAMESPACE here as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The initial answer to this was no due to the naming of our translation files, but you helped me realize that we can actually improve our build process more. The initial change in the webpack config that this PR contained already performed the first of 2 actions that the
update-plugin-name.shscript performed, and I added the second as well. Now rather than need to run that script before building themonitoring-console-pluginin our dockerfiles we can just set the ENV variable and let webpack take over handling itI've also combined the two ENV variable to just the CONSOLE_PLUGIN_NAME and have the old usage of I18N_NAMESPACE in the webpack file be constructed from the CONSOLE_PLUGIN_NAME.
When we create the next konflux update including these changes we will need to remove the script running and just pass in the ENV