Friday, December 9, 2022

What is Containers-as-a-Service (CaaS)?

 Containers-as-a-Service (CaaS) is a cloud service that helps manage and deploy apps using container-based abstraction. CaaS can be deployed on-premises or in a cloud.

  • Containers and CaaS make it much easier to deploy and design distributed applications or build smaller service.  
  • During development, a collection of containers may handle different responsibilities or different coding environments.
  • Network protocol relationships between containers can be defined and binding to forwarding.  
  • CaaS promise that these defined and dedicated container structures can be deployed quickly in cloud capture.
  • For considering an example, Think of a fake software program designed with a microservice design, in which the service plan is organized with a business domain ID. Service domains can be: payments, authentication, and a shopping cart.  

  • Why Caas is important :

    • Helps developers to develop fully scaled container as well as application deployment.
    • Helps in simplifying container management.
    • Helps in automating key IT functions like Google Kubernetes and docker.
    • Helps in increasing team development velocity which results rapid development and deployment

Friday, April 29, 2022

NotAMockException: Argument should be a mock, but is: class java.lang.Class

Argument should be a mock, but is: class java.lang.Class

org.mockito.exceptions.misusing.NotAMockException: Argument should be a mock, but is: class java.lang.Class

at nternal.runners.TestMethod.invoke(TestMethod.java:68)

at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:89)

at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:97)

at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:87)

at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:50)

at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:34)

at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:44)

at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:93)

at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:40)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:529)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:756)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:452)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:210)

 Solution:

From the above description, we can know that the problem is org.mockito.internal.stubbing.answers.InvocationInfo.isVoid, stay mockito-core It's a bag . And those that include this sub package are spring-boot-starter-parentmockito-inlinepowermock-api-mockito2.

Remove  mockito-inline from  class path 
and run tests 
Reference:
https://javamana.com/2022/01/202201070338549908.html

Saturday, April 9, 2022

Kubernetes Vs Rancher

What is Difference Between Kubernetes and Rancher 

The difference between Kubernetes and Rancher is that Kubernetes is a technology for managing containers organized under a cluster of virtual or physical machines. Rancher is a technology for managing Kubernetes clusters en masse. Both of these tools are important considerations for any organization building a cloud-native, DevOps technology stack.

Kubernetes is the leader in container orchestration. It offers teams the flexibility to efficiently run containerized workloads across multiple public cloud providers and hybrid cloud environments. Kubernetes offers advanced scheduling and scaling capabilities to ensure application performance and high availability. However, its functionality focuses on managing resources within a single cluster.


Rancher, on the other hand, is a platform designed to manage multiple Kubernetes clusters. It eases Kubernetes cluster management in large environments in several ways. For example, Rancher simplifies operations such as cluster provisioning, centralized security management, and monitoring workloads using popular tools such as Prometheus. Additionally, Rancher has an extensive application catalog of Helm charts for various applications such as Kubecost, Prometheus, Grafana, and MySQL.


Kubernetes Features

The following table summarizes some of the key benefits of using Kubernetes:

1)Cloud provider-agnostic

Kubernetes based platform is easily migratable across cloud providers

2)Enables easy scaling

Containerized applications are comparatively easier to scale as compared to traditional applications hosted in virtual machines (VM)

3)Resource usage optimization

Configuration parameters make it relatively easy to control cluster density and autoscaling

4)Self-healing

In case of a node failure, pods are automatically rescheduled to other nodes

Important Rancher featuresPermalink


Rancher Features

1)Cluster provisioning and import

Rancher lets you create new clusters or add existing ones to it

2)The concept of projects

Rancher introduces the concept of projects for better grouping of namespaces

3)Extended RBAC control

User permissions can be configured per project across clusters

4)Easy workload deployment

Users can use the Rancher UI to deploy their workloads without updating a YAML file

5)Monitoring and alerting

Allows users to create notifications and push cluster logs to different backends

5)Extensive application catalog

Similar to the app store on your smart


Conclusion

The rapid adoption of Kubernetes leaves many teams with the cumbersome reality of managing too many clusters. Rancher is solving this pain point by simplifying and automating Kubernetes cluster management. With the addition of Kubecost, teams can allocate costs across clusters by aligning with the core concept of a Rancher Project, and using labels to further refine their cost visibility.


