<p>Since your new in this platform, I would suggest you to explore in the bellow order (assuming you want to use nginx as the load balancer ingress controller):</p>
<p>1- <a href="https://kubernetes.io/docs/tutorials/kubernetes-basics/" rel="nofollow noreferrer">This tutorial</a> is the most complete to get started with k8s. I strongly suggest you to follow it through to understand the jargon and the working components before going to the next steps.</p>
<p>2- Take a look at <a href="https://kubernetes.io/docs/tasks/run-application/run-stateless-application-deployment/" rel="nofollow noreferrer">this example</a> where they go through creating an nginx application in a k8s cluster.</p>
<p>3- Look at <a href="https://thenewstack.io/kubernetes-ingress-for-beginners/" rel="nofollow noreferrer">this tutorial</a> where the author describes the key concepts and working operation of an ingress controller.</p>
<p>4- Finally, <a href="https://kubernetes.github.io/ingress-nginx/deploy/" rel="nofollow noreferrer">look at this</a> to start setting up your ingress controller from the official doc page. Other resources are available to allow you to setup as much as you'd like.</p>
<p>Extra: Here is the official k8s <code>kubectl</code> <a href="https://kubernetes.io/docs/reference/kubectl/cheatsheet/" rel="nofollow noreferrer">cheat sheet</a>.</p>

CC BY-SA 4.0
2020-08-05T15:51:41.513Z
The first tutorial was working fine, but it deploys only. How can I access the nginx on my computer (or somebody else in the network)? The 3 VMs have different IPs and how can I know, which IP is used for the deployment. It starts two replicas and so "on which IP" and on "which port" - because there are no processes listining on port 80.
TRW
CC BY-SA 4.0
2020-08-05T15:51:50.237Z
The second tutorial looks good, put stops already after the first command with a 404. The github repo changed the location of the "mandatory" resources - i tried a little bit with other solution (helm nginx) and the last kubectl create stops with "connection refused". So sad - the tutorial looks good, but it is outdated
TRW
CC BY-SA 4.0
2020-08-05T15:51:58.760Z
The third tutorial helped me a litte bit with the second tuturial - but - because I'm not able to combine the services with the ingress - I can't see the last step with curl http://<ip>/apple etc.
TRW
CC BY-SA 4.0
2020-08-05T16:40:14.267Z
Ok, I see where you are at now. Let me edit the answer to give you and others a better starting point. As for the details on which IP a pod is running, you can do `kubectl get po -o wide`
gmolaire
CC BY-SA 4.0
2020-08-05T16:49:45.890Z
In k8s, a pod is the smallest unit of encapsulation you can have. Within it, you can have one or more containers. If you want to connect to one of them, you can use the same docker command you would use to login: `kubectl exec -it <NAME_OF_YOUR_K8S_POD> <COMMAND>`.
I suppose you want to have access to its cli, you can try run `kubectl exec -it <NAME_OF_YOUR_K8S_POD> bash` or `kubectl exec -it <NAME_OF_YOUR_K8S_POD> sh`.
gmolaire
CC BY-SA 4.0
2020-08-05T16:51:18.170Z
I changed the second tutorial which is now the third one. Look into it, it might help you when you are done with the basics.
gmolaire
CC BY-SA 4.0
2020-08-07T08:19:21.303Z
Thanks - I've learned a lot about K8S now and I think, my problem is "deeper", see https://stackoverflow.com/questions/63280939/k8s-tutorial-fails-on-my-local-installation-with-i-o-timeout - so maybe my problems in the past are that I have an issue in my setup (which I don't understand). But your answer helped me, to understand how it works.
TRW
CC BY-SA 4.0
2020-08-05T02:12:49.763Z
2020-08-05T16:45:03.410Z
2020-08-05T16:45:03.410Z
gmolaire
<p>I've 3 Debian-10 VMs on a bare metal Proxmox host in my network and installed via Ansible the roles <code>geerlingguy.docker</code> and <code>geerlingguy.kubernetes</code> with complete default settings. The kubeadm on the master node shows me the three nodes. So, I think, the installation is fine.</p>
<p>And what now? I'm new to kubernetes, I know there are configs that need to be applied. But how can I &quot;see&quot; them or &quot;change&quot; them via Kubernetes/Ansible. I don't want go back to the command line here. I know about the 'k8s' module - but the examples are not very helpful. A kubernetes should have an ingress controller and some services. Is there a good example playbook for installing Traefik/Haproxy/Nginx/whatever and maybe a small example hello-world-example for Kubernetes? Is there a &quot;map&quot; of possible values for all the YAML options (I used to learn from examples)</p>
<p>Sorry for the very &quot;open&quot; question. I'm searching for some days now and either my questions to Google are wrong or Google sends me always to the same sites with either very &quot;basic&quot; informations that ends by installing the Kubernetes or very &quot;heavy&quot; information, where the author is far away from easy to read.</p>
<p>To make the question a litte bit more concrete.</p>
<ul>
<li>The 3 VM's with IP 192.168.10.10-192.168.10.12 are running with Kubernetes 1.17.9 on Docker 19.03.12</li>
<li>I've installed Helm v3.2.4, some repos (Traefik, Nginx, Stable-Kubernetes-Charts)</li>
<li>I'm able to install with Helm some -don't know - are that pods or services?</li>
<li>I'd like to add a simple hello-world HTTP service, like <a href="https://matthewpalmer.net/kubernetes-app-developer/articles/kubernetes-ingress-guide-nginx-example.html" rel="nofollow noreferrer">that</a> from gmolaire (thanks!)</li>
<li>That service is exposed to one of the three VMs on port 80</li>
</ul>
<p>When I run that tutorial with step <code>kubectl create -f ingress.yaml</code>
I'm getting the error</p>
<pre><code>Error from server (InternalError): error when creating &quot;ingress.yaml&quot;: 
Internal error occurred: failed calling webhook &quot;validate.nginx.ingress.kubernetes.io&quot;: Post https://ingress-nginx-controller-admission.ingress-nginx.svc:443/extensions/v1beta1/ingresses?timeout=30s: dial tcp 10.105.231.128:443: connect: connection refused
</code></pre>
<p>This might be, because I cannot run <code>kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/mandatory.yaml</code> it ends with a 404.</p>

