Singapore Flyer

Tuesday, October 23, 2018

When delete a pod in kubernetes, it respawn the same again

Issue:

When we delete a pod using kubectl command, it get respawn automatically. This is one of the feature of Kubernetes.

[root@compute-instance1 ~]# kubectl get pods | grep ImagePullBackOff
quickstart-se-68d7ffb868-l7pvk                    0/1       ImagePullBackOff   0          12m

[root@compute-instance1 ~]#

How to solve this?

[root@compute-instance1 ~]# kubectl get all
This command will list down all the details.

[root@compute-instance1 ~]# kubectl delete deploy/quickstart-se svc/quickstart-se
deployment "quickstart-se" deleted
service "quickstart-se" deleted
[root@compute-instance1 ~]#

This helps to delete that particular pod from K8s.

Thursday, October 18, 2018

Error starting host: Error getting state for host: machine does not exist

Error when starting minikube after a delete

C:\Windows\System32>minikube start
Starting local Kubernetes v1.10.0 cluster...
Starting VM...
E1018 10:37:54.731596    8556 start.go:174] Error starting host: Error getting state for host: machine does not exist.

 Retrying.
E1018 10:37:54.750682    8556 start.go:180] Error starting host:  Error getting state for host: machine does not exist

C:\Windows\System32>

Solution to fix this error:

1. Change the folder to your .minikube (for me its C:\Users\shvijai\.minikube\cache\iso)
2. Delete the minikube iso file
3. Try minikube start

It works.

Wednesday, October 17, 2018

No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

Error when i do "mvn package"

No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

I am not using any IDE, i am using my cmd prompt. My java version is 1.8 and maven version is 3.5

Solution:
1. Got to your project folder and find the pom.xml file
2. Find the line having "<artifactId>maven-compiler-plugin</artifactId>"
3. Add the following line (based on your java location path)

<plugin>
         <groupId>org.apache.maven.plugins</groupId> 
         <artifactId>maven-compiler-plugin</artifactId>
          <version>3.1</version>
  <configuration>
<fork>true</fork>
<executable>C:\Program Files\Java\jre1.8.0_181\bin\javacpl.exe</executable>
  </configuration>

 </plugin>

4. Save the pom.xml
5. Run "mvn package", it will work.