Thursday, February 17, 2022

Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.

Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.


 .   ____          _            __ _ _

 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \

( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \

 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )

  '  |____| .__|_| |_|_| |_\__, | / / / /

 =========|_|==============|___/=/_/_/_/

 :: Spring Boot ::                (v2.4.8)


2022-02-17T19:41:33,738 [main] INFO c.n.c.i.r.c.RunClaas - Starting RunClaas using Java 1.8.0_162 on N-5CG5091JBX with PID 50680 (C:\myorg-cache_New\cache\implementation\myorg-cachecache-nova-Interface\target\classes started by hsk in C:\ICE_New\myorg-cache-cache\implementation\myorg-cachecache-nova-Interface)

2022-02-17T19:41:33,757 [main] INFO c.n.c.i.r.c.RunClaas - No active profile set, falling back to default profiles: default

2022-02-17T19:41:34,313 [main] ERROR o.s.b.SpringApplication - Application run failed

org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.

at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:162) ~[spring-boot-2.4.8.jar:2.4.8]

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:577) ~[spring-context-5.3.8.jar:5.3.8]

at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:144) ~[spring-boot-2.4.8.jar:2.4.8]

at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:771) ~[spring-boot-2.4.8.jar:2.4.8]

at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:763) [spring-boot-2.4.8.jar:2.4.8]

at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:438) [spring-boot-2.4.8.jar:2.4.8]

at org.springframework.boot.SpringApplication.run(SpringApplication.java:339) [spring-boot-2.4.8.jar:2.4.8]

at org.springframework.boot.SpringApplication.run(SpringApplication.java:1329) [spring-boot-2.4.8.jar:2.4.8]

at org.springframework.boot.SpringApplication.run(SpringApplication.java:1318) [spring-boot-2.4.8.jar:2.4.8]

at com.nokia.cemod.test.rest.controller.RunClaas.main(RunClaas.java:10) [classes/:?]

Caused by: org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.

at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.getWebServerFactory(ServletWebServerApplicationContext.java:209) ~[spring-boot-2.4.8.jar:2.4.8]

at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:179) ~[spring-boot-2.4.8.jar:2.4.8]

at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:159) ~[spring-boot-2.4.8.jar:2.4.8]

... 9 more

Fix

1)application.properties
Add
spring.main.web-application-type=none

2)Ensure @SpringBootApplication is used 

@SpringBootApplication
public class RunClaas {
public static void main(String[] args) {
SpringApplication.run(target.class,arg)
}

Friday, January 14, 2022

What is CaaS

What is CaaS? 

Containers-as-a-Service (CaaS) is a cloud service that helps manage and deploy apps using container-based abstraction. CaaS can be deployed on-premises or in a cloud.

 Containers as a service (CaaS) is a cloud service that allows software developers and IT departments to upload, organize, run, scale, manage and stop containers by using container-based virtualization. A CaaS provider will commonly provide a framework which allows users to make use of the service.

 Google Container Engine(GKE), AWS (ECS), Azure (ACS) and Pivotal (PKS) are some examples of CaaS.


Containers-as-a-service (CaaS) is a category of cloud services where the service provider offers customers the ability to manage and deploy containerized application and clusters. CaaS is sometimes viewed as a special sub-type of the Infrastructure-as-a-service (IaaS) cloud service delivery model, but where the main commodity is containers rather than physical hardware and virtual machines.

Containers essentially function as an alternative to the traditional virtualization approach, where instead of virtualizing the hardware stack using virtual machines, containers virtualize at the level of the operating system. As a result, containers run far more efficiently than virtual machines. They use fewer resources and a fraction of the memory as compared to virtual machines that need to boot an entire OS each time they are initialized.

Within the Container-as-a-Service (CaaS) layer, VMs with VMware Photon OS as the guest OS are used as container hosts to provision Tanzu Kubernetes clusters. The container hosts that host the CNFs are commonly called Worker Node VMs or Worker Nodes

Troubleshooting Docker Image Format: Ensuring Docker v2 Instead of OCI

  Troubleshooting Docker Image Format: Ensuring Docker v2 Instead of OCI Introduction While working with Docker 27+ , I encountered an iss...