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

RS-574: Deploy dev infra to the PR development cluster #711

Merged
merged 17 commits into from
Oct 10, 2022

Conversation

gavin-stackrox
Copy link
Contributor

@gavin-stackrox gavin-stackrox commented Oct 6, 2022

#710 creates the cluster and this PR is a follow up to deploy PR changes to this development cluster. It is more involved than it might have been because I wanted to avoid the creation of local configuration with opaque secrets when deploying with CI.

The main change in order to avoid local filesystem writes was to consolidate all the credential files under chart/infra-server/configuration/{development,production} into helm values files that can be piped to template rendering.

Testing Performed

A qa-demo cluster with a private rhacs-eng image:

bin/infractl -k -e localhost:8443 create qa-demo gj-20221007-2 --arg main-image=quay.io/rhacs-eng/main:3.72.x-253-g49e0fb76dc --wait --lifespan=1h

An osd-gcp cluster:

bin/infractl -k -e localhost:8443 create osd-on-gcp gj-20221007-osdgcp --wait --lifespan=2h

@ghost
Copy link

ghost commented Oct 6, 2022

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

CI will attempt to deploy us.gcr.io/stackrox-infra/infra-server:0.4.0-22-g694d32f7c3 to it.

🔌 You can connect to this cluster with:

gcloud container clusters get-credentials infra-pr-711 --zone us-central1-a --project srox-temp-dev-test

🛠️ 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 local-data-dev-cycle

@gavin-stackrox gavin-stackrox force-pushed the gavin/RS-574/render-via-env branch from 5a67a23 to 578c647 Compare October 6, 2022 23:45
@gavin-stackrox gavin-stackrox force-pushed the gavin/RS-574/render-via-env branch from f00f4f5 to f2ab1a6 Compare October 7, 2022 18:40
@gavin-stackrox gavin-stackrox changed the title RS-574: Install from bucket to cluster RS-574: Deploy dev infra to the PR development cluster Oct 7, 2022
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
The comment formatting is a nit.

scripts/add-PR-comment-for-deploy-to-dev.sh Outdated Show resolved Hide resolved
gcloud auth activate-service-account --key-file <(echo "$GOOGLE_APPLICATION_CREDENTIALS")
gcloud auth list

export KUBECONFIG=artifacts/kubeconfig
Copy link
Contributor

Choose a reason for hiding this comment

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

You might consider setting this env var in line 93.

Copy link
Contributor

@tommartensen tommartensen left a comment

Choose a reason for hiding this comment

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

LGTM, one small hint about env var.

Base automatically changed from gavin/RS-574/deploy-dev-infra to master October 10, 2022 17:25
@gavin-stackrox gavin-stackrox force-pushed the gavin/RS-574/render-via-env branch from 3bf6977 to 694d32f Compare October 10, 2022 17:27
@gavin-stackrox gavin-stackrox merged commit d260ba3 into master Oct 10, 2022
@gavin-stackrox gavin-stackrox deleted the gavin/RS-574/render-via-env branch October 10, 2022 17:52
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