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

Kubernetes Mock API #17

Merged
merged 10 commits into from
Dec 8, 2020
Merged

Kubernetes Mock API #17

merged 10 commits into from
Dec 8, 2020

Conversation

einari
Copy link
Contributor

@einari einari commented Dec 7, 2020

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:

image

Swagger

The K8sMock service exposes a Swagger endpoint at http://localhost:3001/api/swagger/. Navigate to it and try out:
image

Mock Data

The data being returned sits in pods.json in the pods folder next to the PodsController in the K8sMock project and in namespaces in the namespaces folder next to the NamespacesController 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.

@einari einari requested a review from pavsaund December 7, 2020 19:26
@einari einari changed the base branch from main to development December 7, 2020 19:27
Copy link
Contributor

@pavsaund pavsaund left a 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?

@einari
Copy link
Contributor Author

einari commented Dec 8, 2020

The problem with the squigglies are related to this: disableSourceOfProjectReferenceRedirect- I see that this was added due to this: microsoft/TypeScript#34677.

2020-12-08_14-02-10 (1)

@pavsaund pavsaund merged commit 88f0645 into development Dec 8, 2020
@pavsaund pavsaund deleted the feature/k8s-api-mock branch December 8, 2020 13:35
joelhoisko pushed a commit that referenced this pull request Mar 3, 2022
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.

2 participants