Skip to content
Snippets Groups Projects
Commit e41193cc authored by remche's avatar remche
Browse files

better coredns test

parent e4537e00
Branches
No related tags found
No related merge requests found
......@@ -84,33 +84,33 @@ kubectl top pods -A
Pour tester le service de DNS (qui est derrière le mécanisme de *Service Discovery*), lançez un pod nginx et vérifiez qu'il tourne :
```bash
kubectl run --image nginx web
kubectl expose pod web --port 80
kubectl run --image nginx nginx-pod
kubectl expose pod nginx-pod --port 80
kubectl get pods -o wide
pod_ip=$(kubectl get pod nginx-pod -o jsonpath='{.status.podIP}')
kubectl get service
service_ip=$(kubectl get service nginx-pod -o jsonpath='{.spec.clusterIP}')
```
Essayez de l'atteindre depuis un autre pod, via son IP, l'IP du service, puis le nom DNS du service :
```bash
kubectl run --rm --restart=Never -i -t --image busybox test /bin/sh
wget -O- $ip_du_pod_nginx
wget -O- $ip_du_service
wget -O- web
kubectl run --rm --restart=Never -it --image busybox test -- wget -O- $pod_ip
kubectl run --rm --restart=Never -it --image busybox test -- wget -O- $service_ip
kubectl run --rm --restart=Never -it --image busybox test -- wget -O- nginx-pod
```
Déployez CoreDNS, vérifiez qu'il tourne bien et testez à nouveau la résolution DNS :
```bash
microk8s enable dns
kubectl get pods -A
kubectl run --rm --restart=Never -i -t --image busybox test /bin/sh
wget -O- web
kubectl run --rm --restart=Never -it --image busybox test -- wget -O- nginx-pod
```
### Nettoyage
```bash
kubectl delete service web
kubectl delete pod web
kubectl delete service nginx-pod
kubectl delete pod nginx-pod
```
## Vapormap
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment