-
Notifications
You must be signed in to change notification settings - Fork 1
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
Kubernetes Mock API #17
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pavsaund
suggested changes
Dec 7, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems straight-forward enough. Could you have a look at my comments and see if they make sense?
The problem with the squigglies are related to this: |
pavsaund
approved these changes
Dec 8, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR introduces a mock for "just enough" of the Kubernetes API. Meaning, for now the 2 routes we need (namespaces + pods). On the returned data, there is also just enough what we need to be able to get the initial stories completed.
How to run it
The environment is now updated to redirect '/api/v1' to the K8sMock. Restart the environment for this if already running.
The K8sMock needs to be running to be able to use this, so
yarn start
in the K8sMock folder.With this, one can now go to the GraphQL endpoint and perform the Applications query and get data:
Swagger
The K8sMock service exposes a Swagger endpoint at
http://localhost:3001/api/swagger/
. Navigate to it and try out:Mock Data
The data being returned sits in
pods.json
in thepods
folder next to thePodsController
in the K8sMock project and innamespaces
in thenamespaces
folder next to theNamespacesController
in the K8sMock project.Next Steps
With the PodsController in the K8sMock already producing data, the natural next step is to use this.
I suggest creating a new object that combines the Application and its Microservices as an array on it. Something like 'ApplicationsForListing' or similar and then a query for this purpose. In the future this is what we would project to as well.