-
Notifications
You must be signed in to change notification settings - Fork 113
Remove accesstoken from DVO endpoint access #694
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
3a8afa6
56e5ab2
6afcf16
788d8c9
c26c074
3d1b49c
03bcfd7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 56243bd0598738bea9eb26bc6260df023a414063 | ||
| f94ee72e7bb0b6c7ad60262874b000cda3cc45d3 |
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -15,7 +15,7 @@ do | |||||||||||
| echo "example: ${0##} \$CONTEXT" | ||||||||||||
| echo | ||||||||||||
| exit 1 | ||||||||||||
| fi | ||||||||||||
| fi | ||||||||||||
| done | ||||||||||||
|
|
||||||||||||
| OC=$(which oc) | ||||||||||||
|
|
@@ -32,6 +32,8 @@ then | |||||||||||
| sudo -- sh -c "echo 127.0.0.1 prometheus-k8s.openshift-monitoring.svc.cluster.local alertmanager-main.openshift-monitoring.svc.cluster.local >> /etc/hosts" | ||||||||||||
| fi | ||||||||||||
|
|
||||||||||||
| # Setup prometheus and alertmanager port-forwards | ||||||||||||
| # Setup prometheus, alertmanager and DVO metrics port-forwards. | ||||||||||||
| # Note: DVO metrics port 53083 can be chaned to any local port avaiable. If changed, make sure to include the correct port when run | ||||||||||||
| while true; do $OC port-forward -n openshift-monitoring svc/prometheus-k8s 9091:9091;done & | ||||||||||||
| while true; do $OC port-forward -n openshift-monitoring svc/alertmanager-main 9094:9094;done & | ||||||||||||
| while true; do $OC port-forward -n openshift-monitoring svc/alertmanager-main 9094:9094;done & | ||||||||||||
| while true; do $OC port-forward -n openshift-deployment-validation-operator svc/deployment-validation-operator-metrics 53083:8383;done & | ||||||||||||
|
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. 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win Add retry backoff to the DVO port-forward loop. If Proposed retry backoff-while true; do $OC port-forward -n openshift-deployment-validation-operator svc/deployment-validation-operator-metrics 53083:8383;done &
+while true; do
+ $OC port-forward -n openshift-deployment-validation-operator svc/deployment-validation-operator-metrics 53083:8383
+ sleep 1
+done &📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -157,15 +157,15 @@ Regardless of how you choose to run the operator, before doing so ensure the `Up | |||||||||||||||||||
| $ oc create -f deploy/crds/upgrade.managed.openshift.io_upgradeconfigs_crd.yaml | ||||||||||||||||||||
| ``` | ||||||||||||||||||||
|
|
||||||||||||||||||||
| MUO by defaults uses in the internal services to contact prometheus and alertmanager. This enables the use of a firewall to prevent egress calls however increases local development complexity slightly. | ||||||||||||||||||||
| MUO by defaults uses in the internal services to contact prometheus and alertmanager. This enables the use of a firewall to prevent egress calls however increases local development complexity slightly. | ||||||||||||||||||||
|
|
||||||||||||||||||||
| There are now three main modes that MUO can be ran in. | ||||||||||||||||||||
| There are now three main modes that MUO can be ran in. | ||||||||||||||||||||
|
|
||||||||||||||||||||
| 1. Run in a container in cluster. | ||||||||||||||||||||
| 2. Run locally using port-forwards and `/etc/hosts` entries to replicate production environment. | ||||||||||||||||||||
| 3. Run locally using Routes to access services. This is not true production however is the most simple for local development. | ||||||||||||||||||||
| 1. Run in a container in cluster. | ||||||||||||||||||||
| 2. Run locally using port-forwards and `/etc/hosts` entries to replicate production environment. | ||||||||||||||||||||
| 3. Run locally using Routes to access services. This is not true production however is the most simple for local development. | ||||||||||||||||||||
|
|
||||||||||||||||||||
| Modes 2 and 3 can be executed via the `Makefile` optionally setting the `$OPERATOR_NAMESPACE` as explored in the next section. | ||||||||||||||||||||
| Modes 2 and 3 can be executed via the `Makefile` optionally setting the `$OPERATOR_NAMESPACE` as explored in the next section. | ||||||||||||||||||||
|
|
||||||||||||||||||||
| ``` | ||||||||||||||||||||
| run Wrapper around operator sdk run. Requires OPERATOR_NAMESPACE to be set. See run-standard for defaults. | ||||||||||||||||||||
|
|
@@ -204,7 +204,7 @@ example: ./development/port-forwards $CONTEXT | |||||||||||||||||||
| $ ./development/port-forwards $CONTEXT | ||||||||||||||||||||
| ``` | ||||||||||||||||||||
|
|
||||||||||||||||||||
| The operator can then be ran as follows. | ||||||||||||||||||||
| The operator can then be ran as follows. | ||||||||||||||||||||
|
|
||||||||||||||||||||
| ``` | ||||||||||||||||||||
| $ oc login $(oc get infrastructures cluster -o json | jq -r '.status.apiServerURL') --token $(oc -n openshift-managed-upgrade-operator serviceaccounts get-token managed-upgrade-operator) | ||||||||||||||||||||
|
|
@@ -213,29 +213,36 @@ Logged into "https://$API_URL:6443" as "system:serviceaccount:openshift-managed- | |||||||||||||||||||
|
|
||||||||||||||||||||
| You don't have any projects. Contact your system administrator to request a project. | ||||||||||||||||||||
| ``` | ||||||||||||||||||||
| Note: | ||||||||||||||||||||
| > You might need to remove the webhook _sre-regular-user-validation_ | ||||||||||||||||||||
| ```oc delete validatingwebhookconfigurations sre-regular-user-validation``` \ | ||||||||||||||||||||
| > For local run of MUO via `make run`, it's expected that DVO_SVC_URL is set, after port-forwarding DVO metrics service \ | ||||||||||||||||||||
| >>e.g. port-forward command: `oc port-forward svc/deployment-validation-operator-metrics 53083:8383 -n openshift-deployment-validation-operator` \ | ||||||||||||||||||||
| >>e.g. dvoSVCULR: 127.0.0.1:53083 | ||||||||||||||||||||
|
Comment on lines
+219
to
+221
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. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win Correct the environment-variable name in the example. The note uses Proposed fix->>e.g. dvoSVCULR: 127.0.0.1:53083
+>>e.g. DVO_SVC_URL: 127.0.0.1:53083📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||
|
|
||||||||||||||||||||
| Then if you are using the standard namespace | ||||||||||||||||||||
|
|
||||||||||||||||||||
| ``` | ||||||||||||||||||||
|
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. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win Add language tags to the new shell blocks. The new fences at Lines 225 and 233 omit a language identifier and trigger markdownlint MD040. Mark both fences as Proposed fix-```
+```shell-```
+```shellAlso applies to: 233-233 🧰 Tools🪛 markdownlint-cli2 (0.23.2)[warning] 225-225: Fenced code blocks should have a language specified (MD040, fenced-code-language) 🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||||||||||||||||||||
| $ make run-standard | ||||||||||||||||||||
| export DVO_SVC_URL="127.0.0.1:53083" | ||||||||||||||||||||
| make run | ||||||||||||||||||||
| ``` | ||||||||||||||||||||
|
Comment on lines
223
to
228
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 | 🟡 Minor | ⚡ Quick win Set Line 171 states that Proposed fix export DVO_SVC_URL="127.0.0.1:53083"
+export OPERATOR_NAMESPACE="openshift-managed-upgrade-operator"
make run📝 Committable suggestion
Suggested change
🧰 Tools🪛 markdownlint-cli2 (0.23.2)[warning] 225-225: Fenced code blocks should have a language specified (MD040, fenced-code-language) 🤖 Prompt for AI Agents |
||||||||||||||||||||
|
|
||||||||||||||||||||
| Else you can provide your own. | ||||||||||||||||||||
| Else you can provide your own. | ||||||||||||||||||||
|
|
||||||||||||||||||||
|
|
||||||||||||||||||||
| ``` | ||||||||||||||||||||
| $ OPERATOR_NAMESPACE=managed-upgrade-operator make run | ||||||||||||||||||||
| OPERATOR_NAMESPACE="openshift-managed-upgrade-operator-test" WATCH_NAMESPACE="" DVO_SVC_URL="127.0.0.1:53083" go run ./main.go | ||||||||||||||||||||
|
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 | 🟡 Minor | ⚡ Quick win Use a namespace that the instructions create. The earlier setup creates As per coding guidelines, Use the documented namespace-OPERATOR_NAMESPACE="openshift-managed-upgrade-operator-test" WATCH_NAMESPACE="" DVO_SVC_URL="127.0.0.1:53083" go run ./main.go
+OPERATOR_NAMESPACE="test-managed-upgrade-operator" WATCH_NAMESPACE="" DVO_SVC_URL="127.0.0.1:53083" go run ./main.go📝 Committable suggestion
Suggested change
🤖 Prompt for AI AgentsSource: Coding guidelines |
||||||||||||||||||||
| ``` | ||||||||||||||||||||
|
|
||||||||||||||||||||
| ### Run using cluster routes | ||||||||||||||||||||
|
|
||||||||||||||||||||
| Run locally using standard namespace and cluster routes. | ||||||||||||||||||||
| Run locally using standard namespace and cluster routes. | ||||||||||||||||||||
|
|
||||||||||||||||||||
| ``` | ||||||||||||||||||||
| $ make run-standard-routes | ||||||||||||||||||||
| ``` | ||||||||||||||||||||
|
|
||||||||||||||||||||
| Run locally using custom namespace and cluster routes. | ||||||||||||||||||||
| Run locally using custom namespace and cluster routes. | ||||||||||||||||||||
|
|
||||||||||||||||||||
| ``` | ||||||||||||||||||||
| $ OPERATOR_NAMESPACE=managed-upgrade-operator make run-routes | ||||||||||||||||||||
|
|
@@ -255,8 +262,8 @@ $ make docker-build IMG=quay.io/<QUAY_USERNAME>/managed-upgrade-operator:latest | |||||||||||||||||||
| podman push quay.io/<QUAY_USERNAME>/managed-upgrade-operator:latest | ||||||||||||||||||||
| ``` | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - Login to `oc` [as admin](https://github.com/openshift/ops-sop/blob/master/v4/howto/break-glass-kubeadmin.md#for-clusters-with-public-api) | ||||||||||||||||||||
| - Login to `oc` [as admin](https://github.com/openshift/ops-sop/blob/master/v4/howto/break-glass-kubeadmin.md#for-clusters-with-public-api) | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - Ensure no other instances of managed-upgrade-operator are actively running on your cluster, as they may conflict. If MUO is already deployed on the cluster scale the deployment down to 0: | ||||||||||||||||||||
|
|
||||||||||||||||||||
| ```shell | ||||||||||||||||||||
|
|
@@ -341,12 +348,12 @@ $ oc apply -f test/deploy/upgrade.managed.openshift.io_v1alpha1_upgradeconfig_cr | |||||||||||||||||||
|
|
||||||||||||||||||||
| ```shell | ||||||||||||||||||||
| oc get upgrade -n test-managed-upgrade-operator | ||||||||||||||||||||
| ``` | ||||||||||||||||||||
| ``` | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - Inspect `upgradeConfig`: | ||||||||||||||||||||
|
|
||||||||||||||||||||
| ```shell | ||||||||||||||||||||
| oc describe upgrade -n test-managed-upgrade-operator managed-upgrade-config | ||||||||||||||||||||
| oc describe upgrade -n test-managed-upgrade-operator managed-upgrade-config | ||||||||||||||||||||
| ``` | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - It can be useful to monitor the events in `test-managed-upgrade-operator` namespace during the upgrade: | ||||||||||||||||||||
|
|
@@ -396,4 +403,4 @@ python hack/maintenance-update.py | |||||||||||||||||||
|
|
||||||||||||||||||||
| # To update deps to a specific Openshift release | ||||||||||||||||||||
| python hack/maintenance-update.py --release release-4.19 | ||||||||||||||||||||
| ``` | ||||||||||||||||||||
| ``` | ||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.