Enoncé TP 2

/images/k8s.jpeg

TP2 : Frontend

🇫🇷 Version Française

Deployment

Créer un deployment pour notre Frontend avec comme image docker : axelpereira/k8s-training-test-app-front:1.0.

Ce deployment va devoir créer des pods qui vont répondre à plusieurs exigences :

  • Ils doivent avoir le label app:front-training-app
  • L’image doit être pull seulement lorsqu’elle n’est pas présente dans notre cluster.
  • On veut 2 pods pour être sûr que si l’un tombe l’autre puisse répondre !

Service

Créer un service qui va servir à exposer nos pods Frontend à l’exterieur de notre cluster via un port de notre machine.

Les machines provisionnées ont très peu de ports ouverts pour des raisons de sécurité en node port il faudra donc utiliser soit le port 30001 ou 30002 ou 30003 en tant que NodePort.

Ce service aura comme nom : front-training-app Ce service ciblera les pods du deployment instancié plus hauts.

On mettra le service en type NodePort afin de pouvoir le tester (via un navigateur à l’url : IP_DE_LA_VM:NODE_PORT).

Note: Votre container applicatif Frontend expose lui uniquement son port 80

🇬🇧 English version

Deployment

Create a deployment for the Frontend with the docker image : axelpereira/k8s-training-test-app-front:1.0.

This deployment will have to create pods that will meet several requirements:

  • They must have the label app:front-training-app
  • The image should only be pulled when it is not present in our cluster.
  • We want 2 pods to be sure that if one falls the other can respond!

Service

Create a service that will be used to expose our Frontend pods outside our cluster via a port on our machine.

The provisioned machines have very few ports open for security reasons as a node port, so it will be necessary to use either port 30001 or 30002 or 30003 as a NodePort.

This service will have the name: front-training-app This service will target the previously instantiated deployment pods.

We will put the service in type NodePort in order to be able to test it (via a browser at the url: VM_IP:NODE_PORT).

Note: Your web application only expose the port : 80

Latest Posts