Nginx service not starting

12/9/2017

Am trying to setup Minikube, and have a challenge. My minikube is setup, and I started the Nginex pod. I can see that the pod is up, but the service doesn't appear as active. On dashboard too, although the pod appears the depolyment doesn't show up. Here are my power shell command outputs.

Am learning this technology and may have missed something. My understanding is that when using docker tools, no explicit configurations are necessary at docker level, other than setting it up. Am I wrong here ? If so where ?

relevant PS output

-- Naleendra Weerapitiya
docker
kubernetes
minikube

2 Answers

12/10/2017

Lets deploy hello-nginx deployment

C:\> kubectl.exe run hello-nginx --image=nginx --port=80
deployment "hello-nginx" created

View List of pods

c:\> kubectl.exe get pods
NAME                           READY     STATUS    RESTARTS   AGE
hello-nginx-6d66656896-hqz9j   1/1       Running   0          6m

Expose as a Service

c:\> kubectl.exe expose deployment hello-nginx --type=NodePort
service "hello-nginx" exposed

List exposed services using minikube

c:\> minikube.exe service list
|-------------|----------------------|-----------------------------|
|  NAMESPACE  |         NAME         |             URL             |
|-------------|----------------------|-----------------------------|
| default     | hello-nginx          | http://192.168.99.100:31313 |
| default     | kubernetes           | No node port                |
| kube-system | kube-dns             | No node port                |
| kube-system | kubernetes-dashboard | http://192.168.99.100:30000 |
|-------------|----------------------|-----------------------------|

Access Nginx from browser http://192.168.99.100:31313

-- jittakal
Source: StackOverflow

12/10/2017

This method can be used this worked for me on centos 7

$ systemctl enable nginx 

$ systemctl restart nginx 

or

$ systemctl start nginx 
-- HSN KH
Source: StackOverflow