Skip to content
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

feat: add debug prep scripts and configuration for server #1104

Merged
merged 7 commits into from
Dec 22, 2023

Conversation

tommartensen
Copy link
Contributor

@tommartensen tommartensen commented Dec 15, 2023

See README for usage.

Please test it before approving!
You can use gcloud container clusters get-credentials infra-pr-1104 --zone us-central1-a --project acs-team-temp-dev to point to a cluster with workflow controller and secrets prepared.

@tommartensen tommartensen self-assigned this Dec 15, 2023
@rhacs-bot
Copy link
Contributor

rhacs-bot commented Dec 15, 2023

A single node development cluster (infra-pr-1104) was allocated in production infra for this PR.

CI will attempt to deploy us.gcr.io/stackrox-infra/infra-server:0.8.8-9-g2bf3ef3d69 to it.

🔌 You can connect to this cluster with:

gcloud container clusters get-credentials infra-pr-1104 --zone us-central1-a --project acs-team-temp-dev

🛠️ And pull infractl from the deployed dev infra-server with:

nohup kubectl -n infra port-forward svc/infra-server-service 8443:8443 &
make pull-infractl-from-dev-server

🚲 You can then use the dev infra instance e.g.:

bin/infractl -k -e localhost:8443 whoami

⚠️ Any clusters that you start using your dev infra instance should have a lifespan shorter then the development cluster instance. Otherwise they will not be destroyed when the dev infra instance ceases to exist when the development cluster is deleted. ⚠️

Further Development

☕ If you make changes, you can commit and push and CI will take care of updating the development cluster.

🚀 If you only modify configuration (chart/infra-server/configuration) or templates (chart/infra-server/{static,templates}), you can get a faster update with:

make install-local

Logs

Logs for the development infra depending on your @redhat.com authuser:

Or:

kubectl -n infra logs -l app=infra-server --tail=1 -f

@tommartensen tommartensen marked this pull request as ready for review December 15, 2023 13:02
@tommartensen tommartensen requested a review from a team as a code owner December 15, 2023 13:02
Copy link
Contributor

@gavin-stackrox gavin-stackrox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm looking forward to trying this out for my next PR. If someone else gets to try it out before merge that is great but otherwise I'd say :shipit:

To debug the server, you need to fulfil the prerequisites first.

1. Have an authenticated `gcloud` CLI.
1. Have your `KUBECONFIG` point to a cluster where Argo Workflows and the ConfigMaps and Secrets for infra are deployed. This is most easily achieved by connecting to a PR cluster or deploying infra with `ENVIRONMENT=<DEVELOPMENT,PRODUCTION> make install-argo clean-argo-config helm-deploy` to a new or local cluster. This cluster will only be used to run workflows.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about the infra-server deployment? I'm guessing this needs to be deleted so as not to conflict with the local dev server.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No it doesn't have to be deleted. infra-server is stateless and all data is in Argo workflow K8s objects.
The point is that you can use the local debugging server against any existing infra cluster, ie also against dev & prod if you want to debug a bug 🐛

Copy link
Contributor

@davdhacs davdhacs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm with tweaks to the prepare.sh

scripts/local-dev/prepare.sh Show resolved Hide resolved
@tommartensen tommartensen merged commit a2cb69d into master Dec 22, 2023
7 checks passed
@tommartensen tommartensen deleted the tm/add-debug-server branch December 22, 2023 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants