Deploy Kubernetes operators as docker containers for Mock server. #224
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR enhances our capabilities for mocking and deploying in Kubernetes. It introduces new operators and providers to simulate a more realistic environment, enabling the deployment of complex resources via CRDs.
What's New
In addition to the noop-provider (used to provision fake PVCs), we are now deploying:
Context & Impact
Previously, certain resources could not be simulated in full. With these additions, the manually deployed container can now successfully interact with the mock server to create resources defined by operators.
Example Use Case:
We can now deploy a MongoDB instance using the standard CRDs from the Mongo operator within our mock environment:
In the image: mongodb-kubernetes-operator-679c97777-kxl4z is the fake operator, which is incapable of doing anything because it is fake, but given that we have the operator container running from the docker-compose, it was able to deploy the fake sts of MongoDB.
For future reference, each operator requires a distinct configuratino, overall, the easier way is to set the environment variables
KUBERNETES_MASTERandKUBECONFIG, but some operators, like mongo, require extra environment variables to work. The easier way is to describe the pod generation and just copy the environment into the Docker Compose.