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

Add Open Policy Agent (OPA) to Kubernetes cluster #1

Closed
wants to merge 7 commits into from

Conversation

mitchellhuang
Copy link
Owner

@mitchellhuang mitchellhuang commented Jul 12, 2020

Description

  • Add Open Policy Agent (OPA) admission controller to the Kubernetes (k8s) cluster installed by Tectonic.
  • I tried to be as modular as possible, for example, re-using the Terraform tls module to generate OPA self-signed certs.

Submission

Notes

  • I assumed that by installing OPA, we meant the full OPA admission controller.
  • I assumed that we wanted the k8s manifests in HCL instead of YAML so I used the Terraform Kubernetes provider.
  • Looks like there is a bug with the Terraform k8s provider which causes Terraform to dial the k8s cluster during a terraform plan when specifying kubernetes_namespace so I have submitted my terraform plan without namespace.tf

Update 2020-07-14

I've identified two critical issues with my PR:

  1. I did not implement the last step of the OPA admission controller documentation: the ValidatingWebhookConfiguration CRD. I have solved this by actually adding this step to the pull request (ha): 5c21bf9 09453ea

  2. OPA was sharing the same CA with the Tectonic control panel. Because of how OPA works, I assume we either want to create an independent CA for OPA or use a user provided CA for OPA. I have gone ahead and added those variables to config.tf, and if they are not supplied, they will be auto-generated, similar to tls/kube/self-signed: 3bf71b8

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.

1 participant