Kubernetes OpenAPI specification is hosted here.
https://github.com/kubernetes/kubernetes/tree/master/api/openapi-spec
Additionally, various client APIs for the Kubernetes is provided here:
https://kubernetes.io/docs/reference/using-api/client-libraries/
Using the OpenAPI specification, I am able to generate the server code, which provides the REST services. However, the applications using these K8s client APIs (written in either language - Go, Java, etc.) do not use these REST API directly.
My objective is to mock the K8s server to use in the test automation and build a controlled environment to create various test scenarios.
Is there any ready-to-use Kubernetes mock available? If not, how we can interface the client APIs with the above OpenAPI generated REST server? This way, the applications shall continue to use the client APIs but internally, they will be communicating with the mocked K8s server and not the real one.
Please help with the options.
.
Not really a direct answer to your question, but most solutions i have seen implemented are not trying to mock the k8s API but are really using it through either k3s (from rancher labs) or KinD project (official way)
You then connect to it like a normal kubernetes cluster
Related
I would like to know if MLflow currently does support any kind of customization of it's scoring_serving that would allow the ability to register new endpoints to the published Rest API.
By default the scoring server provides /ping and /invocations endpoint, but i would like to include more endpoints in addition to those.
I've seen some resources that allow that kind of behaviour using custom WSGI implementations but i would like to know if extension of the provided mlflow scoring_server is possible in any way, so the default supporty provided by mlflow generated docker images and the deployment management is not lost.
I explored existing official and unofficial documentation, and explored existing github issues and the mlflow codebase in it's github repository.
Also i've explored some alternatives such as using custom WSGI server configuration for starting the Rest API.
Any kind of resource/documentation is greatly appreciated.
Thanks in advance.
As mentioned here:
Harness takes the artifacts and Kubernetes manifests you provide
and deploys them to the target Kubernetes cluster. You can simply
deploy Kubernetes objects via manifests and you can provide manifests
using remote sources and Helm charts.
Is harness tool equipped with kubectl client tool to perform kubectl apply on kubernetes manifests?
If you're curious about the implementation details of the specific tool that are not explained in its official documentation, you should study directly its source code to find the answer.
But answering your specific question:
Is harness tool equipped with kubectl client tool to perform kubectl
apply on kubernetes manifest?
Well, it doesn't have to. Writing a tool which in its code uses a console kubectl client isn't very optimal and doesn't make much sense. For performing exactly the same actions that kubectl does, such tools use Client Libraries. As you can see in the official docs, there is large variety of them, some of them are officialy supported, others are community-maintained, but altogether they support various programming languages.
Of course, you can write an external tool which doesn't use client libraries but implements the API calls and request/response types on its own.
I have a single screen desktop application developed in Java. It is a tool to convert files, given a file in .abc format, the tool converts it to .xyz format. Basically the tool works offline and acts as a translator to convert file from one form to another.
So now, to improve the infrastructure, there are discussions to move the tool to Kubernetes or to provide REST services for the file conversion. I completely have no idea about the containers nor the REST APIs as I am a front-end developer.
More about the tool, as I told earlier, the tool is a single page application, very light doing very minimal job, totally used by 200 users approximately. So, this being the shape and size of the application, which one would be the best approach to go with and why? Basically, I am looking for a short evaluation report of Kubernetes vs REST service and architecture recommendation with reasons.
Currently your application is a standalone application which is quite an old concept.
I can mention high-level changes needs to be done when your file conversion logic would be exposed over Rest Api in Kubernetes world.
you can go through one by one following mentioned areas to get a better understanding design-wise:
java code would be a backend code and its public methods that take inputs from UI actions will be exposed over rest API.
There are multiple rest API's (jersey, rest easy, etc or spring/spring-boot framework also provides rest API support) that you can go through any of them to get an understanding.
once your backend is exposed over the rest API then it needs to be containerized means your backend will be running under the container. Can go through docker documentation and can build one sample containerized app. There is huge material present in this area.
once your backend is containerized then it will be installed in a Kubernetes cluster
Kubernetes is basically a container orchestration tool and it's quite a wide thing. you can through its official documentation for basic understanding.
SPA will be running on a client machine like today also you are able to launch from your desktop but it will communicate with the Kubernetes cluster where your application is presently packaged in a container.
References:
docker :
https://docs.docker.com/
Kubernetes :
https://kubernetes.io/
I have a test Hyperledger Fabric running in the IBM Cloud, with the IBM Blockchain Application Service. I also have a kubernetes cluster running the Hyperledger Composer REST Server. Everything works great, but how do I extend the REST api with some custom api's?
The documentation mentions being able to use the swagger definition (yaml file) with the IBM API Connect or Strongloop product...but how do I do that, as I don't see any way to export the swagger definition?
I don't have a tutorial, but as I see it you would have to do three tasks minimally:
write your REST APIs (to do what you want to do) - perhaps these
resources on REST APIs will help ? -> Loopback ->
https://developer.ibm.com/code/patterns/create-rest-apis-using-loopback/
and in architectural in general
->https://www.ibm.com/developerworks/library/ws-restful/ and
build the routes for your custom APIs
customise your swagger
definitions to document your REST APIs - this may help you ->
https://www.ibm.com/developerworks/library/wa-use-swagger-to-document-and-define-restful-apis/index.html
and Swagger itself -> http://swagger.io/
If you write custom api and call it as 3rd party api which is mentioned in IBM already it will help you to response but it has very limted scope. I belive you should use swagger to understand its end point are properly configured
I'm developing an app deployed in GAE, simple for this moment. This app is the backend of other app.
Internally, this app have a few modules (this is not important here) that they communicate with rest apis (for other reason).
And the question that I'm thinking is: I was beginning to write API (to outside) using gRPC and EndPoints like GAE docs says, when I thought that if I could have really advantages if using gRPC and not REST like internally.
I have been spend a lot of time searching that really advantages that offers gRPC about REST, but I don't find it.
Why Google recommended gRPC? Is faster than REST?, (from my point of view is most simple to write)
You know any test about speed with both technologies?
I will thanking any help.
You can use GRPC today on AppEngine's Managed VM platform as both a client and a server. If you want load balancing you need to use TCP/IP load balancing and have GRPC servers terminate TLS for you.
GRPC does not yet work on AppEngine standard but we're working on it. For more questions hit up the mailing list.