CC BY-SA 4.0
2020-08-06T13:18:52.740Z
where did you get this URL for the mandatory.yaml? In the official nginx doc, since you are on bare metal, you should use this: latest (https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/provider/baremetal/deploy.yaml) or a specific version from the doc (https://kubernetes.github.io/ingress-nginx/deploy/#bare-metal)
gmolaire
<kubernetes><ansible>
Installing ingress controller, services and pods on K8s via Ansible
TRW
# Installing ingress controller, services and pods on K8s via Ansible

(Asked by: username_0 on 2020-08-04)

I've 3 Debian-10 VMs on a bare metal Proxmox host in my network and installed via Ansible the roles geerlingguy.docker and geerlingguy.kubernetes with complete default settings. The kubeadm on the master node shows me the three nodes. So, I think, the installation is fine.
And what now? I'm new to kubernetes, I know there are configs that need to be applied. But how can I "see" them or "change" them via Kubernetes/Ansible. I don't want go back to the command line here. I know about the 'k8s' module - but the examples are not very helpful. A kubernetes should have an ingress controller and some services. Is there a good example playbook for installing Traefik/Haproxy/Nginx/whatever and maybe a small example hello-world-example for Kubernetes? Is there a "map" of possible values for all the YAML options (I used to learn from examples)
Sorry for the very "open" question. I'm searching for some days now and either my questions to Google are wrong or Google sends me always to the same sites with either very "basic" informations that ends by installing the Kubernetes or very "heavy" information, where the author is far away from easy to read.
To make the question a litte bit more concrete.

The 3 VM's with IP 192.168.10.10-192.168.10.12 are running with Kubernetes 1.17.9 on Docker 19.03.12
I've installed Helm v3.2.4, some repos (Traefik, Nginx, Stable-Kubernetes-Charts)
I'm able to install with Helm some -don't know - are that pods or services?
I'd like to add a simple hello-world HTTP service, like that from username_1 (thanks!)
That service is exposed to one of the three VMs on port 80

When I run that tutorial with step kubectl create -f ingress.yaml
I'm getting the error
Error from server (InternalError): error when creating "ingress.yaml": 
Internal error occurred: failed calling webhook "validate.nginx.ingress.kubernetes.io": Post https://ingress-nginx-controller-admission.ingress-nginx.svc:443/extensions/v1beta1/ingresses?timeout=30s: dial tcp 10.105.231.128:443: connect: connection refused

This might be, because I cannot run kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/mandatory.yaml it ends with a 404.

**Tags:** kubernetes, ansible

> **Comments:**
> **username_1**: where did you get this URL for the mandatory.yaml? In the official nginx doc, since you are on bare metal, you should use this: latest (https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/provider/baremetal/deploy.yaml) or a specific version from the doc (https://kubernetes.github.io/ingress-nginx/deploy/#bare-metal)  

---

## 1 answers

### Answer by username_1 on 2020-08-05. Score: 3 | Accepted answer

Since your new in this platform, I would suggest you to explore in the bellow order (assuming you want to use nginx as the load balancer ingress controller):

1- [This tutorial](https://kubernetes.io/docs/tutorials/kubernetes-basics/) is the most complete to get started with k8s. I strongly suggest you to follow it through to understand the jargon and the working components before going to the next steps.

2- Take a look at [this example](https://kubernetes.io/docs/tasks/run-application/run-stateless-application-deployment/) where they go through creating an nginx application in a k8s cluster.

3- Look at [this tutorial](https://thenewstack.io/kubernetes-ingress-for-beginners/) where the author describes the key concepts and working operation of an ingress controller.

4- Finally, [look at this](https://kubernetes.github.io/ingress-nginx/deploy/) to start setting up your ingress controller from the official doc page. Other resources are available to allow you to setup as much as you'd like.

Extra: Here is the official k8s `kubectl` [cheat sheet](https://kubernetes.io/docs/reference/kubectl/cheatsheet/).

> **Comments:**
> **username_0**: The first tutorial was working fine, but it deploys only. How can I access the nginx on my computer (or somebody else in the network)? The 3 VMs have different IPs and how can I know, which IP is used for the deployment. It starts two replicas and so "on which IP" and on "which port" - because there are no processes listining on port 80.  
> **username_0**: The second tutorial looks good, put stops already after the first command with a 404. The github repo changed the location of the "mandatory" resources - i tried a little bit with other solution (helm nginx) and the last kubectl create stops with "connection refused". So sad - the tutorial looks good, but it is outdated  
> **username_0**: The third tutorial helped me a litte bit with the second tuturial - but - because I'm not able to combine the services with the ingress - I can't see the last step with curl http://<ip>/apple etc.  
> **username_1**: Ok, I see where you are at now. Let me edit the answer to give you and others a better starting point. As for the details on which IP a pod is running, you can do `kubectl get po -o wide`  
> **username_1**: In k8s, a pod is the smallest unit of encapsulation you can have. Within it, you can have one or more containers. If you want to connect to one of them, you can use the same docker command you would use to login: `kubectl exec -it <NAME_OF_YOUR_K8S_POD> <COMMAND>`. I suppose you want to have access to its cli, you can try run `kubectl exec -it <NAME_OF_YOUR_K8S_POD> bash` or `kubectl exec -it <NAME_OF_YOUR_K8S_POD> sh`.  
> **username_1**: I changed the second tutorial which is now the third one. Look into it, it might help you when you are done with the basics.  
> **username_0**: Thanks - I've learned a lot about K8S now and I think, my problem is "deeper", see https://stackoverflow.com/questions/63280939/k8s-tutorial-fails-on-my-local-installation-with-i-o-timeout - so maybe my problems in the past are that I have an issue in my setup (which I don't understand). But your answer helped me, to understand how it works.  

---

