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

I can follow manual instructions to build and install validating webhooks #4

Closed
matt-royal opened this issue Aug 16, 2021 · 4 comments

Comments

@matt-royal
Copy link
Member

matt-royal commented Aug 16, 2021

Blockers

Acceptance Criteria

GIVEN that I am targeting a k8s cluster
WHEN I read the README for this repo
THEN I see manual instructions for building an image for the validating web hook app and for installing it into my cluster
WHEN I follow those instructions
AND I create or modify a CFApp record in the k8s API
THEN I see log entries in the running validating web hook app that confirm it was called for the new or modified record
AND the record creation or modification should succeed 

NOTE: At his point the validating web hooks aren't ever rejecting updates, but they are properly wired in so they can do so in future stories

Dev Notes

For this story the webhook just needs to be running and wired into the k8s API. It will approve all requests. Also there is no behavior to test, so we can wait on writing specs

Register this webhook to handle CFApp resources only. We will add additional endpoints for other resources in the future.

This code should live in this repository. Also, the webhook server will also handle mutation in the future, not just validation

If we aren't able to configure the app to run insecurely, then do a one-off solution. For example, we could assume that the cert is in a secret and provide an example one to bootstrap the app, with the intention of properly generating it in the future. We'll solve the certificate generation issue properly in a follow-up story

@matt-royal
Copy link
Member Author

Last minute addition: we also want to add a MutatingAdmissionWebhook as part of this work, along with a dedicated no-op mutation endpoint. Similarly, we'll want to ensure that the logs for that endpoint reflect that it's being called when objects as created

@matt-royal
Copy link
Member Author

matt-royal commented Aug 24, 2021

Task list:

  • Run the kubebuilder command to add webhooks for CFApp
  • Deploy code and ensure the webhooks work

@matt-royal
Copy link
Member Author

@akrishna90 pointed out that the kubebuilder cli can wire up webhooks for you, so we ran it:

kubebuilder create webhook --group workloads --version v1alpha1 --kind CFApp --defaulting --programmatic-validation

This generated all the code and yaml files needed. We also need to uncomment lines related to WEBHOOKS and CERTMANAGER in config/crd/kustomization.yaml and config/default/kustomization.yaml.

Finally, to deploy to our cluster we ran...

IMG=relintdockerhubpushbot/cf-k8s-controllers:add-webhooks make generate manifests docker-build docker-push install deploy

At the moment this is failing. We'll pick it up tomorrow. Our WIP is on the branch issues/4, but all of it can be regenerated by following the steps above

@matt-royal
Copy link
Member Author

We decided to hold off on converting the Ginkgo test setup that kubebuilder generates to be spec setup instead. Once we actually start writing tests we'll solve that problem.

Birdrock added a commit that referenced this issue Oct 29, 2021
FEAT: Implement GET /v3/apps/:guid

- Implements the /v3/apps/:guid endpoint for fetching CFApp CRs
  - NOTE: This endpoint is using a static rest.Config for provisioning
  its Kubernetes API client and is not yet using user-provided auth
  - We expect this will need to be updated after some of the stories in
  https://github.com/cloudfoundry/cf-k8s-api/labels/Authentication
  implement that
- Vendors in CRDs from cf-k8s-controllers for use by envtest integration
tests
- Update Github workflow to run `make test` so that it has the binaries needed for `envtest`
- Add `.envrc` to set `KUBEBUILDER_ASSETS` for running `envtest` tests without `make`
- Resolves #4 

Co-authored-by: Andrew Costa <ancosta@vmware.com>
Co-authored-by: Tim Downey <tdowney@vmware.com>
Co-authored-by: Andrew Wittrock <awittrock@vmware.com>
Co-authored-by: Ashwin Krishna <krishnaas@vmware.com>
Birdrock pushed a commit that referenced this issue Oct 29, 2021
DOC: Various README updates

Addresses issues with #1 and #4
crdant referenced this issue in crdant/korifi Jun 29, 2023
TL;DR
-----

Implements preflight checks to check pre-requisitions

Details
-------

Enables preflight checks to the Helm chart. Checks are provided by
[Troubleshoot](https://troubleshoot.sh) and implemented as a secret
within the Helm chart so they can be pulled from the Replicated Platform
to run before instllation.

Checks for the following:

* A currently suppored version of Kubernetes
* The containerd runtime
* If a specific Kubernetes distribution is running. This check will not
  fail and is not tied to any dependencies in the upstream application.
* Sufficient CPU resources allocatable on the cluster. This not the same
  as the reosurces being available to request in the cluster.
* Required memory allocatable on the cluster. This not the same as the
  reosurces being available to request in the cluster.
* Cert manager installed.
* kpack installed.
* Contour installed.
* Metrics Server installed and ready.
* A service bindings controller implementation. This check will not fail
  since service bindings are optional.
georgethebeatle pushed a commit that referenced this issue May 2, 2024
* fix missing ServiceOffering fields

* adjust fields
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

1 participant