Spring Cloud Kubernetes vs. Kubernetes API Client - kubernetes

I want to run a restapi server, a spring boot app, to kick start other docker containers inside of the same kubernetes cluster. I found these 2 packages:Spring Cloud Kubernetes and Kubernetes API Client. I am confused on what the difference between the two and which one should I use.

With Spring cloud cal version (2020.x.x), spring cloud Kubernetes comes with two implementations - Fabric8 and Kubernetes Java Client. See here.
NOTE - Prior to spring-cloud cal version spring-cloud-kubernetes used fabric8 impl
Both implementations works fine. While there are many, here is one of the blog comparing the two. In general Fabric8 seems to have more features.
I am not sure if the Spring community prefers any particular impl. Both projects are active.
Spring example here.
I too have an example using Frabric8 on github.

Related

Spring Cloud OpenFeign vs WebClient

For Spring Boot based microservices communicating with each other via load-balanced clients (with Spring Cloud LoadBalancer) which client should be used, WebClient or OpenFeign?
From what I’ve read they both support Spring Cloud LoadBalancer. I know that WebClient also supports reactive, but that is not a feature we need.
Are both clients going to continue to be supported by Spring for the foreseeable future?
From what I can see Spring seems to be pushing WebClient. However, I still see development activity going on in the spring-cloud-openfeign github repo.
OpenFeign seems to be an easier/cleaner to use way of creating the clients, but are there any drawbacks compared to WebClient?

How to run SCDF using weblogic?

I am trying to use Weblogic instead of Tomcat to bring up SCDF locally. I am unable to find the respective guide on spring.io. Any pointer would help.
Spring Cloud Data Flow builds on the Spring Boot foundation. We ship the uber-jar binary through Maven Central and/or as a container image in DockerHub or Bitnami.
You would start/run the shipped binary stand alone either in the bare-metal VMs or in a container orchestration platforms like Kubernetes.
Weblogic doesn't fit any of the functional and non-functional requirements that we expect (in SCDF) to be useful for a production setting. Simply put, you won't be able to run SCDF in Weblogic.
Please consider experimenting with SCDF using Docker Compose or Kubernetes instead.

How to mock the Kubernetes cluster/server?

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

How to check the SLA of a webservices

We currently deployed our Spring Boot Application in GKE(Google Kubernetes Engine) and we are currently using cloud endpoint to secure our web services. We have 11 web service developed which will be consumed by external clients. Is there any way i check the SLO (times, performance) of a webservice in cloud endpoint or in stackdriver.
You might want to check:
Spring sleuth
Jaeger operator
Jaeger is a opentracing standard and can help understand the values, and sleuth is a tool to integrate with spring, there are several options, you might want also to consider opencensus
First you need to expose metrics from your applications. Spring Sleuth is a great choice if you're using Spring Boot.
Then you need to collect the metrics and visualize them. Google provides a tool for that called Stackdriver Trace. It can also do metric-based alerts. You can find a sample setup for your use case here.
There are other performance monitoring services such as Dynatrace or Datadog.
If you want a self-hosted solution, you can use Zipkin which is inspired by an internal Google system called Dapper.
Have you looked at Google cloud console UI? Its "Endpoints" tag should show all services your project is running.

what are the advantages of aws cloud config over spring cloud config?

Based on what parameters can we decide on a config server? aws cloud config vs spring cloud config server?
if the application is developed based on Spring framework, which one will be a better option? aws-cloud-config / spring-config?
does both support XML/properties configuration other than YAML?
Can both be configured for High Availability?
Is it possible to define a workflow (for approval of changes that need to be moved to PRODUCTION, using jenkins for example?)
If your application is based on Spring, it makes sense to use Spring Cloud Config as you would be using a specific framework instead of a Generic framework like AWS config
yes, Spring Cloud Config supports both YAML and property files
Ultimately the Spring Cloud Config is a Spring Boot App, hence you can make it high available using the same strategy that we use for any Spring Application
The simplest Approval work flow would be
Configure your Jenkins Job to send mail for approval
Set-up Promotion using https://wiki.jenkins.io/display/JENKINS/Promoted+Builds+Plugin
Deploy the Artificats to the specific environment