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

Integration development environment #67

Merged
merged 9 commits into from
Sep 18, 2024
Merged

Conversation

adam-cattermole
Copy link
Member

@adam-cattermole adam-cattermole commented Aug 15, 2024

Added new make commands to:

  • Deploy kind cluster with the wasm_shim compile target mapped as a volume
  • Install authorino-operator
  • Deploy authorino + certs based on TLS_ENABLED
  • Deploy limitador
  • Deploy envoyproxy with the local volume mapped
  • Deploys talker-api
  • Deploys simple authconfig and secret for the API key user-guide

To deploy all of the above:

make local-setup

Cleanup:

make local-cleanup

To test changes to the wasm binary you can simply run the following to redeploy in the cluster:

make build local-rollout

To watch the envoy + wasm logs:

kubectl logs -f deployment/envoy

To test the API:

kubectl port-forward --namespace default deployment/envoy 8000:8000
curl -H "Host: test.a.auth.com" http://127.0.0.1:8000/get -i
curl -H "Host: test.a.rlp.com" http://127.0.0.1:8000/get -i
curl -H "Host: test.b.rlp.com" http://127.0.0.1:8000/get -i
curl -H "Host: test.c.rlp.com" -H "x-forwarded-for: 127.0.0.1" -H "My-Custom-Header-01: my-custom-header-value-01" -H "x-dyn-user-id: bob" http://127.0.0.1:8000/get -i
make local-cleanup

Copy link

gitguardian bot commented Aug 15, 2024

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
13357796 Triggered Generic High Entropy Secret 8dd4c97 utils/deploy/authconfig.yaml View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

envoy.yaml: |
static_resources:
clusters:
- name: authorino_wasm
Copy link
Member Author

Choose a reason for hiding this comment

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

When this cluster is named authorino I am unable to reach it from within the shim so for now it is named authorino_wasm - todo: investigate why this is the case

Copy link
Member Author

Choose a reason for hiding this comment

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

I haven't had a chance to figure this one out yet, still somewhat curious but I don't think it's urgent

@adam-cattermole adam-cattermole changed the base branch from main to external-auth August 22, 2024 13:15
@adam-cattermole adam-cattermole marked this pull request as ready for review August 22, 2024 13:15
@eguzki eguzki added the enhancement New feature or request label Aug 27, 2024
Copy link
Contributor

@eguzki eguzki left a comment

Choose a reason for hiding this comment

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

Overall looks good.

  • Documentation is needed
  • I like the docker-compose environment, looks like more lightweight and quicker to work with. However, with authorino, due to it's complexity, and being a k8s controller, docker-compose is no longer an option. Should we keep both environments? any thoughts on this?

- role: control-plane
image: kindest/node:v1.30.0
extraMounts:
- hostPath: $(WASM_PATH)
Copy link
Contributor

Choose a reason for hiding this comment

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

this file is a template, which is rendered with the right wasm path. This adds some (minor) extra complexity.

Have you considered volume source being a secret which could be easier to manage and monitor?

Copy link
Member Author

@adam-cattermole adam-cattermole Aug 28, 2024

Choose a reason for hiding this comment

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

My idea was to reduce the number of changes required to iterate as developing - so a simple rebuild using make build has generated a new file in the kind cluster (it still needs reloading so a make local-rollout is also needed).

That being said it's still pretty simple to re-create the secret each time we rebuild so I'm not tied to one approach or the other. If you prefer the secret I can look into it

@adam-cattermole
Copy link
Member Author

@eguzki agreed, will look to add all the docs on using this.

I like the docker-compose environment, looks like more lightweight and quicker to work with. However, with authorino, due to it's complexity, and being a k8s controller, docker-compose is no longer an option. Should we keep both environments? any thoughts on this?

I was also unsure on this one - I agree docker-compose is a good lightweight alternative for limitador only, but then again two different dev environments might have differences which make it hard to spot issues. I think that whether we remove the docker-compose or not I'll leave it to a future PR outside of this one though.

@eguzki
Copy link
Contributor

eguzki commented Sep 17, 2024

@adam-cattermole The PR includes some commits not related to the integration development environment. Not sure that is intended or not.

Regarding the integration development environment, I think it needs few more iterations, but we can polish it in following up PR's. LGTM.

@adam-cattermole
Copy link
Member Author

@eguzki Oh you're right, it's diverged from base branch, let me rebase again

Copy link
Contributor

@didierofrivia didierofrivia left a comment

Choose a reason for hiding this comment

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

🆒

@adam-cattermole adam-cattermole merged commit 40ce002 into external-auth Sep 18, 2024
8 checks passed
@adam-cattermole adam-cattermole deleted the auth-dev-env branch September 18, 2024 15:51
@didierofrivia didierofrivia mentioned this pull request Oct 1, 2024
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants